From 0b38ce5ba36c8c01cdc4b2005fdf7e32223719fa Mon Sep 17 00:00:00 2001 From: Robert S Date: Tue, 21 Oct 2014 19:20:46 -0400 Subject: [PATCH] Compressed sub folder into main src folder making compile time easier --- .../mcp/mobius/waila/api/IWailaBlock.java | 34 - .../waila/api/IWailaBlockDecorator.java | 9 - .../mobius/waila/api/IWailaConfigHandler.java | 28 - .../mobius/waila/api/IWailaDataAccessor.java | 33 - .../mobius/waila/api/IWailaDataProvider.java | 33 - .../waila/api/IWailaEntityAccessor.java | 24 - .../waila/api/IWailaEntityProvider.java | 16 - .../mobius/waila/api/IWailaFMPAccessor.java | 28 - .../mobius/waila/api/IWailaFMPDecorator.java | 7 - .../mobius/waila/api/IWailaFMPProvider.java | 12 - .../mcp/mobius/waila/api/IWailaRegistrar.java | 56 - .../waila/api/IWailaSummaryProvider.java | 21 - .../mcp/mobius/waila/api/SpecialChars.java | 40 - .../mcp/mobius/waila/api/package-info.java | 3 - archive/java/dark/lib/BlockFluid.java | 52 - .../java/dark/lib/ClientRegistryProxy.java | 32 - archive/java/dark/lib/CoreRegistry.java | 257 ----- archive/java/dark/lib/EnumMaterial.java | 143 --- archive/java/dark/lib/EnumOrePart.java | 41 - archive/java/dark/lib/IExtraInfo.java | 60 -- .../dark/lib/LaserEntityDamageSource.java | 36 - archive/java/dark/lib/OtherDamageSource.java | 52 - archive/java/dark/lib/RegistryProxy.java | 22 - archive/java/dark/lib/helpers/ColorCode.java | 95 -- .../dark/lib/interfaces/IControlReceiver.java | 20 - .../dark/lib/interfaces/IExtendedStorage.java | 13 - .../dark/lib/interfaces/IExternalInv.java | 13 - archive/java/dark/lib/interfaces/IInvBox.java | 21 - .../java/dark/lib/interfaces/IPowerLess.java | 16 - .../java/dark/lib/interfaces/IReadOut.java | 37 - .../dark/lib/interfaces/IRotatableBlock.java | 19 - .../dark/lib/prefab/invgui/ContainerFake.java | 32 - .../java/dark/lib/prefab/invgui/GuiBase.java | 167 --- .../lib/prefab/invgui/GuiButtonImage.java | 78 -- .../prefab/invgui/GuiMachineContainer.java | 209 ---- .../dark/lib/prefab/invgui/GuiMessageBox.java | 109 -- .../lib/prefab/invgui/IMessageBoxDialog.java | 6 - .../lib/prefab/invgui/ISlotPickResult.java | 17 - .../dark/lib/prefab/invgui/ISlotWatcher.java | 8 - .../java/dark/lib/prefab/invgui/InvChest.java | 256 ----- .../lib/prefab/invgui/SlotCraftingResult.java | 37 - .../lib/prefab/invgui/SlotEnergyItem.java | 26 - .../dark/lib/prefab/invgui/SlotSpecific.java | 92 -- .../dark/lib/prefab/invgui/WatchedSlot.java | 26 - .../lib/recipes/MachineRecipeHandler.java | 313 ------ .../dark/lib/recipes/ProcessorRecipe.java | 23 - .../java/dark/lib/recipes/ProcessorType.java | 30 - .../api/events/AutoCraftEvent.java | 40 - .../api/events/LaserEvent.java | 280 ----- .../api/events/MachineEvent.java | 30 - .../api/events/MachineMiningEvent.java | 83 -- .../api/recipe/MachineRecipes.java | 103 -- .../api/recipe/OreDetectionBlackList.java | 30 - .../api/recipe/RecipeUtils.java | 120 --- .../resonantinduction/archaic/Archaic.java | 51 - .../archaic/ClientProxy.java | 6 - .../archaic/CommonProxy.java | 8 - .../archaic/blocks/BlockColorGlass.java | 59 -- .../archaic/blocks/BlockColorGlowGlass.java | 13 - .../archaic/blocks/BlockColorSand.java | 100 -- .../archaic/blocks/BlockColored.java | 100 -- .../archaic/blocks/BlockTurntable.java | 260 ----- .../archaic/blocks/ItemBlockColored.java | 34 - .../resonantinduction/core/ClientProxy.java | 51 - .../resonantinduction/core/CommonProxy.java | 24 - .../resonantinduction/core/Reference.java | 34 - .../core/ResonantInduction.java | 127 --- .../core/ResonantInductionTabs.java | 30 - .../java/resonantinduction/core/Settings.java | 94 -- .../resonantinduction/core/SoundHandler.java | 32 - .../java/resonantinduction/core/Utility.java | 54 - .../core/debug/BlockDebug.java | 208 ---- .../core/debug/ItemInstaHole.java | 56 - .../core/debug/TileEntityInfFluid.java | 116 --- .../core/debug/TileEntityInfLoad.java | 32 - .../core/debug/TileEntityInfSupply.java | 53 - .../core/debug/TileEntityVoid.java | 66 -- .../core/handler/FluidEventHandler.java | 42 - .../core/handler/ILinkable.java | 19 - .../core/handler/LinkEventHandler.java | 81 -- .../core/network/ISimplePacketReceiver.java | 25 - .../core/network/PacketIDTile.java | 72 -- .../core/part/BlockMachinePart.java | 17 - .../core/prefab/ProxyBase.java | 33 - .../core/prefab/block/BlockBase.java | 35 - .../core/prefab/block/BlockIOBase.java | 29 - .../core/prefab/block/BlockImprintable.java | 145 --- .../core/prefab/block/BlockMachine.java | 37 - .../core/prefab/block/BlockRotatableBase.java | 27 - .../core/prefab/item/ItemBase.java | 23 - .../core/prefab/part/ItemMultipartBase.java | 23 - .../core/prefab/part/PacketMultiPart.java | 64 -- .../core/prefab/part/PartAdvanced.java | 37 - .../prefab/tile/TileEntityEnergyMachine.java | 421 -------- .../prefab/tile/TileEntityFilterable.java | 121 --- .../core/prefab/tile/TileEntityInv.java | 341 ------- .../core/prefab/tile/TileEntityMachine.java | 245 ----- .../core/prefab/tile/TileGenerator.java | 100 -- .../core/render/InvertX.java | 25 - .../core/resource/BlockGasOre.java | 196 ---- .../core/resource/BlockOre.java | 167 --- .../core/resource/GasOreGenerator.java | 128 --- .../core/resource/ResourceGenerator.java | 151 --- .../resource/fluid/BlockFluidMixture.java | 53 - .../core/resource/fluid/TileFluidMixture.java | 90 -- .../core/resource/item/ItemBlockOre.java | 34 - .../core/resource/item/ItemDust.java | 90 -- .../core/resource/item/ItemParts.java | 130 --- .../core/tilenetwork/INetworkContainer.java | 22 - .../core/tilenetwork/INetworkEnergyPart.java | 22 - .../core/tilenetwork/INetworkPart.java | 20 - .../core/tilenetwork/ITileConnector.java | 44 - .../core/tilenetwork/ITileNetwork.java | 68 -- .../tilenetwork/prefab/NetworkPathFinder.java | 52 - .../prefab/NetworkResourceSupply.java | 31 - .../prefab/NetworkSharedPower.java | 156 --- .../prefab/NetworkTileEntities.java | 280 ----- .../prefab/NetworkUpdateHandler.java | 159 --- .../electrical/ClientProxy.java | 79 -- .../electrical/CommonProxy.java | 64 -- .../electrical/Electrical.java | 241 ----- .../electrical/MultipartElectrical.java | 49 - .../electrical/armbot/BlockArmbot.java | 142 --- .../electrical/armbot/Program.java | 355 ------- .../electrical/armbot/TaskBase.java | 206 ---- .../electrical/armbot/TaskBaseArmbot.java | 40 - .../electrical/armbot/TaskBaseLogic.java | 12 - .../electrical/armbot/TaskBaseProcess.java | 84 -- .../electrical/armbot/TileEntityArmbot.java | 542 ---------- .../electrical/armbot/command/TaskBreak.java | 92 -- .../electrical/armbot/command/TaskDrop.java | 32 - .../electrical/armbot/command/TaskEnd.java | 18 - .../electrical/armbot/command/TaskFire.java | 198 ---- .../electrical/armbot/command/TaskGOTO.java | 118 --- .../electrical/armbot/command/TaskGive.java | 125 --- .../armbot/command/TaskGrabEntity.java | 135 --- .../armbot/command/TaskGrabItem.java | 84 -- .../armbot/command/TaskGrabPrefab.java | 61 -- .../armbot/command/TaskHarvest.java | 22 - .../electrical/armbot/command/TaskIF.java | 102 -- .../electrical/armbot/command/TaskIdle.java | 108 -- .../electrical/armbot/command/TaskPlace.java | 102 -- .../electrical/armbot/command/TaskReturn.java | 18 - .../armbot/command/TaskRotateBy.java | 102 -- .../armbot/command/TaskRotateTo.java | 100 -- .../electrical/armbot/command/TaskStart.java | 24 - .../electrical/armbot/command/TaskTake.java | 113 --- .../electrical/armbot/command/TaskUse.java | 128 --- .../electrical/battery/BatteryStructure.java | 55 - .../electrical/battery/BlockBattery.java | 101 -- .../electrical/battery/ItemBlockBattery.java | 161 --- .../electrical/battery/RenderBattery.java | 40 - .../electrical/battery/TileBattery.java | 189 ---- .../generator/solar/BlockSolarPanel.java | 42 - .../generator/solar/ModelSolarPanel.java | 76 -- .../generator/solar/RenderSolarPanel.java | 30 - .../generator/solar/TileSolarPanel.java | 35 - .../electrical/levitator/BlockFilter.java | 17 - .../electrical/levitator/BlockLevitator.java | 106 -- .../levitator/ItemBlockContractor.java | 45 - .../levitator/ModelEMContractor.java | 246 ----- .../levitator/PathfinderEMContractor.java | 83 -- .../electrical/levitator/RenderLevitator.java | 73 -- .../levitator/ThreadEMPathfinding.java | 41 - .../electrical/levitator/TileEMLevitator.java | 621 ----------- .../electrical/multimeter/GuiMultimeter.java | 108 -- .../electrical/multimeter/ItemMultimeter.java | 100 -- .../multimeter/ItemReadoutTools.java | 199 ---- .../electrical/multimeter/PartMultimeter.java | 380 ------- .../multimeter/RenderMultimeter.java | 155 --- .../ElectricalBlockRenderingHandler.java | 99 -- .../electrical/render/FXElectricBolt.java | 458 --------- .../electrical/tesla/BlockTesla.java | 125 --- .../electrical/tesla/ModelTeslaBottom.java | 206 ---- .../electrical/tesla/ModelTeslaMiddle.java | 215 ---- .../electrical/tesla/ModelTeslaTop.java | 204 ---- .../electrical/tesla/RenderTesla.java | 56 - .../electrical/tesla/TeslaGrid.java | 67 -- .../electrical/tesla/TileTesla.java | 655 ------------ .../transformer/ItemTransformer.java | 35 - .../transformer/ModelTransformer.java | 150 --- .../transformer/PartTransformer.java | 377 ------- .../transformer/RenderTransformer.java | 159 --- .../electrical/wire/EnumWireMaterial.java | 85 -- .../electrical/wire/ItemWire.java | 149 --- .../electrical/wire/PartAdvancedWire.java | 354 ------- .../electrical/wire/PartConductor.java | 186 ---- .../electrical/wire/flat/PartFlatWire.java | 960 ------------------ .../wire/framed/PartFramedSwitchWire.java | 94 -- .../wire/framed/PartFramedWire.java | 541 ---------- .../wire/framed/RenderPartWire.java | 190 ---- .../electrical/wire/trait/TraitConductor.java | 167 --- .../wire/trait/TraitEnergySink.java | 125 --- .../mechanical/ClientProxy.java | 12 - .../mechanical/CommonProxy.java | 8 - .../mechanical/Mechanical.java | 61 -- .../mechanical/belt/BlockConveyorBelt.java | 398 -------- .../mechanical/belt/TileConveyorBelt.java | 255 ----- .../mechanical/fluid/BlockKitchenSink.java | 114 --- .../mechanical/fluid/BlockReleaseValve.java | 93 -- .../mechanical/fluid/BlockSteamPiston.java | 91 -- .../mechanical/fluid/BlockTank.java | 153 --- .../mechanical/fluid/EnumFluid.java | 23 - .../mechanical/fluid/EnumGas.java | 77 -- .../mechanical/fluid/FilteredTank.java | 60 -- .../fluid/FluidCraftingHandler.java | 298 ------ .../mechanical/fluid/Gas.java | 19 - .../mechanical/fluid/GasTank.java | 40 - .../mechanical/fluid/ItemFluidCan.java | 90 -- .../mechanical/fluid/LiquidTank.java | 40 - .../fluid/TileEntityReleaseValve.java | 113 --- .../mechanical/fluid/TileEntityTank.java | 53 - .../mechanical/fluid/TileKitchenSink.java | 112 -- .../fluid/network/FluidPressurePack.java | 26 - .../fluid/network/FluidRecipeInfo.java | 233 ----- .../fluid/network/IFluidRecipeCrafter.java | 22 - .../fluid/network/NetworkFluidContainers.java | 109 -- .../fluid/network/NetworkFluidTiles.java | 317 ------ .../fluid/network/NetworkPipes.java | 144 --- .../mechanical/fluid/pipes/BlockPipe.java | 174 ---- .../mechanical/fluid/pipes/EnumPipeType.java | 110 -- .../mechanical/fluid/pipes/EnumTankTypes.java | 110 -- .../fluid/pipes/FluidPartsMaterial.java | 185 ---- .../mechanical/fluid/pipes/IPipeType.java | 8 - .../mechanical/fluid/pipes/ItemBlockPipe.java | 122 --- .../fluid/pipes/TileEntityPipe.java | 199 ---- .../fluid/prefab/TileEntityFluidDevice.java | 32 - .../prefab/TileEntityFluidNetworkTile.java | 493 --------- .../fluid/prefab/TileEntityFluidStorage.java | 137 --- .../fluid/pump/BlockConstructionPump.java | 130 --- .../mechanical/fluid/pump/BlockDrain.java | 135 --- .../fluid/pump/BlockPumpMachine.java | 97 -- .../fluid/pump/LiquidPathFinder.java | 344 ------- .../pump/TileEntityConstructionPump.java | 194 ---- .../fluid/pump/TileEntityDrain.java | 288 ------ .../fluid/pump/TileEntityStarterPump.java | 234 ----- .../mechanical/grinder/BlockGrinderWheel.java | 121 --- .../mechanical/grinder/TileGrinderWheel.java | 151 --- .../mechanical/grinder/TilePurifier.java | 155 --- .../MechanicalBlockRenderingHandler.java | 133 --- .../old/api/EntityDictionary.java | 193 ---- .../resonantinduction/old/api/IArmbot.java | 55 - .../old/api/IArmbotUseable.java | 26 - .../java/resonantinduction/old/api/IBelt.java | 23 - .../old/api/IFilterable.java | 15 - .../old/api/IManipulator.java | 18 - .../old/api/IProcessable.java | 27 - .../old/api/coding/IDataItem.java | 17 - .../old/api/coding/ILogicTask.java | 32 - .../old/api/coding/IMemorySlot.java | 35 - .../old/api/coding/IProcessTask.java | 57 -- .../old/api/coding/IProgram.java | 61 -- .../old/api/coding/IProgramItem.java | 15 - .../old/api/coding/IProgrammableMachine.java | 27 - .../old/api/coding/IRedirectTask.java | 14 - .../old/api/coding/ITask.java | 101 -- .../old/api/coding/ProgramHelper.java | 182 ---- .../old/api/coding/TaskRegistry.java | 97 -- .../old/api/coding/args/ArgumentData.java | 80 -- .../api/coding/args/ArgumentDoubleData.java | 39 - .../api/coding/args/ArgumentEntityList.java | 13 - .../api/coding/args/ArgumentFloatData.java | 39 - .../old/api/coding/args/ArgumentIntData.java | 38 - .../old/api/coding/args/ArgumentListData.java | 22 - .../old/api/fluid/FluidMasterList.java | 71 -- .../old/api/fluid/FluidMixingEvent.java | 72 -- .../old/api/fluid/IDrain.java | 44 - .../old/api/fluid/INetworkFluidPart.java | 59 -- .../old/api/fluid/INetworkPipe.java | 37 - .../old/client/ClientProxy.java | 125 --- .../old/client/gui/EnumTaskIcon.java | 29 - .../old/client/gui/GuiEditTask.java | 261 ----- .../old/client/gui/GuiEncoderBase.java | 30 - .../old/client/gui/GuiEncoderCoder.java | 189 ---- .../old/client/gui/GuiEncoderHelp.java | 16 - .../old/client/gui/GuiEncoderInventory.java | 38 - .../old/client/gui/GuiImprinter.java | 49 - .../old/client/gui/GuiProcessor.java | 49 - .../old/client/gui/GuiTask.java | 142 --- .../old/client/gui/GuiTaskList.java | 201 ---- .../old/client/model/ModelAdvancedHopper.java | 140 --- .../old/client/model/ModelAngledBelt.java | 81 -- .../old/client/model/ModelArmbot.java | 197 ---- .../old/client/model/ModelCenterTank.java | 45 - .../client/model/ModelConstructionPump.java | 94 -- .../old/client/model/ModelConveyorBelt.java | 244 ----- .../old/client/model/ModelCopperWire.java | 108 -- .../old/client/model/ModelCornerTank.java | 86 -- .../old/client/model/ModelCrusher.java | 173 ---- .../old/client/model/ModelElecFurnace.java | 89 -- .../old/client/model/ModelEngine.java | 102 -- .../old/client/model/ModelFrackingPipe.java | 97 -- .../old/client/model/ModelFurnace.java | 69 -- .../old/client/model/ModelGearPiston.java | 386 ------- .../old/client/model/ModelGearRod.java | 139 --- .../old/client/model/ModelGenerator.java | 193 ---- .../old/client/model/ModelGrinder.java | 221 ---- .../old/client/model/ModelHelper.java | 203 ---- .../old/client/model/ModelLargePipe.java | 242 ----- .../old/client/model/ModelLaserTile.java | 119 --- .../client/model/ModelLiquidTankCorner.java | 135 --- .../old/client/model/ModelMachine.java | 8 - .../old/client/model/ModelManipulator.java | 203 ---- .../old/client/model/ModelMiningLaserGun.java | 146 --- .../old/client/model/ModelOpenTrough.java | 425 -------- .../old/client/model/ModelPump.java | 294 ------ .../old/client/model/ModelRejectorPiston.java | 172 ---- .../old/client/model/ModelReleaseValve.java | 137 --- .../old/client/model/ModelSink.java | 114 --- .../old/client/model/ModelSmallFluidCan.java | 126 --- .../old/client/model/ModelSteamGen.java | 288 ------ .../old/client/model/ModelSteamTurbine.java | 214 ---- .../old/client/model/ModelTank.java | 140 --- .../old/client/model/ModelTankSide.java | 210 ---- .../old/client/model/ModelTestCar.java | 197 ---- .../old/client/model/ModelTurkey.java | 172 ---- .../old/client/render/BlockRenderHelper.java | 98 -- .../old/client/render/BlockRenderInfo.java | 56 - .../old/client/render/EntityFakeBlock.java | 99 -- .../old/client/render/ItemPipeRenderer.java | 76 -- .../old/client/render/ItemRenderFluidCan.java | 110 -- .../old/client/render/ItemTankRenderer.java | 124 --- .../client/render/RenderAdvancedHopper.java | 56 - .../old/client/render/RenderArmbot.java | 83 -- .../old/client/render/RenderBlockEntity.java | 193 ---- .../client/render/RenderConstructionPump.java | 59 -- .../old/client/render/RenderConveyorBelt.java | 134 --- .../old/client/render/RenderCrate.java | 199 ---- .../old/client/render/RenderDetector.java | 56 - .../old/client/render/RenderFluidHelper.java | 125 --- .../old/client/render/RenderFrackingPipe.java | 31 - .../old/client/render/RenderFurnace.java | 52 - .../old/client/render/RenderGearPiston.java | 59 -- .../old/client/render/RenderGearRod.java | 73 -- .../old/client/render/RenderGenerator.java | 50 - .../old/client/render/RenderHelper.java | 64 -- .../old/client/render/RenderImprintable.java | 59 -- .../old/client/render/RenderManipulator.java | 68 -- .../client/render/RenderMiningLaserGun.java | 84 -- .../old/client/render/RenderPipe.java | 204 ---- .../old/client/render/RenderProcessor.java | 99 -- .../old/client/render/RenderPump.java | 60 -- .../old/client/render/RenderRejector.java | 62 -- .../old/client/render/RenderReleaseValve.java | 62 -- .../old/client/render/RenderSink.java | 57 -- .../old/client/render/RenderSteamGen.java | 114 --- .../old/client/render/RenderTank.java | 126 --- .../old/client/render/RenderTestCar.java | 67 -- .../old/client/render/RenderTurkey.java | 83 -- .../old/core/ItemOreDirv.java | 169 --- .../old/core/misc/BehaviorDispenseEgg.java | 48 - .../old/core/misc/EntityFarmEgg.java | 80 -- .../old/core/misc/EntityMutantAnimal.java | 6 - .../old/core/misc/EntityTurkey.java | 182 ---- .../old/core/misc/EnumBird.java | 106 -- .../old/core/misc/EnumTool.java | 124 --- .../old/core/misc/ItemColoredDust.java | 71 -- .../old/core/misc/ItemCommonTool.java | 541 ---------- .../old/core/misc/ItemFarmEgg.java | 42 - .../old/core/recipe/RecipeLoader.java | 453 --------- .../old/core/render/RenderRIItem.java | 61 -- .../furnace/BlockAdvancedFurnace.java | 134 --- .../furnace/TileAdvancedFurnace.java | 203 ---- .../mining/BlockApertureExcavator.java | 64 -- .../machine/mining/BlockFracker.java | 75 -- .../machine/mining/BlockFrackingPipe.java | 83 -- .../machine/mining/ItemMiningLaser.java | 271 ----- .../machine/mining/TileApertureExcavator.java | 105 -- .../mechanics/machine/mining/TileFracker.java | 133 --- .../machine/mining/TileFrackingPipe.java | 9 - .../mechanics/processor/BlockProcessor.java | 204 ---- .../processor/ContainerProcessor.java | 160 --- .../processor/TileEntityProcessor.java | 333 ------ .../old/mechanics/purifier/BlockPurifier.java | 79 -- .../old/transport/CommonProxy.java | 168 --- .../old/transport/ContainerFilter.java | 53 - .../old/transport/NetworkAssembly.java | 51 - .../transport/ResonantInductionTransport.java | 379 ------- .../old/transport/TileEntityAssembly.java | 200 ---- .../crafting/BlockCraftingTable.java | 117 --- .../crafting/TileEntityCraftingTable.java | 8 - .../old/transport/crate/BlockCrate.java | 447 -------- .../old/transport/crate/InventoryCrate.java | 70 -- .../old/transport/crate/ItemBlockCrate.java | 147 --- .../old/transport/crate/ItemStorageCan.java | 11 - .../old/transport/crate/PathfinderCrate.java | 113 --- .../old/transport/crate/TileEntityCrate.java | 295 ------ .../old/transport/encoder/BlockEncoder.java | 94 -- .../transport/encoder/ContainerEncoder.java | 92 -- .../transport/encoder/IInventoryWatcher.java | 6 - .../old/transport/encoder/ItemDisk.java | 102 -- .../old/transport/encoder/SlotDisk.java | 22 - .../old/transport/encoder/SlotDiskResult.java | 42 - .../transport/encoder/TileEntityEncoder.java | 263 ----- .../transport/hopper/BlockAdvancedHopper.java | 164 --- .../hopper/TileEntityAdvancedHopper.java | 149 --- .../transport/imprinter/BlockImprinter.java | 165 --- .../imprinter/ContainerImprinter.java | 145 --- .../transport/imprinter/ItemImprinter.java | 127 --- .../imprinter/TileEntityImprinter.java | 483 --------- .../old/transport/logistic/BlockDetector.java | 202 ---- .../transport/logistic/BlockManipulator.java | 134 --- .../old/transport/logistic/BlockRejector.java | 77 -- .../logistic/TileEntityDetector.java | 152 --- .../logistic/TileEntityManipulator.java | 282 ----- .../logistic/TileEntityRejector.java | 139 --- .../multimeter/ContainerMultimeter.java | 54 - .../multimeter/ModelMultimeter.java | 75 -- .../electrical/tesla/ITesla.java | 23 - .../wire/flat/PartFlatSwitchWire.java | 93 -- .../electrical/wire/flat/RenderFlatWire.java | 472 --------- .../wire/trait/TraitEnergyHandler.java | 193 ---- .../resonantinduction/archaic/Archaic.java | 0 .../archaic/ClientProxy.java | 0 .../archaic/CommonProxy.java | 0 .../archaic/blocks/TileTurntable.scala | 0 .../archaic/crate/BlockCrate.java | 0 .../archaic/crate/CrateCraftingHandler.java | 0 .../archaic/crate/InventoryCrate.java | 0 .../archaic/crate/ItemBlockCrate.java | 0 .../archaic/crate/PathfinderCrate.java | 0 .../archaic/crate/RenderCrate.java | 0 .../archaic/crate/TileCrate.java | 0 .../archaic/engineering/ItemHammer.java | 0 .../engineering/TileEngineeringTable.java | 0 .../archaic/filter/BlockImprinter.java | 0 .../archaic/filter/RenderImprinter.java | 0 .../archaic/filter/TileFilter.java | 0 .../archaic/filter/TileImprinter.java | 0 .../archaic/firebox/BlockFirebox.java | 0 .../archaic/firebox/BlockHotPlate.java | 0 .../archaic/firebox/RenderHotPlate.java | 0 .../archaic/firebox/TileFirebox.java | 0 .../archaic/firebox/TileHotPlate.java | 0 .../archaic/fluid/grate/TileGrate.java | 0 .../fluid/gutter/FluidGravityNode.java | 0 .../archaic/fluid/gutter/TileGutter.java | 0 .../archaic/fluid/tank/ItemBlockTank.java | 0 .../archaic/fluid/tank/TankNetwork.java | 0 .../archaic/fluid/tank/TileTank.java | 0 .../archaic/process/BlockCastingMold.java | 0 .../archaic/process/BlockMillstone.java | 0 .../archaic/process/RenderCastingMold.java | 0 .../archaic/process/RenderMillstone.java | 0 .../archaic/process/TileCastingMold.java | 0 .../archaic/process/TileMillstone.java | 0 .../archaic/waila/Waila.java | 0 .../archaic/waila/WailaCrate.java | 0 .../archaic/waila/WailaFluidTank.java | 0 .../archaic/waila/WailaRegistrar.java | 0 .../resonantinduction/atomic/Atomic.java | 0 .../resonantinduction/atomic/ClientProxy.java | 0 .../resonantinduction/atomic/CommonProxy.java | 0 .../atomic/ReactorExplosion.java | 0 .../atomic/SoundHandler.java | 0 .../atomic/blocks/BlockToxicWaste.java | 0 .../atomic/blocks/BlockUraniumOre.java | 0 .../atomic/blocks/TileElectromagnet.java | 0 .../atomic/blocks/TileSiren.java | 0 .../atomic/items/ItemAntimatter.java | 0 .../atomic/items/ItemBreederFuel.java | 0 .../atomic/items/ItemCell.java | 0 .../atomic/items/ItemDarkMatter.java | 0 .../atomic/items/ItemFissileFuel.java | 0 .../atomic/items/ItemHazmat.java | 0 .../atomic/items/ItemRadioactive.java | 0 .../atomic/items/ItemUranium.java | 0 .../accelerator/ContainerAccelerator.java | 0 .../machine/accelerator/EntityParticle.java | 0 .../machine/accelerator/GuiAccelerator.java | 0 .../machine/accelerator/RenderParticle.java | 0 .../machine/accelerator/TileAccelerator.java | 0 .../machine/boiler/BlockNuclearBoiler.java | 0 .../machine/boiler/GuiChemicalExtractor.java | 0 .../machine/boiler/GuiNuclearBoiler.java | 0 .../machine/boiler/RenderNuclearBoiler.java | 0 .../machine/boiler/TileNuclearBoiler.java | 0 .../machine/centrifuge/BlockCentrifuge.java | 0 .../centrifuge/ContainerCentrifuge.java | 0 .../machine/centrifuge/GuiCentrifuge.java | 0 .../machine/centrifuge/RenderCentrifuge.java | 0 .../machine/centrifuge/TileCentrifuge.java | 0 .../extractor/BlockChemicalExtractor.java | 0 .../extractor/ContainerChemicalExtractor.java | 0 .../extractor/RenderChemicalExtractor.java | 0 .../extractor/TileChemicalExtractor.java | 0 .../atomic/machine/extractor/TileProcess.java | 0 .../turbine/BlockElectricTurbine.java | 0 .../turbine/RenderElectricTurbine.java | 0 .../turbine/TileElectricTurbine.java | 0 .../machine/extractor/turbine/TileFunnel.java | 0 .../fulmination/FulminationHandler.java | 0 .../machine/fulmination/TileFulmination.java | 0 .../machine/plasma/BlockPlasmaHeater.java | 0 .../plasma/ContainerNuclearBoiler.java | 0 .../machine/plasma/RenderPlasmaHeater.java | 0 .../atomic/machine/plasma/TilePlasma.java | 0 .../machine/plasma/TilePlasmaHeater.java | 0 .../quantum/ContainerQuantumAssembler.java | 0 .../machine/quantum/GuiQuantumAssembler.java | 0 .../quantum/RenderQuantumAssembler.java | 0 .../machine/quantum/TileQuantumAssembler.java | 0 .../machine/reactor/BlockReactorDrain.java | 0 .../machine/reactor/ContainerReactorCell.java | 0 .../machine/reactor/GuiReactorCell.java | 0 .../machine/reactor/RenderReactorCell.java | 0 .../machine/reactor/TileControlRod.java | 0 .../machine/reactor/TileReactorCell.java | 0 .../machine/reactor/TileReactorDrain.java | 0 .../thermometer/ItemBlockThermometer.java | 0 .../thermometer/RenderThermometer.java | 0 .../machine/thermometer/TileThermometer.java | 0 .../schematic/SchematicAccelerator.java | 0 .../schematic/SchematicBreedingReactor.java | 0 .../schematic/SchematicFissionReactor.java | 0 .../schematic/SchematicFusionReactor.java | 0 .../electrical/ClientProxy.java | 0 .../electrical/CommonProxy.java | 0 .../electrical/Electrical.java | 0 .../electrical/MultipartElectrical.java | 0 .../electrical/battery/BlockBattery.java | 0 .../battery/EnergyDistributionNetwork.java | 0 .../electrical/battery/ItemBlockBattery.java | 0 .../electrical/battery/RenderBattery.java | 0 .../electrical/battery/TileBattery.java | 0 .../battery/TileEnergyDistribution.java | 0 .../distributor/EnumDistributorMode.java | 0 .../distributor/TileDistributor.scala | 0 .../electrical/generator/BlockMotor.java | 0 .../electrical/generator/RenderMotor.java | 0 .../electrical/generator/TileMotor.java | 0 .../generator/solar/TileSolarPanel.java | 0 .../generator/thermopile/BlockThermopile.java | 0 .../generator/thermopile/TileThermopile.java | 0 .../itemrailing/interfaces/IItemRailing.java | 0 .../interfaces/IItemRailingProvider.java | 0 .../interfaces/IItemRailingTransfer.java | 0 .../itemrailing/interfaces/package-info.java | 0 .../multimeter/ContainerMultimeter.java | 0 .../electrical/multimeter/Graph.java | 0 .../electrical/multimeter/GraphD.java | 0 .../electrical/multimeter/GraphF.java | 0 .../electrical/multimeter/GraphI.java | 0 .../electrical/multimeter/GraphL.java | 0 .../electrical/multimeter/GuiMultimeter.java | 0 .../electrical/multimeter/ItemMultimeter.java | 0 .../multimeter/ModelMultimeter.java | 0 .../multimeter/MultimeterNetwork.java | 0 .../electrical/multimeter/PartMultimeter.java | 0 .../multimeter/RenderMultimeter.java | 0 .../electrical/render/FXElectricBolt.java | 0 .../electrical/tesla/BlockTesla.java | 0 .../electrical/tesla/ITesla.java | 0 .../electrical/tesla/RenderTesla.java | 0 .../electrical/tesla/TeslaGrid.java | 0 .../electrical/tesla/TileTesla.java | 0 .../transformer/ItemTransformer.java | 0 .../transformer/PartTransformer.java | 0 .../transformer/RenderTransformer.java | 0 .../electrical/wire/EnumWireMaterial.java | 0 .../electrical/wire/ItemWire.java | 0 .../electrical/wire/PartAdvancedWire.java | 0 .../electrical/wire/PartConductor.java | 0 .../wire/flat/PartFlatSwitchWire.java | 0 .../electrical/wire/flat/PartFlatWire.java | 0 .../electrical/wire/flat/RenderFlatWire.java | 0 .../wire/framed/PartFramedSwitchWire.java | 0 .../wire/framed/PartFramedWire.java | 0 .../wire/framed/RenderFramedWire.java | 0 .../electrical/wire/trait/TraitConductor.java | 0 .../wire/trait/TraitEnergyHandler.java | 0 .../wire/trait/TraitEnergySink.java | 0 .../mechanical/ClientProxy.java | 0 .../mechanical/CommonProxy.java | 0 .../mechanical/Mechanical.java | 0 .../MicroblockHighlightHandler.java | 0 .../mechanical/MultipartMechanical.java | 0 .../mechanical/belt/BlockConveyorBelt.java | 0 .../mechanical/belt/ModelAngledBelt.java | 0 .../mechanical/belt/ModelConveyorBelt.java | 0 .../mechanical/belt/RenderConveyorBelt.java | 0 .../mechanical/belt/TileConveyorBelt.java | 0 .../energy/grid/MechanicalNode.java | 0 .../energy/grid/MechanicalNodeFrame.java | 0 .../mechanical/energy/grid/PacketNetwork.java | 0 .../energy/grid/PartMechanical.java | 0 .../energy/grid/TileMechanical.java | 0 .../energy/turbine/BlockTurbine.java | 0 .../energy/turbine/BlockWaterTurbine.java | 0 .../energy/turbine/BlockWindTurbine.java | 0 .../energy/turbine/RenderWaterTurbine.java | 0 .../energy/turbine/RenderWindTurbine.java | 0 .../energy/turbine/SchematicWaterTurbine.java | 0 .../energy/turbine/SchematicWindTurbine.java | 0 .../energy/turbine/TileTurbine.java | 0 .../energy/turbine/TileWaterTurbine.java | 0 .../energy/turbine/TileWindTurbine.java | 0 .../energy/turbine/TurbineMBlockHandler.java | 0 .../energy/turbine/TurbineNode.java | 0 .../fluid/pipe/EnumPipeMaterial.java | 0 .../mechanical/fluid/pipe/ItemPipe.java | 0 .../mechanical/fluid/pipe/PartPipe.java | 0 .../mechanical/fluid/pipe/PipeNodeFrame.java | 0 .../fluid/pipe/PipePressureNode.java | 0 .../mechanical/fluid/pipe/RenderPipe.java | 0 .../fluid/transport/RenderPump.java | 0 .../mechanical/fluid/transport/TilePump.java | 0 .../gear/GearMultiBlockHandler.java | 0 .../mechanical/gear/GearNode.java | 0 .../mechanical/gear/ItemGear.java | 0 .../mechanical/gear/PartGear.java | 0 .../mechanical/gear/RenderGear.java | 0 .../mechanical/gear/dev/GearNetwork.java | 0 .../mechanical/gear/dev/GearPathFinder.java | 0 .../mechanical/gear/dev/NodeGear.java | 0 .../mechanical/gear/dev/NodeGenerator.java | 0 .../mechanical/gearshaft/GearShaftNode.java | 0 .../mechanical/gearshaft/ItemGearShaft.java | 0 .../mechanical/gearshaft/PartGearShaft.java | 0 .../mechanical/gearshaft/RenderGearShaft.java | 0 .../logistic/belt/BlockDetector.java | 0 .../logistic/belt/BlockManipulator.java | 0 .../logistic/belt/BlockRejector.java | 0 .../logistic/belt/ModelManipulator.java | 0 .../logistic/belt/ModelRejectorPiston.java | 0 .../logistic/belt/RenderManipulator.java | 0 .../logistic/belt/RenderRejector.java | 0 .../logistic/belt/TileDetector.java | 0 .../logistic/belt/TileManipulator.java | 0 .../logistic/belt/TileRejector.java | 0 .../crusher/RenderMechanicalPiston.java | 0 .../process/crusher/TileMechanicalPiston.java | 0 .../mechanical/process/edit/TileBreaker.java | 0 .../mechanical/process/edit/TilePlacer.java | 0 .../process/grinder/GrinderNode.java | 0 .../process/grinder/RenderGrindingWheel.java | 0 .../process/grinder/TileGrindingWheel.java | 0 .../mechanical/process/mixer/MixerNode.java | 0 .../mechanical/process/mixer/RenderMixer.java | 0 .../mechanical/process/mixer/TileMixer.java | 0 .../quantum/gate/IQuantumGate.java | 0 .../quantum/gate/ItemQuantumGlyph.java | 0 .../quantum/gate/PartQuantumGlyph.java | 0 .../quantum/gate/QuantumGateManager.java | 0 .../quantum/gate/RenderQuantumGlyph.java | 0 .../quantum/gate/TraitQuantumGate.java | 0 646 files changed, 48554 deletions(-) delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaBlock.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaBlockDecorator.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaConfigHandler.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaDataAccessor.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaDataProvider.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaEntityAccessor.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaEntityProvider.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPAccessor.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPDecorator.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPProvider.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaRegistrar.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/IWailaSummaryProvider.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/SpecialChars.java delete mode 100644 archaic/src/api/java/mcp/mobius/waila/api/package-info.java delete mode 100644 archive/java/dark/lib/BlockFluid.java delete mode 100644 archive/java/dark/lib/ClientRegistryProxy.java delete mode 100644 archive/java/dark/lib/CoreRegistry.java delete mode 100644 archive/java/dark/lib/EnumMaterial.java delete mode 100644 archive/java/dark/lib/EnumOrePart.java delete mode 100644 archive/java/dark/lib/IExtraInfo.java delete mode 100644 archive/java/dark/lib/LaserEntityDamageSource.java delete mode 100644 archive/java/dark/lib/OtherDamageSource.java delete mode 100644 archive/java/dark/lib/RegistryProxy.java delete mode 100644 archive/java/dark/lib/helpers/ColorCode.java delete mode 100644 archive/java/dark/lib/interfaces/IControlReceiver.java delete mode 100644 archive/java/dark/lib/interfaces/IExtendedStorage.java delete mode 100644 archive/java/dark/lib/interfaces/IExternalInv.java delete mode 100644 archive/java/dark/lib/interfaces/IInvBox.java delete mode 100644 archive/java/dark/lib/interfaces/IPowerLess.java delete mode 100644 archive/java/dark/lib/interfaces/IReadOut.java delete mode 100644 archive/java/dark/lib/interfaces/IRotatableBlock.java delete mode 100644 archive/java/dark/lib/prefab/invgui/ContainerFake.java delete mode 100644 archive/java/dark/lib/prefab/invgui/GuiBase.java delete mode 100644 archive/java/dark/lib/prefab/invgui/GuiButtonImage.java delete mode 100644 archive/java/dark/lib/prefab/invgui/GuiMachineContainer.java delete mode 100644 archive/java/dark/lib/prefab/invgui/GuiMessageBox.java delete mode 100644 archive/java/dark/lib/prefab/invgui/IMessageBoxDialog.java delete mode 100644 archive/java/dark/lib/prefab/invgui/ISlotPickResult.java delete mode 100644 archive/java/dark/lib/prefab/invgui/ISlotWatcher.java delete mode 100644 archive/java/dark/lib/prefab/invgui/InvChest.java delete mode 100644 archive/java/dark/lib/prefab/invgui/SlotCraftingResult.java delete mode 100644 archive/java/dark/lib/prefab/invgui/SlotEnergyItem.java delete mode 100644 archive/java/dark/lib/prefab/invgui/SlotSpecific.java delete mode 100644 archive/java/dark/lib/prefab/invgui/WatchedSlot.java delete mode 100644 archive/java/dark/lib/recipes/MachineRecipeHandler.java delete mode 100644 archive/java/dark/lib/recipes/ProcessorRecipe.java delete mode 100644 archive/java/dark/lib/recipes/ProcessorType.java delete mode 100644 archive/java/resonantinduction/api/events/AutoCraftEvent.java delete mode 100644 archive/java/resonantinduction/api/events/LaserEvent.java delete mode 100644 archive/java/resonantinduction/api/events/MachineEvent.java delete mode 100644 archive/java/resonantinduction/api/events/MachineMiningEvent.java delete mode 100644 archive/java/resonantinduction/api/recipe/MachineRecipes.java delete mode 100644 archive/java/resonantinduction/api/recipe/OreDetectionBlackList.java delete mode 100644 archive/java/resonantinduction/api/recipe/RecipeUtils.java delete mode 100644 archive/java/resonantinduction/archaic/Archaic.java delete mode 100644 archive/java/resonantinduction/archaic/ClientProxy.java delete mode 100644 archive/java/resonantinduction/archaic/CommonProxy.java delete mode 100644 archive/java/resonantinduction/archaic/blocks/BlockColorGlass.java delete mode 100644 archive/java/resonantinduction/archaic/blocks/BlockColorGlowGlass.java delete mode 100644 archive/java/resonantinduction/archaic/blocks/BlockColorSand.java delete mode 100644 archive/java/resonantinduction/archaic/blocks/BlockColored.java delete mode 100644 archive/java/resonantinduction/archaic/blocks/BlockTurntable.java delete mode 100644 archive/java/resonantinduction/archaic/blocks/ItemBlockColored.java delete mode 100644 archive/java/resonantinduction/core/ClientProxy.java delete mode 100644 archive/java/resonantinduction/core/CommonProxy.java delete mode 100644 archive/java/resonantinduction/core/Reference.java delete mode 100644 archive/java/resonantinduction/core/ResonantInduction.java delete mode 100644 archive/java/resonantinduction/core/ResonantInductionTabs.java delete mode 100644 archive/java/resonantinduction/core/Settings.java delete mode 100644 archive/java/resonantinduction/core/SoundHandler.java delete mode 100644 archive/java/resonantinduction/core/Utility.java delete mode 100644 archive/java/resonantinduction/core/debug/BlockDebug.java delete mode 100644 archive/java/resonantinduction/core/debug/ItemInstaHole.java delete mode 100644 archive/java/resonantinduction/core/debug/TileEntityInfFluid.java delete mode 100644 archive/java/resonantinduction/core/debug/TileEntityInfLoad.java delete mode 100644 archive/java/resonantinduction/core/debug/TileEntityInfSupply.java delete mode 100644 archive/java/resonantinduction/core/debug/TileEntityVoid.java delete mode 100644 archive/java/resonantinduction/core/handler/FluidEventHandler.java delete mode 100644 archive/java/resonantinduction/core/handler/ILinkable.java delete mode 100644 archive/java/resonantinduction/core/handler/LinkEventHandler.java delete mode 100644 archive/java/resonantinduction/core/network/ISimplePacketReceiver.java delete mode 100644 archive/java/resonantinduction/core/network/PacketIDTile.java delete mode 100644 archive/java/resonantinduction/core/part/BlockMachinePart.java delete mode 100644 archive/java/resonantinduction/core/prefab/ProxyBase.java delete mode 100644 archive/java/resonantinduction/core/prefab/block/BlockBase.java delete mode 100644 archive/java/resonantinduction/core/prefab/block/BlockIOBase.java delete mode 100644 archive/java/resonantinduction/core/prefab/block/BlockImprintable.java delete mode 100644 archive/java/resonantinduction/core/prefab/block/BlockMachine.java delete mode 100644 archive/java/resonantinduction/core/prefab/block/BlockRotatableBase.java delete mode 100644 archive/java/resonantinduction/core/prefab/item/ItemBase.java delete mode 100644 archive/java/resonantinduction/core/prefab/part/ItemMultipartBase.java delete mode 100644 archive/java/resonantinduction/core/prefab/part/PacketMultiPart.java delete mode 100644 archive/java/resonantinduction/core/prefab/part/PartAdvanced.java delete mode 100644 archive/java/resonantinduction/core/prefab/tile/TileEntityEnergyMachine.java delete mode 100644 archive/java/resonantinduction/core/prefab/tile/TileEntityFilterable.java delete mode 100644 archive/java/resonantinduction/core/prefab/tile/TileEntityInv.java delete mode 100644 archive/java/resonantinduction/core/prefab/tile/TileEntityMachine.java delete mode 100644 archive/java/resonantinduction/core/prefab/tile/TileGenerator.java delete mode 100644 archive/java/resonantinduction/core/render/InvertX.java delete mode 100644 archive/java/resonantinduction/core/resource/BlockGasOre.java delete mode 100644 archive/java/resonantinduction/core/resource/BlockOre.java delete mode 100644 archive/java/resonantinduction/core/resource/GasOreGenerator.java delete mode 100644 archive/java/resonantinduction/core/resource/ResourceGenerator.java delete mode 100644 archive/java/resonantinduction/core/resource/fluid/BlockFluidMixture.java delete mode 100644 archive/java/resonantinduction/core/resource/fluid/TileFluidMixture.java delete mode 100644 archive/java/resonantinduction/core/resource/item/ItemBlockOre.java delete mode 100644 archive/java/resonantinduction/core/resource/item/ItemDust.java delete mode 100644 archive/java/resonantinduction/core/resource/item/ItemParts.java delete mode 100644 archive/java/resonantinduction/core/tilenetwork/INetworkContainer.java delete mode 100644 archive/java/resonantinduction/core/tilenetwork/INetworkEnergyPart.java delete mode 100644 archive/java/resonantinduction/core/tilenetwork/INetworkPart.java delete mode 100644 archive/java/resonantinduction/core/tilenetwork/ITileConnector.java delete mode 100644 archive/java/resonantinduction/core/tilenetwork/ITileNetwork.java delete mode 100644 archive/java/resonantinduction/core/tilenetwork/prefab/NetworkPathFinder.java delete mode 100644 archive/java/resonantinduction/core/tilenetwork/prefab/NetworkResourceSupply.java delete mode 100644 archive/java/resonantinduction/core/tilenetwork/prefab/NetworkSharedPower.java delete mode 100644 archive/java/resonantinduction/core/tilenetwork/prefab/NetworkTileEntities.java delete mode 100644 archive/java/resonantinduction/core/tilenetwork/prefab/NetworkUpdateHandler.java delete mode 100644 archive/java/resonantinduction/electrical/ClientProxy.java delete mode 100644 archive/java/resonantinduction/electrical/CommonProxy.java delete mode 100644 archive/java/resonantinduction/electrical/Electrical.java delete mode 100644 archive/java/resonantinduction/electrical/MultipartElectrical.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/BlockArmbot.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/Program.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/TaskBase.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/TaskBaseArmbot.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/TaskBaseLogic.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/TaskBaseProcess.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/TileEntityArmbot.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskBreak.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskDrop.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskEnd.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskFire.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskGOTO.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskGive.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskGrabEntity.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskGrabItem.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskGrabPrefab.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskHarvest.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskIF.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskIdle.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskPlace.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskReturn.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskRotateBy.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskRotateTo.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskStart.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskTake.java delete mode 100644 archive/java/resonantinduction/electrical/armbot/command/TaskUse.java delete mode 100644 archive/java/resonantinduction/electrical/battery/BatteryStructure.java delete mode 100644 archive/java/resonantinduction/electrical/battery/BlockBattery.java delete mode 100644 archive/java/resonantinduction/electrical/battery/ItemBlockBattery.java delete mode 100644 archive/java/resonantinduction/electrical/battery/RenderBattery.java delete mode 100644 archive/java/resonantinduction/electrical/battery/TileBattery.java delete mode 100644 archive/java/resonantinduction/electrical/generator/solar/BlockSolarPanel.java delete mode 100644 archive/java/resonantinduction/electrical/generator/solar/ModelSolarPanel.java delete mode 100644 archive/java/resonantinduction/electrical/generator/solar/RenderSolarPanel.java delete mode 100644 archive/java/resonantinduction/electrical/generator/solar/TileSolarPanel.java delete mode 100644 archive/java/resonantinduction/electrical/levitator/BlockFilter.java delete mode 100644 archive/java/resonantinduction/electrical/levitator/BlockLevitator.java delete mode 100644 archive/java/resonantinduction/electrical/levitator/ItemBlockContractor.java delete mode 100644 archive/java/resonantinduction/electrical/levitator/ModelEMContractor.java delete mode 100644 archive/java/resonantinduction/electrical/levitator/PathfinderEMContractor.java delete mode 100644 archive/java/resonantinduction/electrical/levitator/RenderLevitator.java delete mode 100644 archive/java/resonantinduction/electrical/levitator/ThreadEMPathfinding.java delete mode 100644 archive/java/resonantinduction/electrical/levitator/TileEMLevitator.java delete mode 100644 archive/java/resonantinduction/electrical/multimeter/GuiMultimeter.java delete mode 100644 archive/java/resonantinduction/electrical/multimeter/ItemMultimeter.java delete mode 100644 archive/java/resonantinduction/electrical/multimeter/ItemReadoutTools.java delete mode 100644 archive/java/resonantinduction/electrical/multimeter/PartMultimeter.java delete mode 100644 archive/java/resonantinduction/electrical/multimeter/RenderMultimeter.java delete mode 100644 archive/java/resonantinduction/electrical/render/ElectricalBlockRenderingHandler.java delete mode 100644 archive/java/resonantinduction/electrical/render/FXElectricBolt.java delete mode 100644 archive/java/resonantinduction/electrical/tesla/BlockTesla.java delete mode 100644 archive/java/resonantinduction/electrical/tesla/ModelTeslaBottom.java delete mode 100644 archive/java/resonantinduction/electrical/tesla/ModelTeslaMiddle.java delete mode 100644 archive/java/resonantinduction/electrical/tesla/ModelTeslaTop.java delete mode 100644 archive/java/resonantinduction/electrical/tesla/RenderTesla.java delete mode 100644 archive/java/resonantinduction/electrical/tesla/TeslaGrid.java delete mode 100644 archive/java/resonantinduction/electrical/tesla/TileTesla.java delete mode 100644 archive/java/resonantinduction/electrical/transformer/ItemTransformer.java delete mode 100644 archive/java/resonantinduction/electrical/transformer/ModelTransformer.java delete mode 100644 archive/java/resonantinduction/electrical/transformer/PartTransformer.java delete mode 100644 archive/java/resonantinduction/electrical/transformer/RenderTransformer.java delete mode 100644 archive/java/resonantinduction/electrical/wire/EnumWireMaterial.java delete mode 100644 archive/java/resonantinduction/electrical/wire/ItemWire.java delete mode 100644 archive/java/resonantinduction/electrical/wire/PartAdvancedWire.java delete mode 100644 archive/java/resonantinduction/electrical/wire/PartConductor.java delete mode 100644 archive/java/resonantinduction/electrical/wire/flat/PartFlatWire.java delete mode 100644 archive/java/resonantinduction/electrical/wire/framed/PartFramedSwitchWire.java delete mode 100644 archive/java/resonantinduction/electrical/wire/framed/PartFramedWire.java delete mode 100644 archive/java/resonantinduction/electrical/wire/framed/RenderPartWire.java delete mode 100644 archive/java/resonantinduction/electrical/wire/trait/TraitConductor.java delete mode 100644 archive/java/resonantinduction/electrical/wire/trait/TraitEnergySink.java delete mode 100644 archive/java/resonantinduction/mechanical/ClientProxy.java delete mode 100644 archive/java/resonantinduction/mechanical/CommonProxy.java delete mode 100644 archive/java/resonantinduction/mechanical/Mechanical.java delete mode 100644 archive/java/resonantinduction/mechanical/belt/BlockConveyorBelt.java delete mode 100644 archive/java/resonantinduction/mechanical/belt/TileConveyorBelt.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/BlockKitchenSink.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/BlockReleaseValve.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/BlockSteamPiston.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/BlockTank.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/EnumFluid.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/EnumGas.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/FilteredTank.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/FluidCraftingHandler.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/Gas.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/GasTank.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/ItemFluidCan.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/LiquidTank.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/TileEntityReleaseValve.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/TileEntityTank.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/TileKitchenSink.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/network/FluidPressurePack.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/network/FluidRecipeInfo.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/network/IFluidRecipeCrafter.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/network/NetworkFluidContainers.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/network/NetworkFluidTiles.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/network/NetworkPipes.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pipes/BlockPipe.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pipes/EnumPipeType.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pipes/EnumTankTypes.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pipes/FluidPartsMaterial.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pipes/IPipeType.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pipes/ItemBlockPipe.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pipes/TileEntityPipe.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidDevice.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidNetworkTile.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidStorage.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pump/BlockConstructionPump.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pump/BlockDrain.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pump/BlockPumpMachine.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pump/LiquidPathFinder.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pump/TileEntityConstructionPump.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pump/TileEntityDrain.java delete mode 100644 archive/java/resonantinduction/mechanical/fluid/pump/TileEntityStarterPump.java delete mode 100644 archive/java/resonantinduction/mechanical/grinder/BlockGrinderWheel.java delete mode 100644 archive/java/resonantinduction/mechanical/grinder/TileGrinderWheel.java delete mode 100644 archive/java/resonantinduction/mechanical/grinder/TilePurifier.java delete mode 100644 archive/java/resonantinduction/mechanical/render/MechanicalBlockRenderingHandler.java delete mode 100644 archive/java/resonantinduction/old/api/EntityDictionary.java delete mode 100644 archive/java/resonantinduction/old/api/IArmbot.java delete mode 100644 archive/java/resonantinduction/old/api/IArmbotUseable.java delete mode 100644 archive/java/resonantinduction/old/api/IBelt.java delete mode 100644 archive/java/resonantinduction/old/api/IFilterable.java delete mode 100644 archive/java/resonantinduction/old/api/IManipulator.java delete mode 100644 archive/java/resonantinduction/old/api/IProcessable.java delete mode 100644 archive/java/resonantinduction/old/api/coding/IDataItem.java delete mode 100644 archive/java/resonantinduction/old/api/coding/ILogicTask.java delete mode 100644 archive/java/resonantinduction/old/api/coding/IMemorySlot.java delete mode 100644 archive/java/resonantinduction/old/api/coding/IProcessTask.java delete mode 100644 archive/java/resonantinduction/old/api/coding/IProgram.java delete mode 100644 archive/java/resonantinduction/old/api/coding/IProgramItem.java delete mode 100644 archive/java/resonantinduction/old/api/coding/IProgrammableMachine.java delete mode 100644 archive/java/resonantinduction/old/api/coding/IRedirectTask.java delete mode 100644 archive/java/resonantinduction/old/api/coding/ITask.java delete mode 100644 archive/java/resonantinduction/old/api/coding/ProgramHelper.java delete mode 100644 archive/java/resonantinduction/old/api/coding/TaskRegistry.java delete mode 100644 archive/java/resonantinduction/old/api/coding/args/ArgumentData.java delete mode 100644 archive/java/resonantinduction/old/api/coding/args/ArgumentDoubleData.java delete mode 100644 archive/java/resonantinduction/old/api/coding/args/ArgumentEntityList.java delete mode 100644 archive/java/resonantinduction/old/api/coding/args/ArgumentFloatData.java delete mode 100644 archive/java/resonantinduction/old/api/coding/args/ArgumentIntData.java delete mode 100644 archive/java/resonantinduction/old/api/coding/args/ArgumentListData.java delete mode 100644 archive/java/resonantinduction/old/api/fluid/FluidMasterList.java delete mode 100644 archive/java/resonantinduction/old/api/fluid/FluidMixingEvent.java delete mode 100644 archive/java/resonantinduction/old/api/fluid/IDrain.java delete mode 100644 archive/java/resonantinduction/old/api/fluid/INetworkFluidPart.java delete mode 100644 archive/java/resonantinduction/old/api/fluid/INetworkPipe.java delete mode 100644 archive/java/resonantinduction/old/client/ClientProxy.java delete mode 100644 archive/java/resonantinduction/old/client/gui/EnumTaskIcon.java delete mode 100644 archive/java/resonantinduction/old/client/gui/GuiEditTask.java delete mode 100644 archive/java/resonantinduction/old/client/gui/GuiEncoderBase.java delete mode 100644 archive/java/resonantinduction/old/client/gui/GuiEncoderCoder.java delete mode 100644 archive/java/resonantinduction/old/client/gui/GuiEncoderHelp.java delete mode 100644 archive/java/resonantinduction/old/client/gui/GuiEncoderInventory.java delete mode 100644 archive/java/resonantinduction/old/client/gui/GuiImprinter.java delete mode 100644 archive/java/resonantinduction/old/client/gui/GuiProcessor.java delete mode 100644 archive/java/resonantinduction/old/client/gui/GuiTask.java delete mode 100644 archive/java/resonantinduction/old/client/gui/GuiTaskList.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelAdvancedHopper.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelAngledBelt.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelArmbot.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelCenterTank.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelConstructionPump.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelConveyorBelt.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelCopperWire.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelCornerTank.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelCrusher.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelElecFurnace.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelEngine.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelFrackingPipe.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelFurnace.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelGearPiston.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelGearRod.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelGenerator.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelGrinder.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelHelper.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelLargePipe.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelLaserTile.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelLiquidTankCorner.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelMachine.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelManipulator.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelMiningLaserGun.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelOpenTrough.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelPump.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelRejectorPiston.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelReleaseValve.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelSink.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelSmallFluidCan.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelSteamGen.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelSteamTurbine.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelTank.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelTankSide.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelTestCar.java delete mode 100644 archive/java/resonantinduction/old/client/model/ModelTurkey.java delete mode 100644 archive/java/resonantinduction/old/client/render/BlockRenderHelper.java delete mode 100644 archive/java/resonantinduction/old/client/render/BlockRenderInfo.java delete mode 100644 archive/java/resonantinduction/old/client/render/EntityFakeBlock.java delete mode 100644 archive/java/resonantinduction/old/client/render/ItemPipeRenderer.java delete mode 100644 archive/java/resonantinduction/old/client/render/ItemRenderFluidCan.java delete mode 100644 archive/java/resonantinduction/old/client/render/ItemTankRenderer.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderAdvancedHopper.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderArmbot.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderBlockEntity.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderConstructionPump.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderConveyorBelt.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderCrate.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderDetector.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderFluidHelper.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderFrackingPipe.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderFurnace.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderGearPiston.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderGearRod.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderGenerator.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderHelper.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderImprintable.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderManipulator.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderMiningLaserGun.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderPipe.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderProcessor.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderPump.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderRejector.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderReleaseValve.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderSink.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderSteamGen.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderTank.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderTestCar.java delete mode 100644 archive/java/resonantinduction/old/client/render/RenderTurkey.java delete mode 100644 archive/java/resonantinduction/old/core/ItemOreDirv.java delete mode 100644 archive/java/resonantinduction/old/core/misc/BehaviorDispenseEgg.java delete mode 100644 archive/java/resonantinduction/old/core/misc/EntityFarmEgg.java delete mode 100644 archive/java/resonantinduction/old/core/misc/EntityMutantAnimal.java delete mode 100644 archive/java/resonantinduction/old/core/misc/EntityTurkey.java delete mode 100644 archive/java/resonantinduction/old/core/misc/EnumBird.java delete mode 100644 archive/java/resonantinduction/old/core/misc/EnumTool.java delete mode 100644 archive/java/resonantinduction/old/core/misc/ItemColoredDust.java delete mode 100644 archive/java/resonantinduction/old/core/misc/ItemCommonTool.java delete mode 100644 archive/java/resonantinduction/old/core/misc/ItemFarmEgg.java delete mode 100644 archive/java/resonantinduction/old/core/recipe/RecipeLoader.java delete mode 100644 archive/java/resonantinduction/old/core/render/RenderRIItem.java delete mode 100644 archive/java/resonantinduction/old/mechanics/furnace/BlockAdvancedFurnace.java delete mode 100644 archive/java/resonantinduction/old/mechanics/furnace/TileAdvancedFurnace.java delete mode 100644 archive/java/resonantinduction/old/mechanics/machine/mining/BlockApertureExcavator.java delete mode 100644 archive/java/resonantinduction/old/mechanics/machine/mining/BlockFracker.java delete mode 100644 archive/java/resonantinduction/old/mechanics/machine/mining/BlockFrackingPipe.java delete mode 100644 archive/java/resonantinduction/old/mechanics/machine/mining/ItemMiningLaser.java delete mode 100644 archive/java/resonantinduction/old/mechanics/machine/mining/TileApertureExcavator.java delete mode 100644 archive/java/resonantinduction/old/mechanics/machine/mining/TileFracker.java delete mode 100644 archive/java/resonantinduction/old/mechanics/machine/mining/TileFrackingPipe.java delete mode 100644 archive/java/resonantinduction/old/mechanics/processor/BlockProcessor.java delete mode 100644 archive/java/resonantinduction/old/mechanics/processor/ContainerProcessor.java delete mode 100644 archive/java/resonantinduction/old/mechanics/processor/TileEntityProcessor.java delete mode 100644 archive/java/resonantinduction/old/mechanics/purifier/BlockPurifier.java delete mode 100644 archive/java/resonantinduction/old/transport/CommonProxy.java delete mode 100644 archive/java/resonantinduction/old/transport/ContainerFilter.java delete mode 100644 archive/java/resonantinduction/old/transport/NetworkAssembly.java delete mode 100644 archive/java/resonantinduction/old/transport/ResonantInductionTransport.java delete mode 100644 archive/java/resonantinduction/old/transport/TileEntityAssembly.java delete mode 100644 archive/java/resonantinduction/old/transport/crafting/BlockCraftingTable.java delete mode 100644 archive/java/resonantinduction/old/transport/crafting/TileEntityCraftingTable.java delete mode 100644 archive/java/resonantinduction/old/transport/crate/BlockCrate.java delete mode 100644 archive/java/resonantinduction/old/transport/crate/InventoryCrate.java delete mode 100644 archive/java/resonantinduction/old/transport/crate/ItemBlockCrate.java delete mode 100644 archive/java/resonantinduction/old/transport/crate/ItemStorageCan.java delete mode 100644 archive/java/resonantinduction/old/transport/crate/PathfinderCrate.java delete mode 100644 archive/java/resonantinduction/old/transport/crate/TileEntityCrate.java delete mode 100644 archive/java/resonantinduction/old/transport/encoder/BlockEncoder.java delete mode 100644 archive/java/resonantinduction/old/transport/encoder/ContainerEncoder.java delete mode 100644 archive/java/resonantinduction/old/transport/encoder/IInventoryWatcher.java delete mode 100644 archive/java/resonantinduction/old/transport/encoder/ItemDisk.java delete mode 100644 archive/java/resonantinduction/old/transport/encoder/SlotDisk.java delete mode 100644 archive/java/resonantinduction/old/transport/encoder/SlotDiskResult.java delete mode 100644 archive/java/resonantinduction/old/transport/encoder/TileEntityEncoder.java delete mode 100644 archive/java/resonantinduction/old/transport/hopper/BlockAdvancedHopper.java delete mode 100644 archive/java/resonantinduction/old/transport/hopper/TileEntityAdvancedHopper.java delete mode 100644 archive/java/resonantinduction/old/transport/imprinter/BlockImprinter.java delete mode 100644 archive/java/resonantinduction/old/transport/imprinter/ContainerImprinter.java delete mode 100644 archive/java/resonantinduction/old/transport/imprinter/ItemImprinter.java delete mode 100644 archive/java/resonantinduction/old/transport/imprinter/TileEntityImprinter.java delete mode 100644 archive/java/resonantinduction/old/transport/logistic/BlockDetector.java delete mode 100644 archive/java/resonantinduction/old/transport/logistic/BlockManipulator.java delete mode 100644 archive/java/resonantinduction/old/transport/logistic/BlockRejector.java delete mode 100644 archive/java/resonantinduction/old/transport/logistic/TileEntityDetector.java delete mode 100644 archive/java/resonantinduction/old/transport/logistic/TileEntityManipulator.java delete mode 100644 archive/java/resonantinduction/old/transport/logistic/TileEntityRejector.java delete mode 100644 electrical/src/main/scala/resonantinduction/electrical/multimeter/ContainerMultimeter.java delete mode 100644 electrical/src/main/scala/resonantinduction/electrical/multimeter/ModelMultimeter.java delete mode 100644 electrical/src/main/scala/resonantinduction/electrical/tesla/ITesla.java delete mode 100644 electrical/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java delete mode 100644 electrical/src/main/scala/resonantinduction/electrical/wire/flat/RenderFlatWire.java delete mode 100644 electrical/src/main/scala/resonantinduction/electrical/wire/trait/TraitEnergyHandler.java rename {archaic/src => src}/main/scala/resonantinduction/archaic/Archaic.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/ClientProxy.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/CommonProxy.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/blocks/TileTurntable.scala (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/crate/BlockCrate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/crate/CrateCraftingHandler.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/crate/InventoryCrate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/crate/ItemBlockCrate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/crate/PathfinderCrate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/crate/RenderCrate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/crate/TileCrate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/engineering/ItemHammer.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/engineering/TileEngineeringTable.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/filter/BlockImprinter.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/filter/RenderImprinter.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/filter/TileFilter.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/filter/TileImprinter.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/firebox/BlockFirebox.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/firebox/BlockHotPlate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/firebox/RenderHotPlate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/firebox/TileFirebox.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/firebox/TileHotPlate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/fluid/grate/TileGrate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/fluid/gutter/FluidGravityNode.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/fluid/gutter/TileGutter.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/fluid/tank/ItemBlockTank.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/fluid/tank/TankNetwork.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/fluid/tank/TileTank.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/process/BlockCastingMold.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/process/BlockMillstone.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/process/RenderCastingMold.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/process/RenderMillstone.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/process/TileCastingMold.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/process/TileMillstone.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/waila/Waila.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/waila/WailaCrate.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/waila/WailaFluidTank.java (100%) rename {archaic/src => src}/main/scala/resonantinduction/archaic/waila/WailaRegistrar.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/Atomic.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/ClientProxy.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/CommonProxy.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/ReactorExplosion.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/SoundHandler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/blocks/BlockToxicWaste.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/blocks/BlockUraniumOre.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/blocks/TileElectromagnet.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/blocks/TileSiren.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/items/ItemAntimatter.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/items/ItemBreederFuel.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/items/ItemCell.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/items/ItemDarkMatter.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/items/ItemFissileFuel.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/items/ItemHazmat.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/items/ItemRadioactive.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/items/ItemUranium.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/accelerator/ContainerAccelerator.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/accelerator/EntityParticle.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/accelerator/GuiAccelerator.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/accelerator/RenderParticle.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/boiler/BlockNuclearBoiler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/boiler/GuiChemicalExtractor.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/boiler/GuiNuclearBoiler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/boiler/RenderNuclearBoiler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/boiler/TileNuclearBoiler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/centrifuge/BlockCentrifuge.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/centrifuge/ContainerCentrifuge.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/centrifuge/GuiCentrifuge.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/centrifuge/RenderCentrifuge.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/centrifuge/TileCentrifuge.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/extractor/BlockChemicalExtractor.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/extractor/ContainerChemicalExtractor.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/extractor/RenderChemicalExtractor.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/extractor/TileChemicalExtractor.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/extractor/TileProcess.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/extractor/turbine/BlockElectricTurbine.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/extractor/turbine/RenderElectricTurbine.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/extractor/turbine/TileElectricTurbine.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/extractor/turbine/TileFunnel.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/fulmination/FulminationHandler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/fulmination/TileFulmination.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/plasma/BlockPlasmaHeater.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/plasma/ContainerNuclearBoiler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/plasma/RenderPlasmaHeater.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/plasma/TilePlasma.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/plasma/TilePlasmaHeater.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/quantum/ContainerQuantumAssembler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/quantum/GuiQuantumAssembler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/quantum/RenderQuantumAssembler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/quantum/TileQuantumAssembler.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/reactor/BlockReactorDrain.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/reactor/ContainerReactorCell.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/reactor/GuiReactorCell.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/reactor/RenderReactorCell.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/reactor/TileControlRod.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/reactor/TileReactorCell.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/reactor/TileReactorDrain.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/thermometer/ItemBlockThermometer.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/thermometer/RenderThermometer.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/machine/thermometer/TileThermometer.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/schematic/SchematicAccelerator.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/schematic/SchematicBreedingReactor.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/schematic/SchematicFissionReactor.java (100%) rename {atomic/src => src}/main/scala/resonantinduction/atomic/schematic/SchematicFusionReactor.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/ClientProxy.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/CommonProxy.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/Electrical.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/MultipartElectrical.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/battery/BlockBattery.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/battery/EnergyDistributionNetwork.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/battery/ItemBlockBattery.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/battery/RenderBattery.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/battery/TileBattery.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/battery/TileEnergyDistribution.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/distributor/EnumDistributorMode.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/distributor/TileDistributor.scala (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/generator/BlockMotor.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/generator/RenderMotor.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/generator/TileMotor.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/generator/solar/TileSolarPanel.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/generator/thermopile/BlockThermopile.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/generator/thermopile/TileThermopile.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailing.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailingProvider.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailingTransfer.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/itemrailing/interfaces/package-info.java (100%) rename {archive/java => src/main/scala}/resonantinduction/electrical/multimeter/ContainerMultimeter.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/multimeter/Graph.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/multimeter/GraphD.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/multimeter/GraphF.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/multimeter/GraphI.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/multimeter/GraphL.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/multimeter/GuiMultimeter.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/multimeter/ItemMultimeter.java (100%) rename {archive/java => src/main/scala}/resonantinduction/electrical/multimeter/ModelMultimeter.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/multimeter/MultimeterNetwork.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/multimeter/PartMultimeter.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/multimeter/RenderMultimeter.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/render/FXElectricBolt.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/tesla/BlockTesla.java (100%) rename {archive/java => src/main/scala}/resonantinduction/electrical/tesla/ITesla.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/tesla/RenderTesla.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/tesla/TeslaGrid.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/tesla/TileTesla.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/transformer/ItemTransformer.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/transformer/PartTransformer.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/transformer/RenderTransformer.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/wire/EnumWireMaterial.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/wire/ItemWire.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/wire/PartAdvancedWire.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/wire/PartConductor.java (100%) rename {archive/java => src/main/scala}/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/wire/flat/PartFlatWire.java (100%) rename {archive/java => src/main/scala}/resonantinduction/electrical/wire/flat/RenderFlatWire.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/wire/framed/PartFramedSwitchWire.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/wire/framed/PartFramedWire.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/wire/framed/RenderFramedWire.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/wire/trait/TraitConductor.java (100%) rename {archive/java => src/main/scala}/resonantinduction/electrical/wire/trait/TraitEnergyHandler.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/electrical/wire/trait/TraitEnergySink.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/ClientProxy.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/CommonProxy.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/Mechanical.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/MicroblockHighlightHandler.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/MultipartMechanical.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/belt/BlockConveyorBelt.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/belt/ModelAngledBelt.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/belt/ModelConveyorBelt.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/belt/RenderConveyorBelt.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/belt/TileConveyorBelt.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/grid/MechanicalNode.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/grid/MechanicalNodeFrame.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/grid/PacketNetwork.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/grid/PartMechanical.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/grid/TileMechanical.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/BlockTurbine.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/BlockWindTurbine.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/RenderWaterTurbine.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/RenderWindTurbine.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/SchematicWaterTurbine.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/SchematicWindTurbine.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/TileTurbine.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/TileWaterTurbine.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/TileWindTurbine.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/TurbineMBlockHandler.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/energy/turbine/TurbineNode.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/fluid/pipe/EnumPipeMaterial.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/fluid/pipe/ItemPipe.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/fluid/pipe/PartPipe.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/fluid/pipe/PipeNodeFrame.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/fluid/pipe/PipePressureNode.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/fluid/pipe/RenderPipe.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/fluid/transport/RenderPump.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/fluid/transport/TilePump.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gear/GearMultiBlockHandler.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gear/GearNode.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gear/ItemGear.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gear/PartGear.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gear/RenderGear.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gear/dev/GearNetwork.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gear/dev/GearPathFinder.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gear/dev/NodeGear.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gear/dev/NodeGenerator.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gearshaft/GearShaftNode.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gearshaft/ItemGearShaft.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gearshaft/PartGearShaft.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/gearshaft/RenderGearShaft.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/logistic/belt/BlockDetector.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/logistic/belt/BlockManipulator.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/logistic/belt/BlockRejector.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/logistic/belt/ModelManipulator.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/logistic/belt/ModelRejectorPiston.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/logistic/belt/RenderManipulator.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/logistic/belt/RenderRejector.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/logistic/belt/TileDetector.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/logistic/belt/TileManipulator.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/logistic/belt/TileRejector.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/process/crusher/RenderMechanicalPiston.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/process/crusher/TileMechanicalPiston.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/process/edit/TileBreaker.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/process/edit/TilePlacer.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/process/grinder/GrinderNode.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/process/grinder/RenderGrindingWheel.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/process/grinder/TileGrindingWheel.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/process/mixer/MixerNode.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/process/mixer/RenderMixer.java (100%) rename {mechanical/src => src}/main/scala/resonantinduction/mechanical/process/mixer/TileMixer.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/quantum/gate/IQuantumGate.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/quantum/gate/ItemQuantumGlyph.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/quantum/gate/PartQuantumGlyph.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/quantum/gate/QuantumGateManager.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/quantum/gate/RenderQuantumGlyph.java (100%) rename {electrical/src => src}/main/scala/resonantinduction/quantum/gate/TraitQuantumGate.java (100%) diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaBlock.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaBlock.java deleted file mode 100644 index 8b4dd131..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaBlock.java +++ /dev/null @@ -1,34 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -@Deprecated -public interface IWailaBlock { - /* - * Use this method to return an item stack in case the default lookup system fails. - * Return null if you want to use the default lookup system. - * You get the world, the player and the location of the block. With that, it is easy to gather information & tile entities - */ - ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config); - - /* Waila HUD is divided into 3 zones. The head corresponds to the item name, - * body to where you mostly want to put informations, and I reserve the tail for modname display - */ - - /* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD. - * You get in input world, player and the block location. You also get the itemstack as returned by the default lookup system or getWailaStack(). - * ConfigHandler provides the current Waila config state so you can show/hide elements depending on the configuration. Refer the ConfigHandler class for more info. - * currenttip represents the current list of text lines in the tooltip zone. - * For example, getWailaHead() will have the current item name as currenttip. - * You can modify the tips, add more, remove some, etc. - * When you are done, just returns the currenttip and it will display in Waila. - * - * Always return the currenttip is you don't want to modify the current zone. - */ - - List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); - List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); - List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaBlockDecorator.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaBlockDecorator.java deleted file mode 100644 index 935d475f..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaBlockDecorator.java +++ /dev/null @@ -1,9 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.item.ItemStack; - -public interface IWailaBlockDecorator { - - void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config); - -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaConfigHandler.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaConfigHandler.java deleted file mode 100644 index faede63f..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaConfigHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.HashMap; -import java.util.Set; - -public interface IWailaConfigHandler { - /* Returns a set of all the currently loaded modules in the config handler */ - public Set getModuleNames(); - - /* Returns all the currently available options for a given module */ - public HashMap getConfigKeys(String modName); - - /* Add a new option to a given module - * - * modName is the name of the module to add the option to (ie : Buildcraft, IndustrialCraft2, etc) - * key is the config key (ie : bc.tankcontent, ic2.inputvalue) - * name is the human readable name of the option (ie : "Tank content", "Max EU Input") - * */ - //public void addConfig(String modName, String key, String name); - - /* Returns the current value of an option (true/false) with a default value defvalue if not set*/ - public boolean getConfig(String key, boolean defvalue); - - /* Returns the current value of an option (true/false) with a default value true if not set*/ - public boolean getConfig(String key); - - //public void setConfig(String key, boolean value); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaDataAccessor.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaDataAccessor.java deleted file mode 100644 index 5eade35f..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaDataAccessor.java +++ /dev/null @@ -1,33 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -/* The Accessor is used to get some basic data out of the game without having to request - * direct access to the game engine. - * It will also return things that are unmodified by the overriding systems (like getWailaStack). - */ - -public interface IWailaDataAccessor { - - World getWorld(); - EntityPlayer getPlayer(); - Block getBlock(); - int getBlockID(); - int getMetadata(); - TileEntity getTileEntity(); - MovingObjectPosition getPosition(); - Vec3 getRenderingPosition(); - NBTTagCompound getNBTData(); - int getNBTInteger(NBTTagCompound tag, String keyname); - double getPartialFrame(); - ForgeDirection getSide(); - ItemStack getStack(); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaDataProvider.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaDataProvider.java deleted file mode 100644 index 4859d9cd..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaDataProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -public interface IWailaDataProvider{ - /* - * Use this method to return an item stack in case the default lookup system fails. - * Return null if you want to use the default lookup system. - * You get the world, the player and the location of the block. With that, it is easy to gather information & tile entities - */ - ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config); - - /* Waila HUD is divided into 3 zones. The head corresponds to the item name, - * body to where you mostly want to put informations, and I reserve the tail for modname display - */ - - /* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD. - * You get in input world, player and the block location. You also get the itemstack as returned by the default lookup system or getWailaStack(). - * ConfigHandler provides the current Waila config state so you can show/hide elements depending on the configuration. Refer the ConfigHandler class for more info. - * currenttip represents the current list of text lines in the tooltip zone. - * For example, getWailaHead() will have the current item name as currenttip. - * You can modify the tips, add more, remove some, etc. - * When you are done, just returns the currenttip and it will display in Waila. - * - * Always return the currenttip is you don't want to modify the current zone. - */ - - List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); - List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); - List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaEntityAccessor.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaEntityAccessor.java deleted file mode 100644 index 788067af..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaEntityAccessor.java +++ /dev/null @@ -1,24 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -/* The Accessor is used to get some basic data out of the game without having to request - * direct access to the game engine. - * It will also return things that are unmodified by the overriding systems (like getWailaStack). - */ - -public interface IWailaEntityAccessor { - World getWorld(); - EntityPlayer getPlayer(); - Entity getEntity(); - MovingObjectPosition getPosition(); - Vec3 getRenderingPosition(); - NBTTagCompound getNBTData(); - int getNBTInteger(NBTTagCompound tag, String keyname); - double getPartialFrame(); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaEntityProvider.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaEntityProvider.java deleted file mode 100644 index 9548289a..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaEntityProvider.java +++ /dev/null @@ -1,16 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.List; - -import net.minecraft.entity.Entity; - -public interface IWailaEntityProvider { - - /* A way to get an override on the entity returned by the raytracing */ - Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config); - - /* The classical HEAD/BODY/TAIL text getters */ - List getWailaHead(Entity entity, List currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config); - List getWailaBody(Entity entity, List currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config); - List getWailaTail(Entity entity, List currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPAccessor.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPAccessor.java deleted file mode 100644 index e30afc43..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPAccessor.java +++ /dev/null @@ -1,28 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -/* The Accessor is used to get some basic data out of the game without having to request - * direct access to the game engine. - * It will also return things that are unmodified by the overriding systems (like getWailaStack). - */ - -public interface IWailaFMPAccessor { - World getWorld(); - EntityPlayer getPlayer(); - TileEntity getTileEntity(); - MovingObjectPosition getPosition(); - NBTTagCompound getNBTData(); - NBTTagCompound getFullNBTData(); - int getNBTInteger(NBTTagCompound tag, String keyname); - double getPartialFrame(); - Vec3 getRenderingPosition(); - String getID(); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPDecorator.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPDecorator.java deleted file mode 100644 index 839af31f..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPDecorator.java +++ /dev/null @@ -1,7 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.item.ItemStack; - -public interface IWailaFMPDecorator { - void decorateBlock(ItemStack itemStack, IWailaFMPAccessor accessor, IWailaConfigHandler config); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPProvider.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPProvider.java deleted file mode 100644 index 232c83ef..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaFMPProvider.java +++ /dev/null @@ -1,12 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -public interface IWailaFMPProvider { - /* The classical HEAD/BODY/TAIL text getters */ - List getWailaHead(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config); - List getWailaBody(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config); - List getWailaTail(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaRegistrar.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaRegistrar.java deleted file mode 100644 index 833f7715..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaRegistrar.java +++ /dev/null @@ -1,56 +0,0 @@ -package mcp.mobius.waila.api; - -public interface IWailaRegistrar { - /* Add a config option in the section modname with displayed text configtext and access key keyname */ - public void addConfig(String modname, String keyname, String configtext); - public void addConfigRemote(String modname, String keyname, String configtext); - public void addConfig(String modname, String keyname); - public void addConfigRemote(String modname, String keyname); - - /* Register a IWailaDataProvider for the given blockID, either for the Head section or the Body section */ - @Deprecated - public void registerHeadProvider (IWailaDataProvider dataProvider, int blockID); - @Deprecated - public void registerBodyProvider (IWailaDataProvider dataProvider, int blockID); - @Deprecated - public void registerTailProvider (IWailaDataProvider dataProvider, int blockID); - - /* Register a stack overrider for the given blockID */ - @Deprecated - public void registerStackProvider(IWailaDataProvider dataProvider, int blockID); - public void registerStackProvider(IWailaDataProvider dataProvider, Class block); - - /* Same thing, but works on a class hierarchy instead */ - public void registerHeadProvider (IWailaDataProvider dataProvider, Class block); - public void registerBodyProvider (IWailaDataProvider dataProvider, Class block); - public void registerTailProvider (IWailaDataProvider dataProvider, Class block); - - /* Entity text registration methods */ - public void registerHeadProvider (IWailaEntityProvider dataProvider, Class entity); - public void registerBodyProvider (IWailaEntityProvider dataProvider, Class entity); - public void registerTailProvider (IWailaEntityProvider dataProvider, Class entity); - public void registerOverrideEntityProvider (IWailaEntityProvider dataProvider, Class entity); - - /* FMP Providers */ - public void registerHeadProvider(IWailaFMPProvider dataProvider, String name); - public void registerBodyProvider(IWailaFMPProvider dataProvider, String name); - public void registerTailProvider(IWailaFMPProvider dataProvider, String name); - - /* The block decorators */ - @Deprecated - public void registerDecorator (IWailaBlockDecorator decorator, int blockID); - public void registerDecorator (IWailaBlockDecorator decorator, Class block); - public void registerDecorator (IWailaFMPDecorator decorator, String name); - - /* Selective NBT key syncing. Will register a key to sync over the network for the given class (block, te or ent). - * Accept * as a ending wildcard - * registerNBTKey("bob.*", MyBlock.class) - * registerNBTKey("data.life", MyEntity.class) - * registerNBTKey("*", MyTileEntity.class) will reproduce the full tag syncing from 1.4.5 - * */ - public void registerSyncedNBTKey(String key, Class target); - - /* UNUSED FOR NOW (Will be used for the ingame wiki */ - public void registerDocTextFile (String filename); - public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/IWailaSummaryProvider.java b/archaic/src/api/java/mcp/mobius/waila/api/IWailaSummaryProvider.java deleted file mode 100644 index f7906498..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/IWailaSummaryProvider.java +++ /dev/null @@ -1,21 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.LinkedHashMap; - -import net.minecraft.item.ItemStack; - -public interface IWailaSummaryProvider { - /* This interface is used to control the display data in the description screen */ - - /* BASIC TOOLS & ITEMS DATA */ - //EnumToolMaterial getMaterial(ItemStack stack); - //String getMaterialName(ItemStack stack); - //String getEffectiveBlock(ItemStack stack); - //int getHarvestLevel(ItemStack stack); - //float getEfficiencyOnProperMaterial(ItemStack stack); - //int getEnchantability(ItemStack stack); - //int getDamageVsEntity(ItemStack stack); - //int getDurability(ItemStack stack); - - LinkedHashMap getSummary(ItemStack stack, LinkedHashMap currentSummary, IWailaConfigHandler config); -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/SpecialChars.java b/archaic/src/api/java/mcp/mobius/waila/api/SpecialChars.java deleted file mode 100644 index 5bd92a82..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/SpecialChars.java +++ /dev/null @@ -1,40 +0,0 @@ -package mcp.mobius.waila.api; - -public class SpecialChars { - - public static String MCStyle = "\u00A7"; - - public static String BLACK = MCStyle + "0"; - public static String DBLUE = MCStyle + "1"; - public static String DGREEN = MCStyle + "2"; - public static String DAQUA = MCStyle + "3"; - public static String DRED = MCStyle + "4"; - public static String DPURPLE = MCStyle + "5"; - public static String GOLD = MCStyle + "6"; - public static String GRAY = MCStyle + "7"; - public static String DGRAY = MCStyle + "8"; - public static String BLUE = MCStyle + "9"; - public static String GREEN = MCStyle + "a"; - public static String AQUA = MCStyle + "b"; - public static String RED = MCStyle + "c"; - public static String LPURPLE = MCStyle + "d"; - public static String YELLOW = MCStyle + "e"; - public static String WHITE = MCStyle + "f"; - - public static String OBF = MCStyle + "k"; - public static String BOLD = MCStyle + "l"; - public static String STRIKE = MCStyle + "m"; - public static String UNDER = MCStyle + "n"; - public static String ITALIC = MCStyle + "o"; - public static String RESET = MCStyle + "r"; - - public static String WailaStyle = "\u00A4"; - public static String WailaIcon = "\u00A5"; - public static String TAB = WailaStyle + WailaStyle +"a"; - public static String ALIGNRIGHT = WailaStyle + WailaStyle +"b"; - public static String ALIGNCENTER = WailaStyle + WailaStyle +"c"; - public static String HEART = WailaStyle + WailaIcon +"a"; - public static String HHEART = WailaStyle + WailaIcon +"b"; - public static String EHEART = WailaStyle + WailaIcon +"c"; - -} diff --git a/archaic/src/api/java/mcp/mobius/waila/api/package-info.java b/archaic/src/api/java/mcp/mobius/waila/api/package-info.java deleted file mode 100644 index 9b5e663b..00000000 --- a/archaic/src/api/java/mcp/mobius/waila/api/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@API(apiVersion="1.0",owner="Waila",provides="WailaAPI") -package mcp.mobius.waila.api; -import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/archive/java/dark/lib/BlockFluid.java b/archive/java/dark/lib/BlockFluid.java deleted file mode 100644 index 058056fb..00000000 --- a/archive/java/dark/lib/BlockFluid.java +++ /dev/null @@ -1,52 +0,0 @@ -package dark.lib; - -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.util.Icon; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.fluids.BlockFluidFinite; -import net.minecraftforge.fluids.Fluid; -import resonantinduction.core.Settings; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockFluid extends BlockFluidFinite -{ - Icon flowing; - Icon still; - Fluid fluid; - String prefix = ""; - - public BlockFluid(String prefix, Fluid fluid, Configuration config) - { - this(prefix, Settings.getNextBlockID(), fluid, config); - } - - public BlockFluid(String prefix, int id, Fluid fluid, Configuration config) - { - super(config.getBlock("BlockFluid" + fluid.getName(), id).getInt(), fluid, Material.water); - this.fluid = fluid; - if (prefix != null && prefix.contains(":")) - { - this.prefix = prefix; - } - - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) - { - this.flowing = par1IconRegister.registerIcon(prefix + this.getUnlocalizedName().replace("tile.", "") + "_flowing"); - this.still = par1IconRegister.registerIcon(prefix + this.getUnlocalizedName().replace("tile.", "") + "_still"); - fluid.setIcons(still, flowing); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int par1, int par2) - { - return still; - } - -} diff --git a/archive/java/dark/lib/ClientRegistryProxy.java b/archive/java/dark/lib/ClientRegistryProxy.java deleted file mode 100644 index 1af1fa8d..00000000 --- a/archive/java/dark/lib/ClientRegistryProxy.java +++ /dev/null @@ -1,32 +0,0 @@ -package dark.lib; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.item.ItemBlock; -import net.minecraft.tileentity.TileEntity; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.client.registry.ClientRegistry; -import dark.lib.IExtraInfo.IExtraBlockInfo; - -public class ClientRegistryProxy extends RegistryProxy -{ - @Override - public void registerBlock(Block block, Class itemClass, String name, String modID) - { - super.registerBlock(block, itemClass, name, modID); - if (block instanceof IExtraBlockInfo) - { - List, TileEntitySpecialRenderer>> set = new ArrayList, TileEntitySpecialRenderer>>(); - ((IExtraBlockInfo) block).getClientTileEntityRenderers(set); - for (Pair, TileEntitySpecialRenderer> par : set) - { - ClientRegistry.bindTileEntitySpecialRenderer(par.left(), par.right()); - } - } - } -} diff --git a/archive/java/dark/lib/CoreRegistry.java b/archive/java/dark/lib/CoreRegistry.java deleted file mode 100644 index 3363a932..00000000 --- a/archive/java/dark/lib/CoreRegistry.java +++ /dev/null @@ -1,257 +0,0 @@ -package dark.lib; - -import java.io.File; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; -import dark.lib.IExtraInfo.IExtraBlockInfo; -import dark.lib.IExtraInfo.IExtraItemInfo; - -/** - * Handler to make registering all parts of a mod's objects that are loaded into the game by forge - * - * @author DarkGuardsman - */ -public class CoreRegistry -{ - public static HashMap registredBlocks = new HashMap(); - public static HashMap registredItems = new HashMap(); - - //@SidedProxy(clientSide = "com.builtbroken.minecraft.ClientRegistryProxy", serverSide = "com.builtbroken.minecraft.RegistryProxy") - public static RegistryProxy prox; - - public static RegistryProxy proxy() - { - if (prox == null) - { - if (FMLCommonHandler.instance().getSide().isClient()) - { - prox = new ClientRegistryProxy(); - } - else - { - prox = new RegistryProxy(); - } - } - return prox; - } - - public static Configuration masterBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "objects/EnabledBlocks.cfg")); - - /** - * Generates a block using reflection, and runs it threw config checks - * - * @param name - name to register the block with - * @param modID - mod id to register the block to - * @param blockClass - class to generate the instance from - */ - public static Block createNewBlock(String name, String modID, Class blockClass) - { - return CoreRegistry.createNewBlock(name, modID, blockClass, true); - } - - /** - * Generates a block using reflection, and runs it threw config checks - * - * @param name - name to register the block with - * @param modID - mod id to register the block to - * @param blockClass - class to generate the instance from - * @param canDisable - should we allow the player the option to disable the block - */ - public static Block createNewBlock(String name, String modID, Class blockClass, boolean canDisable) - { - return CoreRegistry.createNewBlock(name, modID, blockClass, null, canDisable); - } - - /** - * Generates a block using reflection, and runs it threw config checks - * - * @param name - name to register the block with - * @param modID - mod id to register the block to - * @param blockClass - class to generate the instance from - * @param itemClass - item block to register with the block - */ - public static Block createNewBlock(String name, String modID, Class blockClass, Class itemClass) - { - return createNewBlock(name, modID, blockClass, itemClass, true); - } - - /** - * Generates a block using reflection, and runs it threw config checks - * - * @param name - name to register the block with - * @param modID - mod id to register the block to - * @param blockClass - class to generate the instance from - * @param canDisable - should we allow the player the option to disable the block - * @param itemClass - item block to register with the block - */ - public static Block createNewBlock(String name, String modID, Class blockClass, Class itemClass, boolean canDisable) - { - Block block = null; - if (blockClass != null && (!canDisable || canDisable && masterBlockConfig.get("Enabled_List", "Enabled_" + name, true).getBoolean(true))) - { - // TODO redesign to catch blockID conflict - try - { - block = blockClass.newInstance(); - } - catch (IllegalArgumentException e) - { - throw e; - } - catch (Exception e) - { - System.out.println("\n\nWarning: Block [" + name + "] failed to be created\n"); - e.printStackTrace(); - System.out.println("\n\n"); - } - if (block != null) - { - registredBlocks.put(block, name); - proxy().registerBlock(block, itemClass, name, modID); - CoreRegistry.finishCreation(block); - } - } - return block; - } - - /** Finishes the creation of the block loading config files and tile entities */ - public static void finishCreation(Block block) - { - if (block instanceof IExtraInfo) - { - if (((IExtraInfo) block).hasExtraConfigs()) - { - Configuration extraBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "objects/blocks/" + block.getUnlocalizedName() + ".cfg")); - extraBlockConfig.load(); - ((IExtraInfo) block).loadExtraConfigs(extraBlockConfig); - extraBlockConfig.save(); - } - if (block instanceof IExtraBlockInfo) - { - ((IExtraBlockInfo) block).loadOreNames(); - Set>> tileListNew = new HashSet>>(); - ((IExtraBlockInfo) block).getTileEntities(block.blockID, tileListNew); - for (Pair> par : tileListNew) - { - proxy().regiserTileEntity(par.left(), par.right()); - } - } - } - - } - - /** - * Method to get block via name - * - * @param blockName - * @return Block requested - */ - public static Block getBlock(String blockName) - { - for (Entry entry : registredBlocks.entrySet()) - { - String name = entry.getKey().getUnlocalizedName().replace("tile.", ""); - if (name.equalsIgnoreCase(blockName)) - { - return entry.getKey(); - } - } - return null; - } - - /** - * Creates a new fluid block using the prefab following a few conditions. - * - * @param modDomainPrefix - prefix of the mod, used for texture refrence and block registry - * @param config - config file to pull the blockID from - * @param fluid - fluid to link to this block - */ - public static Block createNewFluidBlock(String modDomainPrefix, Configuration config, Fluid fluid) - { - Block fluidBlock = null; - Fluid fluidActual = null; - if (config != null && fluid != null && config.get("general", "EnableFluid_" + fluid.getName(), true).getBoolean(true) && FluidRegistry.getFluid(fluid.getName()) == null) - { - FluidRegistry.registerFluid(fluid); - fluidActual = FluidRegistry.getFluid(fluid.getName()); - if (fluidActual == null) - { - fluidActual = fluid; - } - - if (fluidActual.getBlockID() == -1 && masterBlockConfig.get("Enabled_List", "Enabled_" + fluid.getName() + "Block", true).getBoolean(true)) - { - fluidBlock = new BlockFluid(modDomainPrefix, fluidActual, config).setUnlocalizedName("tile.Fluid." + fluid.getName()); - proxy().registerBlock(fluidBlock, null, "DMBlockFluid" + fluid.getName(), modDomainPrefix); - } - else - { - fluidBlock = Block.blocksList[fluid.getBlockID()]; - } - } - - return fluidBlock; - } - - /** - * Creates a new item using reflection as well runs it threw some check to activate any - * interface methods - * - * @param name - name to register the item with - * @param modid - mods that the item comes from - * @param clazz - item class - * @param canDisable - can a user disable this item - * @return the new item - */ - public static Item createNewItem(String name, String modid, Class clazz, boolean canDisable) - { - Item item = null; - if (clazz != null && (!canDisable || canDisable && masterBlockConfig.get("Enabled_List", "Enabled_" + name, true).getBoolean(true))) - { - try - { - item = clazz.newInstance(); - } - catch (Exception e) - { - e.printStackTrace(); - } - if (item != null) - { - registredItems.put(item, name); - GameRegistry.registerItem(item, name, modid); - if (item instanceof IExtraInfo) - { - if (((IExtraInfo) item).hasExtraConfigs()) - { - Configuration extraBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "objects/items/" + item.getUnlocalizedName() + ".cfg")); - extraBlockConfig.load(); - ((IExtraInfo) item).loadExtraConfigs(extraBlockConfig); - extraBlockConfig.save(); - } - if (item instanceof IExtraItemInfo) - { - ((IExtraItemInfo) item).loadOreNames(); - } - } - } - } - return item; - } -} diff --git a/archive/java/dark/lib/EnumMaterial.java b/archive/java/dark/lib/EnumMaterial.java deleted file mode 100644 index 8e71050c..00000000 --- a/archive/java/dark/lib/EnumMaterial.java +++ /dev/null @@ -1,143 +0,0 @@ -package dark.lib; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.EnumToolMaterial; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Class for storing materials, there icon names, sub items to be made from them or there sub ores - * - * - * @author DarkGuardsman - */ -public enum EnumMaterial -{ - WOOD("Wood", EnumToolMaterial.WOOD, EnumOrePart.INGOTS, EnumOrePart.PLATES, EnumOrePart.RUBBLE, EnumOrePart.ROD, EnumOrePart.MOLTEN), - STONE("Stone", EnumToolMaterial.STONE, EnumOrePart.INGOTS, EnumOrePart.SCRAPS, EnumOrePart.MOLTEN), - IRON("Iron", EnumToolMaterial.IRON, EnumOrePart.INGOTS), - OBBY("Obby", true, 7.0f, 500, 4, EnumOrePart.INGOTS, EnumOrePart.RUBBLE, EnumOrePart.SCRAPS, EnumOrePart.PLATES, EnumOrePart.MOLTEN), - GOLD("Gold", EnumToolMaterial.GOLD, EnumOrePart.GEARS, EnumOrePart.INGOTS), - COAL("Coal", EnumToolMaterial.WOOD, EnumOrePart.GEARS, EnumOrePart.TUBE, EnumOrePart.PLATES, EnumOrePart.RUBBLE, EnumOrePart.SCRAPS, EnumOrePart.MOLTEN), - - COPPER("Copper", true, 3.5f, 79, 1), - TIN("Tin", true, 2.0f, 50, 1, EnumOrePart.GEARS, EnumOrePart.TUBE), - LEAD("Lead", false, 0, 0, 1, EnumOrePart.GEARS, EnumOrePart.TUBE), - ALUMINIUM("Aluminum", true, 5.0f, 100, 2, EnumOrePart.GEARS, EnumOrePart.TUBE), - SILVER("Silver", true, 11.0f, 30, 0, EnumOrePart.GEARS), - STEEL("Steel", true, 7.0f, 4, 1000, EnumOrePart.RUBBLE), - BRONZE("Bronze", true, 6.5f, 3, 560, EnumOrePart.RUBBLE); - - /** Name of the material */ - public String simpleName; - /** List of ore parts that to not be created for the material */ - public List unneedItems; - - public boolean hasTools = false; - - /** Limit by which each material is restricted by for creating orePart sub items */ - public static final int itemCountPerMaterial = 50; - - /** Client side only var used by ore items to store icon per material set */ - @SideOnly(Side.CLIENT) - public Icon[] itemIcons; - - public float materialEffectiveness = 2.0f; - public int maxUses = 100; - public float damageBoost = 0; - - private EnumMaterial(String name, EnumToolMaterial material, EnumOrePart... enumOreParts) - { - this(name, false, material.getEfficiencyOnProperMaterial(), material.getMaxUses(), material.getDamageVsEntity(), enumOreParts); - } - - private EnumMaterial(String name, boolean tool, float effectiveness, int toolUses, float damage, EnumOrePart... enumOreParts) - { - this.simpleName = name; - this.hasTools = tool; - this.materialEffectiveness = effectiveness; - this.maxUses = toolUses; - this.damageBoost = damage; - unneedItems = new ArrayList(); - for (int i = 0; enumOreParts != null && i < enumOreParts.length; i++) - { - unneedItems.add(enumOreParts[i]); - } - } - - /** - * Creates a new item stack using material and part given. Uses a preset length of 50 for parts - * enum so to prevent any unwanted changes in loading of itemStacks metadata. - * - * @param mat - material - * @param part - part - * @return new ItemStack created from the two enums as long as everything goes right - */ - public static ItemStack getStack(Item item, EnumMaterial mat, EnumOrePart part, int ammount) - { - ItemStack reStack = null; - if (mat != null && part != null) - { - if (part == EnumOrePart.INGOTS) - { - if (mat == EnumMaterial.IRON) - { - return new ItemStack(Item.ingotIron, 1); - } - else if (mat == EnumMaterial.GOLD) - { - return new ItemStack(Item.ingotGold, 1); - } - } - int meta = mat.ordinal() * itemCountPerMaterial; - meta += part.ordinal(); - return new ItemStack(item, ammount, meta); - } - return reStack; - } - - public ItemStack getStack(Item item, EnumOrePart part) - { - return this.getStack(item, part, 1); - } - - public ItemStack getStack(Item item, EnumOrePart part, int ammount) - { - return getStack(item, this, part, ammount); - } - - public static Icon getIcon(int metadata) - { - int mat = metadata / EnumMaterial.itemCountPerMaterial; - if (mat < EnumMaterial.values().length) - { - return EnumMaterial.values()[metadata / EnumMaterial.itemCountPerMaterial].itemIcons[metadata % EnumMaterial.itemCountPerMaterial]; - } - return null; - } - - public static String getOreName(EnumMaterial mat, EnumOrePart part) - { - return mat.getOreName(part); - } - - public String getOreName(EnumOrePart part) - { - return part.simpleName.toLowerCase() + this.simpleName; - } - - public boolean shouldCreateItem(EnumOrePart part) - { - return this.unneedItems == null || !this.unneedItems.contains(part); - } - - public boolean shouldCreateTool() - { - return this.hasTools; - } -} diff --git a/archive/java/dark/lib/EnumOrePart.java b/archive/java/dark/lib/EnumOrePart.java deleted file mode 100644 index 9e1051a9..00000000 --- a/archive/java/dark/lib/EnumOrePart.java +++ /dev/null @@ -1,41 +0,0 @@ -package dark.lib; - -public enum EnumOrePart -{ - - RUBBLE("Rubble"), DUST("Dust"), INGOTS("Ingot"), PLATES("Plate"), GEARS("Gears"), TUBE("Tube"), - ROD("Rod"), SCRAPS("Scraps"), MOLTEN("Molten"); - - public String simpleName; - - private EnumOrePart(String name) - { - this.simpleName = name; - } - - /** - * This gets the part name based on the meta value of the ore dirv item. However can also be - * used to get the part name if under X value - */ - public static String getPartName(int meta) - { - int partID = meta % EnumMaterial.itemCountPerMaterial; - if (partID < EnumOrePart.values().length) - { - return EnumOrePart.values()[partID].simpleName; - } - return "Part[" + partID + "]"; - } - - /** This gets the full name based on the metadata of the ore dirv item */ - public static String getFullName(int itemMetaData) - { - int matID = itemMetaData / EnumMaterial.itemCountPerMaterial; - int partID = itemMetaData % EnumMaterial.itemCountPerMaterial; - if (matID < EnumMaterial.values().length && partID < EnumOrePart.values().length) - { - return EnumMaterial.values()[matID].simpleName + EnumOrePart.values()[partID].simpleName; - } - return "OrePart[" + matID + "][" + partID + "]"; - } -} diff --git a/archive/java/dark/lib/IExtraInfo.java b/archive/java/dark/lib/IExtraInfo.java deleted file mode 100644 index b47370c3..00000000 --- a/archive/java/dark/lib/IExtraInfo.java +++ /dev/null @@ -1,60 +0,0 @@ -package dark.lib; - -import java.util.List; -import java.util.Set; - -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.Configuration; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Used to handle info about the block that would normally be handled by the mod main class. Use the - * BlockRegistry in order for these methods to be called on load of the mod. - * - * @author DarkGuardsman - */ -public interface IExtraInfo -{ - - /** Does this object need to generate a settings config */ - public boolean hasExtraConfigs(); - - /** - * Loads the config file for this block. This is a single config file that is tied to just this - * block alone. Anything can be stored in the config file but its suggested to use it for - * advanced settings for the block/tile. Things like power, update rate, optional features, - * graphics, or crafting cost - */ - public void loadExtraConfigs(Configuration config); - - public static interface IExtraBlockInfo extends IExtraInfo, ITileEntityProvider - { - - /** Loads the names used to reference this item in a recipe */ - public void loadOreNames(); - - /** List of all tileEntities this block needs */ - public void getTileEntities(int blockID, Set>> list); - - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list); - } - - public static interface IExtraTileEntityInfo extends IExtraInfo - { - - } - - public static interface IExtraItemInfo extends IExtraInfo - { - /** Loads the names used to reference this item in a recipe */ - public void loadOreNames(); - } - -} diff --git a/archive/java/dark/lib/LaserEntityDamageSource.java b/archive/java/dark/lib/LaserEntityDamageSource.java deleted file mode 100644 index f57774e8..00000000 --- a/archive/java/dark/lib/LaserEntityDamageSource.java +++ /dev/null @@ -1,36 +0,0 @@ -package dark.lib; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.util.EntityDamageSource; -import net.minecraftforge.event.ForgeSubscribe; -import net.minecraftforge.event.entity.living.LivingDeathEvent; - -public class LaserEntityDamageSource extends EntityDamageSource -{ - public LaserEntityDamageSource(Entity par2Entity) - { - super("Laser", par2Entity); - } - - @ForgeSubscribe - public void LivingDeathEvent(LivingDeathEvent event) - { - if (event.entity instanceof EntityCreeper) - { - if (!event.entity.worldObj.isRemote && event.source instanceof LaserEntityDamageSource) - { - boolean flag = event.entity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); - - if (((EntityCreeper) event.entity).getPowered()) - { - event.entity.worldObj.createExplosion(event.entity, event.entity.posX, event.entity.posY, event.entity.posZ, 3 * 2, flag); - } - else - { - event.entity.worldObj.createExplosion(event.entity, event.entity.posX, event.entity.posY, event.entity.posZ, 3, flag); - } - } - } - } -} diff --git a/archive/java/dark/lib/OtherDamageSource.java b/archive/java/dark/lib/OtherDamageSource.java deleted file mode 100644 index 7d91e95d..00000000 --- a/archive/java/dark/lib/OtherDamageSource.java +++ /dev/null @@ -1,52 +0,0 @@ -package dark.lib; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.DamageSource; - -public class OtherDamageSource extends DamageSource -{ - protected Object damageSource; - - public OtherDamageSource(String damageName, Object attacker) - { - super(damageName); - this.damageSource = attacker; - } - - @Override - public Entity getEntity() - { - return damageSource instanceof Entity ? ((Entity) damageSource) : null; - } - - public TileEntity getTileEntity() - { - return damageSource instanceof TileEntity ? ((TileEntity) damageSource) : null; - } - - @Override - public boolean isDifficultyScaled() - { - return this.damageSource != null && this.damageSource instanceof EntityLiving && !(this.damageSource instanceof EntityPlayer); - } - - @Override - public OtherDamageSource setProjectile() - { - super.setProjectile(); - return this; - } - - public static OtherDamageSource doBulletDamage(Object object) - { - return new OtherDamageSource("Bullets", object).setProjectile(); - } - - public static OtherDamageSource doLaserDamage(Object object) - { - return new OtherDamageSource("Laser", object).setProjectile(); - } -} diff --git a/archive/java/dark/lib/RegistryProxy.java b/archive/java/dark/lib/RegistryProxy.java deleted file mode 100644 index f434b4a4..00000000 --- a/archive/java/dark/lib/RegistryProxy.java +++ /dev/null @@ -1,22 +0,0 @@ -package dark.lib; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.common.registry.GameRegistry; - -public class RegistryProxy -{ - public void registerBlock(Block block, Class itemClass, String name, String modID) - { - if (block != null && name != null) - { - GameRegistry.registerBlock(block, itemClass == null ? ItemBlock.class : itemClass, name, modID); - } - } - - public void regiserTileEntity(String name, Class clazz) - { - GameRegistry.registerTileEntityWithAlternatives(clazz, name, "DM" + name); - } -} diff --git a/archive/java/dark/lib/helpers/ColorCode.java b/archive/java/dark/lib/helpers/ColorCode.java deleted file mode 100644 index 285bc42b..00000000 --- a/archive/java/dark/lib/helpers/ColorCode.java +++ /dev/null @@ -1,95 +0,0 @@ -package dark.lib.helpers; - -import java.awt.Color; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public enum ColorCode -{ - BLACK("Black", Color.black), RED("Red", Color.red), GREEN("Green", Color.green), - BROWN("Brown", new Color(139, 69, 19)), BLUE("Blue", Color.BLUE), - PURPLE("Purple", new Color(75, 0, 130)), CYAN("Cyan", Color.cyan), - SILVER("Silver", new Color(192, 192, 192)), GREY("Grey", Color.gray), PINK("Pink", Color.pink), - LIME("Lime", new Color(0, 255, 0)), YELLOW("Yellow", Color.yellow), - LIGHTBLUE("LightBlue", new Color(135, 206, 250)), MAGENTA("Magenta", Color.magenta), - ORANGE("Orange", Color.orange), WHITE("White", Color.white), UNKOWN("", Color.BLACK); - - public String name; - public Color color; - - private ColorCode(String name, Color color) - { - this.name = name; - this.color = color; - } - - public String getName() - { - return this.name; - } - - /** - * gets a ColorCode from any of the following - * - * @param obj - Integer,String,LiquidData,ColorCode - * @return Color NONE if it can't find it - */ - public static ColorCode get(Object obj) - { - if (obj instanceof Integer && ((Integer) obj) < ColorCode.values().length) - { - return ColorCode.values()[((Integer) obj)]; - } - else if (obj instanceof ColorCode) - { - return (ColorCode) obj; - } - else if (obj instanceof String) - { - for (int i = 0; i < ColorCode.values().length; i++) - { - if (((String) obj).equalsIgnoreCase(ColorCode.get(i).getName())) - { - return ColorCode.get(i); - } - } - } - return UNKOWN; - } - - /** Used on anything that is coded for a set color for varies reasons */ - public static interface IColorCoded - { - /** Returns the ColorCode of the object */ - public ColorCode getColor(); - - /** Sets the ColorCode of the Object */ - public boolean setColor(Object obj); - } - - public static interface IColoredItem - { - /** Returns the ColorCode of the object */ - public ColorCode getColor(ItemStack stack); - - /** Sets the ColorCode of the Object */ - public boolean setColor(ItemStack stack, Object obj); - } - - public static interface IColoredId - { - /** Returns the ColorCode of the object */ - public ColorCode getColor(int i); - } - - public static interface IColoredBlock - { - /** Returns the ColorCode of the object */ - public ColorCode getColor(World world, int x, int y, int z); - - /** Sets the ColorCode of the Object */ - public void setColor(World world, int x, int y, int z, Object obj); - } - -} diff --git a/archive/java/dark/lib/interfaces/IControlReceiver.java b/archive/java/dark/lib/interfaces/IControlReceiver.java deleted file mode 100644 index 75f5325e..00000000 --- a/archive/java/dark/lib/interfaces/IControlReceiver.java +++ /dev/null @@ -1,20 +0,0 @@ -package dark.lib.interfaces; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Applied to objects that can be control by the player using the keyboard - * - * @author DarkGuardsman - */ -public interface IControlReceiver -{ - /** - * Called when the player presses a key - * - * @param player - client player - * @param character - character code - * @param keycode - keyboard code - */ - public boolean keyTyped(EntityPlayer player, int keycode); -} diff --git a/archive/java/dark/lib/interfaces/IExtendedStorage.java b/archive/java/dark/lib/interfaces/IExtendedStorage.java deleted file mode 100644 index 7cce0377..00000000 --- a/archive/java/dark/lib/interfaces/IExtendedStorage.java +++ /dev/null @@ -1,13 +0,0 @@ -package dark.lib.interfaces; - -import net.minecraft.item.ItemStack; - -/** - * Applied to blocks that store items in stacks above 64 and as one large collective of items - * - * @author DarkGuardsman - */ -public interface IExtendedStorage -{ - public ItemStack addStackToStorage(ItemStack stack); -} diff --git a/archive/java/dark/lib/interfaces/IExternalInv.java b/archive/java/dark/lib/interfaces/IExternalInv.java deleted file mode 100644 index abbd3d55..00000000 --- a/archive/java/dark/lib/interfaces/IExternalInv.java +++ /dev/null @@ -1,13 +0,0 @@ -package dark.lib.interfaces; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.ForgeDirection; - -public interface IExternalInv -{ - public IInvBox getInventory(); - - public boolean canStore(ItemStack stack, int slot, ForgeDirection side); - - public boolean canRemove(ItemStack stack, int slot, ForgeDirection side); -} diff --git a/archive/java/dark/lib/interfaces/IInvBox.java b/archive/java/dark/lib/interfaces/IInvBox.java deleted file mode 100644 index 56e3a560..00000000 --- a/archive/java/dark/lib/interfaces/IInvBox.java +++ /dev/null @@ -1,21 +0,0 @@ -package dark.lib.interfaces; - -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -/** @author DarkGuardsman */ -public interface IInvBox extends ISidedInventory -{ - /** Gets the inventory array. ForgeDirection.UNKOWN must return all sides */ - public ItemStack[] getContainedItems(); - - /** Called to save the inventory array */ - public NBTTagCompound saveInv(NBTTagCompound tag); - - /** Called to load the inventory array */ - public void loadInv(NBTTagCompound tag); - - /** Dels all the items in the inventory */ - public void clear(); -} diff --git a/archive/java/dark/lib/interfaces/IPowerLess.java b/archive/java/dark/lib/interfaces/IPowerLess.java deleted file mode 100644 index 66deec57..00000000 --- a/archive/java/dark/lib/interfaces/IPowerLess.java +++ /dev/null @@ -1,16 +0,0 @@ -package dark.lib.interfaces; - -/** - * Applied to devices that have the option to run without power. Normally this option is only shown - * to creative mode players - * - * @author DarkGuardsman - */ -public interface IPowerLess -{ - /** Should this run without power */ - public boolean runPowerLess(); - - /** Set if this should run powerless */ - public void setPowerLess(boolean bool); -} diff --git a/archive/java/dark/lib/interfaces/IReadOut.java b/archive/java/dark/lib/interfaces/IReadOut.java deleted file mode 100644 index d4d2c611..00000000 --- a/archive/java/dark/lib/interfaces/IReadOut.java +++ /dev/null @@ -1,37 +0,0 @@ -package dark.lib.interfaces; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.ForgeDirection; - -/** - * Simple way to control the read-out display over several tools when they are used on the - * tileEntity - * - * @author DarkGuardsman - */ -public interface IReadOut -{ - /** - * Grabs the message displayed to the user on right click of the machine with the given tool - * - * @param user - * @param side - may not work correctly yet but should give you a side - * @return - a string to be displayed to the player for a reading. automatically adds ReadOut: - * to the beginning - */ - public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool); - - public static enum EnumTools - { - PIPE_GUAGE(), MULTI_METER(); - - public static EnumTools get(int meta) - { - if (meta < EnumTools.values().length) - { - return EnumTools.values()[meta]; - } - return null; - } - } -} diff --git a/archive/java/dark/lib/interfaces/IRotatableBlock.java b/archive/java/dark/lib/interfaces/IRotatableBlock.java deleted file mode 100644 index f998d568..00000000 --- a/archive/java/dark/lib/interfaces/IRotatableBlock.java +++ /dev/null @@ -1,19 +0,0 @@ -package dark.lib.interfaces; - -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -/** - * The interface is applied to Blocks that can rotate. - * - * @author DarkGuardsman - */ - -public interface IRotatableBlock -{ - /** @return Gets the facing direction. Always returns the front side of the block. */ - public ForgeDirection getDirection(World world, int x, int y, int z); - - /** @param Sets the facing direction. */ - public void setDirection(World world, int x, int y, int z, ForgeDirection direection); -} diff --git a/archive/java/dark/lib/prefab/invgui/ContainerFake.java b/archive/java/dark/lib/prefab/invgui/ContainerFake.java deleted file mode 100644 index d52ca20b..00000000 --- a/archive/java/dark/lib/prefab/invgui/ContainerFake.java +++ /dev/null @@ -1,32 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.tileentity.TileEntity; - -/** - * Allows the use of a tile inv without the need for a container class - * - * @author DarkGuardsman - */ -public class ContainerFake extends Container -{ - TileEntity entity = null; - - public ContainerFake(TileEntity entity) - { - this.entity = entity; - } - - @Override - public boolean canInteractWith(EntityPlayer par1EntityPlayer) - { - if (entity instanceof IInventory) - { - return ((IInventory) this.entity).isUseableByPlayer(par1EntityPlayer); - } - return true; - } - -} diff --git a/archive/java/dark/lib/prefab/invgui/GuiBase.java b/archive/java/dark/lib/prefab/invgui/GuiBase.java deleted file mode 100644 index e06d2f3b..00000000 --- a/archive/java/dark/lib/prefab/invgui/GuiBase.java +++ /dev/null @@ -1,167 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderHelper; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import universalelectricity.api.vector.Vector2; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public abstract class GuiBase extends GuiScreen -{ - - protected Vector2 c; - protected Vector2 guiSize = new Vector2(176, 166); - - /** Adds the buttons (and other controls) to the screen in question. */ - @Override - public void initGui() - { - super.initGui(); - c = new Vector2((this.width - this.guiSize.intX()) / 2, (this.height - this.guiSize.intY()) / 2); - } - - /** Draws the screen and all the components in it. */ - @Override - public void drawScreen(int par1, int par2, float par3) - { - this.drawDefaultBackground(); - int var4 = (int) this.c.x; - int var5 = (int) this.c.y; - this.drawBackgroundLayer(par1, par2, par3); - GL11.glPushMatrix(); - GL11.glTranslatef(var4, var5, 0.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - short var7 = 240; - short var8 = 240; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, var7 / 1.0F, var8 / 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - this.drawForegroundLayer(par1, par2, par3); - - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - - GL11.glPopMatrix(); - super.drawScreen(par1, par2, par3); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - - /** Draws the foreground layer for the GUI */ - protected abstract void drawForegroundLayer(int var2, int var3, float var1); - - /** Draws the background layer for the GUI */ - - protected abstract void drawBackgroundLayer(int var2, int var3, float var1); - - /** Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). */ - @Override - protected void keyTyped(char x, int y) - { - if (y == 1 || y == this.mc.gameSettings.keyBindInventory.keyCode) - { - this.mc.thePlayer.closeScreen(); - } - } - - /** Returns true if this GUI should pause the game when it is displayed in single-player */ - @Override - public boolean doesGuiPauseGame() - { - return false; - } - - /** Called from the main game loop to update the screen. */ - @Override - public void updateScreen() - { - super.updateScreen(); - - if (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) - { - this.mc.thePlayer.closeScreen(); - } - } - - public void drawTooltip(int x, int y, String... toolTips) - { - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - - if (toolTips != null) - { - int var5 = 0; - int var6; - int var7; - - for (var6 = 0; var6 < toolTips.length; ++var6) - { - var7 = this.fontRenderer.getStringWidth(toolTips[var6]); - - if (var7 > var5) - { - var5 = var7; - } - } - - var6 = x + 12; - var7 = y - 12; - int var9 = 8; - - if (toolTips.length > 1) - { - var9 += 2 + (toolTips.length - 1) * 10; - } - - if (this.c.intY() + var7 + var9 + 6 > this.height) - { - var7 = this.height - var9 - this.c.intY() - 6; - } - - this.zLevel = 300.0F; - int var10 = -267386864; - this.drawGradientRect(var6 - 3, var7 - 4, var6 + var5 + 3, var7 - 3, var10, var10); - this.drawGradientRect(var6 - 3, var7 + var9 + 3, var6 + var5 + 3, var7 + var9 + 4, var10, var10); - this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 + var9 + 3, var10, var10); - this.drawGradientRect(var6 - 4, var7 - 3, var6 - 3, var7 + var9 + 3, var10, var10); - this.drawGradientRect(var6 + var5 + 3, var7 - 3, var6 + var5 + 4, var7 + var9 + 3, var10, var10); - int var11 = 1347420415; - int var12 = (var11 & 16711422) >> 1 | var11 & -16777216; - this.drawGradientRect(var6 - 3, var7 - 3 + 1, var6 - 3 + 1, var7 + var9 + 3 - 1, var11, var12); - this.drawGradientRect(var6 + var5 + 2, var7 - 3 + 1, var6 + var5 + 3, var7 + var9 + 3 - 1, var11, var12); - this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 - 3 + 1, var11, var11); - this.drawGradientRect(var6 - 3, var7 + var9 + 2, var6 + var5 + 3, var7 + var9 + 3, var12, var12); - - for (int var13 = 0; var13 < toolTips.length; ++var13) - { - String var14 = toolTips[var13]; - - this.fontRenderer.drawStringWithShadow(var14, var6, var7, -1); - - if (var13 == 0) - { - var7 += 2; - } - - var7 += 10; - } - - this.zLevel = 0.0F; - } - - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glEnable(GL11.GL_LIGHTING); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - } -} diff --git a/archive/java/dark/lib/prefab/invgui/GuiButtonImage.java b/archive/java/dark/lib/prefab/invgui/GuiButtonImage.java deleted file mode 100644 index 64c064fa..00000000 --- a/archive/java/dark/lib/prefab/invgui/GuiButtonImage.java +++ /dev/null @@ -1,78 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiButtonImage extends GuiButton -{ - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_button.png"); - - private ButtonIcon buttonIcon = ButtonIcon.BLANK; - - public GuiButtonImage(int buttonID, int xx, int yy, ButtonIcon icon) - { - super(buttonID, xx, yy, 20, 20, ""); - this.buttonIcon = icon; - this.width = icon.sizeX; - this.height = icon.sizeY; - } - - /** Draws this button to the screen. */ - @Override - public void drawButton(Minecraft mc, int width, int hight) - { - if (this.drawButton) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - boolean hovering = width >= this.xPosition && hight >= this.yPosition && width < this.xPosition + this.width && hight < this.yPosition + this.height; - int vv = buttonIcon.vv; - int uu = buttonIcon.uu; - if (hovering) - { - vv += this.height; - } - - this.drawTexturedModalRect(this.xPosition, this.yPosition, this.buttonIcon.uu, this.buttonIcon.vv, this.width, this.height); - } - } - - /** Checks to see if the x and y coords are intersecting with the button. */ - public boolean isIntersect(int x, int y) - { - return x >= this.xPosition && y >= this.yPosition && x < this.xPosition + this.width && y < this.yPosition + this.height; - } - - public static enum ButtonIcon - { - PERSON(0, 0), ARROW_LEFT(30, 0, 10, 10), ARROW_RIGHT(20, 0, 10, 10), - ARROW_DOWN(30, 20, 10, 10), ARROW_UP(20, 20, 10, 10), CHEST(60, 0), LOCKED(80, 0), - UNLOCKED(100, 0), BLANK(120, 0), RED_ON(140, 0), RED_OFF(160, 0), FURNACE_OFF(180, 0), - FURNACE_ON(200, 0); - - int vv, uu; - int sizeX = 20, sizeY = 20; - - private ButtonIcon(int xx, int yy) - { - this.vv = yy; - this.uu = xx; - } - - private ButtonIcon(int xx, int yy, int cx, int cy) - { - this(xx, yy); - this.sizeX = cx; - this.sizeY = cy; - } - } -} \ No newline at end of file diff --git a/archive/java/dark/lib/prefab/invgui/GuiMachineContainer.java b/archive/java/dark/lib/prefab/invgui/GuiMachineContainer.java deleted file mode 100644 index acab15da..00000000 --- a/archive/java/dark/lib/prefab/invgui/GuiMachineContainer.java +++ /dev/null @@ -1,209 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import resonantinduction.core.Reference; -import resonantinduction.core.prefab.tile.TileEntityMachine; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.prefab.invgui.GuiButtonImage.ButtonIcon; - -@SideOnly(Side.CLIENT) -public abstract class GuiMachineContainer extends GuiContainer -{ - protected static final int MAX_BUTTON_ID = 3; - protected TileEntityMachine tileEntity; - protected EntityPlayer entityPlayer; - protected Object mod; - protected int guiID = -1, guiID2 = -1, guiID3 = -1; - protected ButtonIcon guiIcon = ButtonIcon.CHEST, guiIcon2 = ButtonIcon.PERSON, - guiIcon3 = ButtonIcon.BLANK; - protected String invName = "Home", invName2 = "2", invName3 = "3"; - - public ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_grey.png"); - - protected int containerWidth; - protected int containerHeight; - - public GuiMachineContainer(Object mod, Container container, InventoryPlayer inventoryPlayer, TileEntityMachine tileEntity) - { - super(container); - this.tileEntity = tileEntity; - this.entityPlayer = inventoryPlayer.player; - this.ySize = 380 / 2; - this.mod = mod; - } - - @SuppressWarnings("unchecked") - @Override - public void initGui() - { - super.initGui(); - this.buttonList.clear(); - containerWidth = (this.width - this.xSize) / 2; - containerHeight = (this.height - this.ySize) / 2; - if (guiID != -1) - this.buttonList.add(new GuiButtonImage(0, containerWidth - 22, containerHeight + 0, guiIcon)); - if (guiID2 != -1) - this.buttonList.add(new GuiButtonImage(1, containerWidth - 22, containerHeight + 22, guiIcon2)); - if (guiID3 != -1) - this.buttonList.add(new GuiButtonImage(2, containerWidth - 22, containerHeight + 44, guiIcon3)); - - } - - @Override - protected void actionPerformed(GuiButton button) - { - super.actionPerformed(button); - switch (button.id) - { - case 0: - { - if (guiID != -1) - this.entityPlayer.openGui(mod, guiID, this.tileEntity.worldObj, this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord); - break; - } - case 1: - { - if (guiID2 != -1) - this.entityPlayer.openGui(mod, guiID2, this.tileEntity.worldObj, this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord); - break; - } - case 2: - { - if (guiID3 != -1) - this.entityPlayer.openGui(mod, guiID3, this.tileEntity.worldObj, this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord); - break; - } - } - } - - /** Draw the foreground layer for the GuiContainer (everything in front of the items) */ - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) - { - this.fontRenderer.drawString("\u00a77" + tileEntity.getInvName(), (int) (this.xSize / 2 - 7 * 2.5), 4, 4210752); - - /** Render Tool Tips */ - if (((GuiButtonImage) this.buttonList.get(0)).isIntersect(x, y)) - { - this.drawTooltip(x - this.guiLeft, y - this.guiTop + 10, invName); - } - else if (((GuiButtonImage) this.buttonList.get(1)).isIntersect(x, y)) - { - this.drawTooltip(x - this.guiLeft, y - this.guiTop + 10, invName2); - } - else if (((GuiButtonImage) this.buttonList.get(2)).isIntersect(x, y)) - { - this.drawTooltip(x - this.guiLeft, y - this.guiTop + 10, invName3); - } - } - - /** Draw the background layer for the GuiContainer (everything behind the items) */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int x, int y) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - int containerWidth = (this.width - this.xSize) / 2; - int containerHeight = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize); - } - - public void drawTooltip(int x, int y, String... toolTips) - { - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - - if (toolTips != null) - { - int var5 = 0; - int var6; - int var7; - - for (var6 = 0; var6 < toolTips.length; ++var6) - { - var7 = this.fontRenderer.getStringWidth(toolTips[var6]); - - if (var7 > var5) - { - var5 = var7; - } - } - - var6 = x + 12; - var7 = y - 12; - int var9 = 8; - - if (toolTips.length > 1) - { - var9 += 2 + (toolTips.length - 1) * 10; - } - - if (this.guiTop + var7 + var9 + 6 > this.height) - { - var7 = this.height - var9 - this.guiTop - 6; - } - - this.zLevel = 300.0F; - int var10 = -267386864; - this.drawGradientRect(var6 - 3, var7 - 4, var6 + var5 + 3, var7 - 3, var10, var10); - this.drawGradientRect(var6 - 3, var7 + var9 + 3, var6 + var5 + 3, var7 + var9 + 4, var10, var10); - this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 + var9 + 3, var10, var10); - this.drawGradientRect(var6 - 4, var7 - 3, var6 - 3, var7 + var9 + 3, var10, var10); - this.drawGradientRect(var6 + var5 + 3, var7 - 3, var6 + var5 + 4, var7 + var9 + 3, var10, var10); - int var11 = 1347420415; - int var12 = (var11 & 16711422) >> 1 | var11 & -16777216; - this.drawGradientRect(var6 - 3, var7 - 3 + 1, var6 - 3 + 1, var7 + var9 + 3 - 1, var11, var12); - this.drawGradientRect(var6 + var5 + 2, var7 - 3 + 1, var6 + var5 + 3, var7 + var9 + 3 - 1, var11, var12); - this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 - 3 + 1, var11, var11); - this.drawGradientRect(var6 - 3, var7 + var9 + 2, var6 + var5 + 3, var7 + var9 + 3, var12, var12); - - for (int var13 = 0; var13 < toolTips.length; ++var13) - { - String var14 = "\u00a77" + toolTips[var13]; - - this.fontRenderer.drawStringWithShadow(var14, var6, var7, -1); - - if (var13 == 0) - { - var7 += 2; - } - - var7 += 10; - } - - this.zLevel = 0.0F; - } - } - - public int getGuiTop() - { - return this.guiTop; - } - - public int getGuiLeft() - { - return this.guiLeft; - } - - public TileEntity getTile() - { - return this.tileEntity; - } -} diff --git a/archive/java/dark/lib/prefab/invgui/GuiMessageBox.java b/archive/java/dark/lib/prefab/invgui/GuiMessageBox.java deleted file mode 100644 index 3609bb11..00000000 --- a/archive/java/dark/lib/prefab/invgui/GuiMessageBox.java +++ /dev/null @@ -1,109 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.common.FMLCommonHandler; - -public class GuiMessageBox extends GuiBase -{ - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_message_box.png"); - - GuiBase returnGuiYes, returnGuiNo; - int id; - String title; - String message; - - public GuiMessageBox(GuiBase returnGui, int id, String title, String message) - { - this.guiSize.y = 380 / 2; - this.returnGuiYes = returnGui; - this.returnGuiNo = returnGui; - this.id = id; - this.title = title; - this.message = message; - } - - public GuiMessageBox(GuiBase returnGui, GuiBase returnGuiNo, int id, String title, String message) - { - this(returnGui, id, title, message); - this.returnGuiNo = returnGuiNo; - } - - @SuppressWarnings("unchecked") - @Override - public void initGui() - { - super.initGui(); - this.buttonList.clear(); - this.buttonList.add(new GuiButton(0, (this.width - this.guiSize.intX()) / 2 + 25, (this.height - this.guiSize.intY()) / 2 + 35, 50, 20, "Yes")); - - this.buttonList.add(new GuiButton(1, (this.width - this.guiSize.intX()) / 2 + 80, (this.height - this.guiSize.intY()) / 2 + 35, 50, 20, "no")); - - } - - @Override - public void onGuiClosed() - { - super.onGuiClosed(); - } - - @Override - protected void actionPerformed(GuiButton button) - { - super.actionPerformed(button); - switch (button.id) - { - case 0: - this.exit(true); - break; - case 1: - this.exit(false); - break; - } - } - - @Override - protected void drawForegroundLayer(int var2, int var3, float var1) - { - this.fontRenderer.drawString("" + this.title, (this.guiSize.intX() / 2 - 30), 5, 4210752); - this.fontRenderer.drawString("\u00a77" + this.message, ((this.guiSize.intX() / 2) - 50), 20, 4210752); - } - - @Override - protected void drawBackgroundLayer(int var2, int var3, float var1) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - int containerWidth = (this.width - this.guiSize.intX()) / 2; - int containerHeight = (this.height - this.guiSize.intY()) / 2; - this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.guiSize.intX(), this.guiSize.intY()); - } - - public void show() - { - FMLCommonHandler.instance().showGuiScreen(this); - } - - public void exit(boolean yes) - { - if (yes) - { - FMLCommonHandler.instance().showGuiScreen(this.returnGuiYes); - } - else - { - FMLCommonHandler.instance().showGuiScreen(this.returnGuiNo); - } - if (this.returnGuiYes instanceof IMessageBoxDialog) - { - ((IMessageBoxDialog) this.returnGuiYes).onMessageBoxClosed(this.id, yes); - } - } -} diff --git a/archive/java/dark/lib/prefab/invgui/IMessageBoxDialog.java b/archive/java/dark/lib/prefab/invgui/IMessageBoxDialog.java deleted file mode 100644 index ce328d44..00000000 --- a/archive/java/dark/lib/prefab/invgui/IMessageBoxDialog.java +++ /dev/null @@ -1,6 +0,0 @@ -package dark.lib.prefab.invgui; - -public interface IMessageBoxDialog -{ - public void onMessageBoxClosed(int id, boolean yes); -} diff --git a/archive/java/dark/lib/prefab/invgui/ISlotPickResult.java b/archive/java/dark/lib/prefab/invgui/ISlotPickResult.java deleted file mode 100644 index 58ba161e..00000000 --- a/archive/java/dark/lib/prefab/invgui/ISlotPickResult.java +++ /dev/null @@ -1,17 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** TileEntities that wish to do something if an item is removed from a slot */ -public interface ISlotPickResult -{ - /** - * If the slot in the gui does something if the item is removed - * - * @param entityPlayer - player who removed the item, will pass null from automation - * @param slot - slot in the container class the item came from - * @param itemStack - item stack pulled from the slot - */ - public void onPickUpFromSlot(EntityPlayer entityPlayer, int slot, ItemStack itemStack); -} diff --git a/archive/java/dark/lib/prefab/invgui/ISlotWatcher.java b/archive/java/dark/lib/prefab/invgui/ISlotWatcher.java deleted file mode 100644 index 3b4d0d56..00000000 --- a/archive/java/dark/lib/prefab/invgui/ISlotWatcher.java +++ /dev/null @@ -1,8 +0,0 @@ -package dark.lib.prefab.invgui; - -/** Add this to a container class if using WatchedSlot to trigger the container on slot change */ -public interface ISlotWatcher -{ - /** Will trigger if the watched slot has changed */ - public void slotContentsChanged(int slot); -} diff --git a/archive/java/dark/lib/prefab/invgui/InvChest.java b/archive/java/dark/lib/prefab/invgui/InvChest.java deleted file mode 100644 index d59de332..00000000 --- a/archive/java/dark/lib/prefab/invgui/InvChest.java +++ /dev/null @@ -1,256 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import dark.lib.interfaces.IExternalInv; -import dark.lib.interfaces.IInvBox; - -public class InvChest implements IInvBox -{ - /** Access able slots side all */ - protected int[] openSlots; - /** Items contained in this inv */ - protected ItemStack[] containedItems; - /** Host tileEntity */ - protected TileEntity hostTile; - /** Host tileEntity as external inv */ - protected IExternalInv inv; - /** Default slot max count */ - protected final int slots; - - public InvChest(TileEntity chest, IExternalInv inv, int slots) - { - this.hostTile = chest; - this.slots = slots; - this.inv = inv; - } - - public InvChest(TileEntity chest, int slots) - { - this(chest, ((IExternalInv) chest), slots); - } - - public InvChest(Entity entity, int i) - { - this.slots = i; - this.inv = (IExternalInv) entity; - } - - @Override - public int getSizeInventory() - { - return slots; - } - - @Override - public ItemStack getStackInSlot(int slot) - { - return this.getContainedItems()[slot]; - } - - @Override - public ItemStack decrStackSize(int slot, int ammount) - { - if (this.getContainedItems()[slot] != null) - { - ItemStack var3; - - if (this.getContainedItems()[slot].stackSize <= ammount) - { - var3 = this.getContainedItems()[slot]; - this.getContainedItems()[slot] = null; - this.onInventoryChanged(); - return var3; - } - else - { - var3 = this.getContainedItems()[slot].splitStack(ammount); - - if (this.getContainedItems()[slot].stackSize == 0) - { - this.getContainedItems()[slot] = null; - } - - this.onInventoryChanged(); - return var3; - } - } - else - { - return null; - } - } - - @Override - public ItemStack getStackInSlotOnClosing(int par1) - { - if (this.getContainedItems()[par1] != null) - { - ItemStack var2 = this.getContainedItems()[par1]; - this.getContainedItems()[par1] = null; - return var2; - } - else - { - return null; - } - } - - @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) - { - this.getContainedItems()[par1] = par2ItemStack; - - if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) - { - par2ItemStack.stackSize = this.getInventoryStackLimit(); - } - - this.onInventoryChanged(); - } - - @Override - public String getInvName() - { - return "container.chest"; - } - - @Override - public void openChest() - { - - } - - @Override - public void closeChest() - { - - } - - @Override - public boolean isInvNameLocalized() - { - return false; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) - { - if (i >= this.getSizeInventory()) - { - return false; - } - return true; - } - - @Override - public int[] getAccessibleSlotsFromSide(int var1) - { - if (openSlots == null || openSlots.length != this.getSizeInventory()) - { - this.openSlots = new int[this.getSizeInventory()]; - for (int i = 0; i < this.openSlots.length; i++) - { - openSlots[i] = i; - } - } - return this.openSlots; - } - - @Override - public boolean canInsertItem(int i, ItemStack itemstack, int j) - { - return this.isItemValidForSlot(i, itemstack) && this.inv.canStore(itemstack, i, ForgeDirection.getOrientation(j)); - } - - @Override - public boolean canExtractItem(int i, ItemStack itemstack, int j) - { - return this.inv.canRemove(itemstack, i, ForgeDirection.getOrientation(j)); - } - - @Override - public int getInventoryStackLimit() - { - return 64; - } - - @Override - public void onInventoryChanged() - { - if (this.hostTile != null) - { - this.hostTile.onInventoryChanged(); - } - } - - @Override - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) - { - if (this.hostTile != null) - { - return this.hostTile.worldObj.getBlockTileEntity(this.hostTile.xCoord, this.hostTile.yCoord, this.hostTile.zCoord) != this.hostTile ? false : par1EntityPlayer.getDistanceSq(this.hostTile.xCoord + 0.5D, this.hostTile.yCoord + 0.5D, this.hostTile.zCoord + 0.5D) <= 64.0D; - } - return true; - } - - @Override - public ItemStack[] getContainedItems() - { - if (this.containedItems == null) - { - this.containedItems = new ItemStack[this.getSizeInventory()]; - } - return this.containedItems; - } - - @Override - public NBTTagCompound saveInv(NBTTagCompound nbt) - { - NBTTagList itemList = new NBTTagList(); - for (int s = 0; s < this.getContainedItems().length; ++s) - { - if (this.getContainedItems()[s] != null) - { - NBTTagCompound tag = new NBTTagCompound(); - tag.setByte("Slot", (byte) s); - this.getContainedItems()[s].writeToNBT(tag); - itemList.appendTag(tag); - } - } - nbt.setTag("Items", itemList); - return nbt; - } - - @Override - public void loadInv(NBTTagCompound nbt) - { - // chest inv reading - NBTTagList itemList = nbt.getTagList("Items"); - - for (int s = 0; s < itemList.tagCount(); ++s) - { - NBTTagCompound tag = (NBTTagCompound) itemList.tagAt(s); - int slotID = tag.getByte("Slot") & 255; - - if (slotID >= 0 && slotID < this.getContainedItems().length) - { - this.getContainedItems()[slotID] = ItemStack.loadItemStackFromNBT(tag); - } - } - - } - - @Override - public void clear() - { - this.containedItems = null; - this.getContainedItems(); - } - -} diff --git a/archive/java/dark/lib/prefab/invgui/SlotCraftingResult.java b/archive/java/dark/lib/prefab/invgui/SlotCraftingResult.java deleted file mode 100644 index c9a7eb7a..00000000 --- a/archive/java/dark/lib/prefab/invgui/SlotCraftingResult.java +++ /dev/null @@ -1,37 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -/** Easy class to create a slot that is used for an event trigger or crafting based event */ -public class SlotCraftingResult extends WatchedSlot -{ - private ISlotPickResult tile; - - public SlotCraftingResult(ISlotPickResult tile, ISlotWatcher container, IInventory inventory, int par2, int par3, int par4) - { - super(inventory, par2, par3, par4, container); - this.tile = tile; - } - - @Override - public boolean isItemValid(ItemStack itemStack) - { - return false; - } - - @Override - public boolean canTakeStack(EntityPlayer player) - { - return true; - } - - /** When the slot has changed it calls @ISlotPickResult 's method */ - @Override - public void onPickupFromSlot(EntityPlayer entityPlayer, ItemStack itemStack) - { - this.tile.onPickUpFromSlot(entityPlayer, this.slotNumber, itemStack); - super.onPickupFromSlot(entityPlayer, itemStack); - } -} diff --git a/archive/java/dark/lib/prefab/invgui/SlotEnergyItem.java b/archive/java/dark/lib/prefab/invgui/SlotEnergyItem.java deleted file mode 100644 index a72b7a71..00000000 --- a/archive/java/dark/lib/prefab/invgui/SlotEnergyItem.java +++ /dev/null @@ -1,26 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import universalelectricity.api.CompatibilityModule; - -/** - * Slot designed to only allow batery like items - * - * @author DarkGuardsman - */ -public class SlotEnergyItem extends Slot -{ - - public SlotEnergyItem(IInventory inventory, int slotID, int xPos, int yPos) - { - super(inventory, slotID, xPos, yPos); - } - - @Override - public boolean isItemValid(ItemStack compareStack) - { - return compareStack != null && CompatibilityModule.isHandler(compareStack.getItem()); - } -} diff --git a/archive/java/dark/lib/prefab/invgui/SlotSpecific.java b/archive/java/dark/lib/prefab/invgui/SlotSpecific.java deleted file mode 100644 index 9c76cdd2..00000000 --- a/archive/java/dark/lib/prefab/invgui/SlotSpecific.java +++ /dev/null @@ -1,92 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -/** - * Creates a slot with a specific amount of items that matches the slot's requirements. Allows easy - * shift right clicking management and slot blocking in classes. In your container you can use - * this.getSlot(i).isItemValid to justify the player's shift clicking actions to match the slot. - * - * @author Calclavia - */ -public class SlotSpecific extends Slot -{ - public ItemStack[] validItemStacks = new ItemStack[0]; - public Class[] validClasses = new Class[0]; - - public boolean isInverted = false; - public boolean isMetadataSensitive = false; - - public SlotSpecific(IInventory inventory, int slotID, int xPos, int yPos, ItemStack... itemStacks) - { - super(inventory, slotID, xPos, yPos); - this.setItemStacks(itemStacks); - } - - public SlotSpecific(IInventory inventory, int slotID, int xPos, int yPos, Class... validClasses) - { - super(inventory, slotID, xPos, yPos); - this.setClasses(validClasses); - } - - public SlotSpecific setMetadataSensitive() - { - this.isMetadataSensitive = true; - return this; - } - - public SlotSpecific setItemStacks(ItemStack... validItemStacks) - { - this.validItemStacks = validItemStacks; - return this; - } - - public SlotSpecific setClasses(Class... validClasses) - { - this.validClasses = validClasses; - return this; - } - - public SlotSpecific toggleInverted() - { - this.isInverted = !this.isInverted; - return this; - } - - /** Check if the stack is a valid item for this slot. Always true beside for the armor slots. */ - @Override - public boolean isItemValid(ItemStack compareStack) - { - boolean returnValue = false; - - for (ItemStack itemStack : this.validItemStacks) - { - if (compareStack.isItemEqual(itemStack) || (!this.isMetadataSensitive && compareStack.itemID == itemStack.itemID)) - { - returnValue = true; - break; - } - } - - if (!returnValue) - { - for (Class clazz : this.validClasses) - { - if (clazz.equals(compareStack.getItem().getClass()) || clazz.isInstance(compareStack.getItem())) - { - returnValue = true; - break; - } - } - } - - if (this.isInverted) - { - return !returnValue; - } - - return returnValue; - } -} diff --git a/archive/java/dark/lib/prefab/invgui/WatchedSlot.java b/archive/java/dark/lib/prefab/invgui/WatchedSlot.java deleted file mode 100644 index 0a847a77..00000000 --- a/archive/java/dark/lib/prefab/invgui/WatchedSlot.java +++ /dev/null @@ -1,26 +0,0 @@ -package dark.lib.prefab.invgui; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; - -/** A slot that triggers the container class if changed */ -public class WatchedSlot extends Slot -{ - private ISlotWatcher slotWatcher; - - public WatchedSlot(IInventory inventory, int id, int xPosition, int yPosition, ISlotWatcher slotWatcher) - { - super(inventory, id, xPosition, yPosition); - this.slotWatcher = slotWatcher; - } - - @Override - public void onSlotChanged() - { - if (this.slotWatcher != null) - { - this.slotWatcher.slotContentsChanged(this.slotNumber); - } - } - -} diff --git a/archive/java/dark/lib/recipes/MachineRecipeHandler.java b/archive/java/dark/lib/recipes/MachineRecipeHandler.java deleted file mode 100644 index ca625ced..00000000 --- a/archive/java/dark/lib/recipes/MachineRecipeHandler.java +++ /dev/null @@ -1,313 +0,0 @@ -package dark.lib.recipes; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemTool; -import resonantinduction.old.api.IProcessable; -import calclavia.lib.utility.AutoCraftingManager; - -import com.builtbroken.common.Pair; - -/** - * Recipes for ore processor machines - * - * @author DarkGuardsman - */ -public class MachineRecipeHandler -{ - private static Random random = new Random(); - - static - { - newProcessorRecipe(ProcessorType.CRUSHER, Block.stone, Block.cobblestone); - newProcessorRecipe(ProcessorType.CRUSHER, Block.oreDiamond, Item.diamond); - newProcessorRecipe(ProcessorType.CRUSHER, Block.oreLapis, new ItemStack(Item.dyePowder.itemID, 4, 4)); - newProcessorRecipe(ProcessorType.CRUSHER, Block.oreRedstone, new ItemStack(Item.redstone.itemID, 4, 0)); - newProcessorRecipe(ProcessorType.CRUSHER, Block.oreEmerald, new ItemStack(Item.redstone.itemID, 4, 0)); - - newProcessorRecipe(ProcessorType.GRINDER, new ItemStack(Block.cobblestone.blockID, 1, 0), new ItemStack(Block.sand.blockID, 1, 0)); - newProcessorRecipe(ProcessorType.GRINDER, Block.glass, Block.sand); - - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.GRINDER, Block.stone, Block.cobblestone); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.GRINDER, Block.cobblestoneMossy, Block.cobblestone); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.GRINDER, Block.glass, Block.sand); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, Item.stick, null); - - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, Block.stone, Block.cobblestone); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, Block.cobblestoneMossy, Block.cobblestone); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, Item.stick, null); - - // TODO replace these with ItemOreDirv glass shards - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, Block.glass, Block.sand); - } - - /** - * Creates a new recipe for the type of processor machine - * - * @param type - machine type - * @param in - input item, stacksize is ignored - * @param out - output item - */ - public static void newProcessorRecipe(ProcessorType type, Object in, Object out) - { - newProcessorRecipe(type, in, out, -1, -1); - } - - /** - * Creates a new recipe for the type of processor machine - * - * @param type - machine type - * @param in - input item, stacksize is ignored - * @param out - output item - * @param min - min stacksize to return as output - * @param max- max stacksize to return as output - */ - public static void newProcessorRecipe(ProcessorType type, Object in, Object out, int min, int max) - { - newProcessorRecipe(type, in, out, min, max, false); - } - - /** - * Creates a new recipe for the type of processor machine - * - * @param type - machine type - * @param in - input item, stacksize is ignored - * @param out - output item - * @param min - min stacksize to return as output - * @param max- max stacksize to return as output - * @param ignoreNBT - only use this if your item's nbt doesn't play a factor in what items were - * used to craft it - */ - public static void newProcessorRecipe(ProcessorType type, Object in, Object out, int min, int max, boolean ignoreNBT) - { - if (in != null && out != null && type != null) - { - ItemStack input = convertToItemStack(in); - ItemStack output = convertToItemStack(out); - if (input != null && output != null && type.recipes != null) - { - if (!ignoreNBT && (input.getTagCompound() != null || input.isItemEnchanted())) - { - System.out.println("[MachineRecipeHandler]Error: NBT or Enchanted Items must use the IProccesable interface to properlly handle recipe outputs."); - System.out.println("[MachineRecipeHandler]Item>> Data: " + input.toString() + " Name: " + input.getItem().getUnlocalizedName()); - return; - } - if (min == -1) - { - min = output.stackSize; - } - if (max == -1 || max < min) - { - max = output.stackSize; - } - type.recipes.put(new Pair(input.itemID, input.getItemDamage()), new ProcessorRecipe(output, min, max)); - } - } - } - - /** Used to track items that should be converted to different items during salvaging. */ - public static void newAltProcessorOutput(ProcessorType type, Object in, Object out) - { - if (in != null && out != null && type != null) - { - ItemStack input = convertToItemStack(in); - ItemStack output = convertToItemStack(out); - if (input != null && output != null && type.altOutput != null) - { - type.altOutput.put(new Pair(input.itemID, input.getItemDamage()), output); - } - } - } - - /** Marks an itemstack as unsalvagable by all processors */ - public static void banProcessingOfItem(ItemStack stack) - { - if (stack != null) - { - for (ProcessorType type : ProcessorType.values()) - { - banProcessingOfItem(type, stack); - } - } - } - - /** - * Marks an itemstack as unusable by processors. This will jam the processor if the item enters - * it - */ - public static void banProcessingOfItem(ProcessorType type, ItemStack stack) - { - if (type != null && stack != null) - { - type.banList.add(new Pair(stack.itemID, stack.getItemDamage())); - } - } - - /** Converts an object input into an itemstack for use */ - private static ItemStack convertToItemStack(Object object) - { - if (object instanceof ItemStack) - { - ItemStack stack = (ItemStack) object; - if (stack.getItemDamage() < 0) - { - stack.setItemDamage(0); - } - return stack; - } - if (object instanceof Block) - { - return new ItemStack(((Block) object).blockID, 1, -1); - } - if (object instanceof Item) - { - return new ItemStack(((Item) object).itemID, 1, -1); - } - return null; - } - - /** - * Gets the lit of items that are created from the input item stack. General this will be an - * array of one item. However, in salavaging cases it can be up to 8 items. - * - * @param type - Processor type - * @param inputStack - item stack input ignores stacksize - * @return array of itemStacks - */ - public static ItemStack[] getProcessorOutput(ProcessorType type, ItemStack inputStack) - { - if (inputStack != null && type != null) - { - ItemStack[] reList = null; - if (inputStack.getItem() instanceof IProcessable) - { - if (!((IProcessable) inputStack.getItem()).canProcess(type, inputStack)) - { - return null; - } - reList = ((IProcessable) inputStack.getItem()).getProcesserOutput(type, inputStack); - } - if (reList == null) - { - reList = getOuputNormal(type, inputStack); - } - if (reList == null) - { - // TODO Disabled due to bug and needs to be fixed to make the processors more - // functional - // reList = salvageItem(type, inputStack); - } - return reList; - } - return null; - } - - /** - * Salvages an itemStack for the items used to craft it - * - * @param type - processor type used to determine damage results - * @param stack - itemStack being salvaged - * @return Array of all items salvaged - */ - public static ItemStack[] salvageItem(ProcessorType type, ItemStack stack) - { - return salvageItem(type, stack, true); - } - - /** - * Salvages an itemStack for the items used to craft it - * - * @param type - processor type used to determine damage results - * @param stack - itemStack being salvaged - * @param damage - damage the output items. Eg ironIngot becomes ironDust, or ironScraps - * @return Array of all items salvaged - */ - public static ItemStack[] salvageItem(ProcessorType type, ItemStack stack, boolean damage) - { - float bar = 0.1f; - // Allow tools and armor to be salvaged but at a very low rate - if ((stack.getItem() instanceof ItemArmor || stack.getItem() instanceof ItemTool) && stack.isItemDamaged()) - { - bar = (stack.getItemDamage() / stack.getMaxDamage()); - } - ItemStack[] reList = salvageItem(stack, bar); - if (damage && reList != null && type.altOutput != null) - { - for (int i = 0; i < reList.length; i++) - { - if (type.altOutput.containsKey(new Pair(reList[i].itemID, reList[i].getItemDamage()))) - { - reList[i] = convertToItemStack(type.altOutput.get(new Pair(reList[i].itemID, reList[i].getItemDamage()))); - } - } - } - return reList; - } - - /** - * Salvages an itemStack for the items used to craft it - * - * @param stack - itemStack being salvaged - * @param bar - chance per item that the random must be above inorder to salvage the output - * @return Array of all items salvaged - */ - public static ItemStack[] salvageItem(ItemStack stack, float bar) - { - // TODO find a way around having to force recipe to be the same stack size of the salvage. - // Maybe percentage based salvaging or min stacksize from machine? - ItemStack[] recipeList = AutoCraftingManager.getReverseRecipe(stack.copy(), stack.stackSize); - if (recipeList != null) - { - ItemStack[] reList = new ItemStack[recipeList.length]; - boolean items = false; - for (int i = 0; i < recipeList.length; i++) - { - if (random.nextFloat() >= bar) - { - reList[i] = recipeList[i].copy(); - items = true; - if (recipeList[i].itemID < Block.blocksList.length && Block.blocksList[recipeList[i].itemID] != null && recipeList[i].getItemDamage() > 16) - { - reList[i].setItemDamage(0); - } - - } - } - return items ? reList : null; - } - return null; - } - - public static ItemStack[] getOuputNormal(ProcessorType type, ItemStack stack) - { - if (type.recipes != null) - { - ProcessorRecipe re = type.recipes.get(new Pair(stack.itemID, -1)); - if (re == null || re.output == null) - { - re = type.recipes.get(new Pair(stack.itemID, stack.getItemDamage())); - } - if (type.altOutput != null && (re == null || re.output == null)) - { - return new ItemStack[] { type.altOutput.get(new Pair(stack.itemID, stack.getItemDamage())) }; - } - if (re != null && re.output != null) - { - ItemStack output = re.output.copy(); - output.stackSize = Math.min(re.maxItemsOut, re.minItemsOut + random.nextInt(re.minItemsOut)); - if (re.chancePerItem < 1.0f) - { - - } - return new ItemStack[] { output }; - } - } - - return null; - } - -} diff --git a/archive/java/dark/lib/recipes/ProcessorRecipe.java b/archive/java/dark/lib/recipes/ProcessorRecipe.java deleted file mode 100644 index 6c5fc537..00000000 --- a/archive/java/dark/lib/recipes/ProcessorRecipe.java +++ /dev/null @@ -1,23 +0,0 @@ -package dark.lib.recipes; - -import net.minecraft.item.ItemStack; - -/** Processor Recipe output Container. Input is controlled by the processor recipes class. */ -public class ProcessorRecipe -{ - /** Output of the recipe */ - public ItemStack output; - /** Chance per item after the stack size has been calculated from min and max size */ - public float chancePerItem = 1.0f; - /** Min the recipe can output */ - public int minItemsOut = -1; - /** Max the recipe can output */ - public int maxItemsOut = -1; - - public ProcessorRecipe(ItemStack output, int min, int max) - { - this.output = output; - this.minItemsOut = min; - this.maxItemsOut = max; - } -} diff --git a/archive/java/dark/lib/recipes/ProcessorType.java b/archive/java/dark/lib/recipes/ProcessorType.java deleted file mode 100644 index 07cb4455..00000000 --- a/archive/java/dark/lib/recipes/ProcessorType.java +++ /dev/null @@ -1,30 +0,0 @@ -package dark.lib.recipes; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import net.minecraft.item.ItemStack; - -import com.builtbroken.common.Pair; - -/** - * Enum of machines that support a simple A -> B processor recipe format. More complex machine will - * have there own recipe handlers - * - * @author Darkguardsman - */ -public enum ProcessorType -{ - /** Pistons that smash the object */ - CRUSHER(), - /** Several disks that shred the item up */ - GRINDER(), - /** Grinds the edge or surface of the item sharpening it */ - SHARPENING_STONE(), - /** Breaks down an item carefully giving an almost complete output of item used to craft it */ - SALVAGER(); - public HashMap, ProcessorRecipe> recipes = new HashMap(); - public HashMap, ItemStack> altOutput = new HashMap(); - public List> banList = new ArrayList(); -} diff --git a/archive/java/resonantinduction/api/events/AutoCraftEvent.java b/archive/java/resonantinduction/api/events/AutoCraftEvent.java deleted file mode 100644 index dc3f95ca..00000000 --- a/archive/java/resonantinduction/api/events/AutoCraftEvent.java +++ /dev/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.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); - } - } - -} diff --git a/archive/java/resonantinduction/api/events/LaserEvent.java b/archive/java/resonantinduction/api/events/LaserEvent.java deleted file mode 100644 index a73607a5..00000000 --- a/archive/java/resonantinduction/api/events/LaserEvent.java +++ /dev/null @@ -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.HelperMethods; - -/** - * 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 items; - - public LaserDropItemEvent(World world, Vector3 spot, Vector3 hit, List 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.getBlockID(world); - Block block = Block.blocksList[id]; - - Vector3 faceVec = vec.clone().modifyPositionFromSide(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().modifyPositionFromSide(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 items = block.getBlockDropped(world, vec.intX(), vec.intY(), vec.intZ(), meta, 1); - if (items == null) - { - items = new ArrayList(); - } - // 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 removeList = new ArrayList(); - 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) - { - HelperMethods.dropItemStack(world, vec.translate(0.5), stack, false); - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - world.setBlockToAir(vec.intX(), vec.intY(), vec.intZ()); - } - } -} diff --git a/archive/java/resonantinduction/api/events/MachineEvent.java b/archive/java/resonantinduction/api/events/MachineEvent.java deleted file mode 100644 index 76e8eaf1..00000000 --- a/archive/java/resonantinduction/api/events/MachineEvent.java +++ /dev/null @@ -1,30 +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; - } -} diff --git a/archive/java/resonantinduction/api/events/MachineMiningEvent.java b/archive/java/resonantinduction/api/events/MachineMiningEvent.java deleted file mode 100644 index 6c78a9cd..00000000 --- a/archive/java/resonantinduction/api/events/MachineMiningEvent.java +++ /dev/null @@ -1,83 +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 items; - - public MiningDrop(World world, Vector3 spot, Vector3 target, List 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 getItemsMined(World world, Vector3 spot, Vector3 target) - { - Block block = Block.blocksList[target.getBlockID(world)]; - if (block != null) - { - List 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 getItemsMined(TileEntity entity, Vector3 target) - { - return getItemsMined(entity.worldObj, new Vector3(entity), target); - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/api/recipe/MachineRecipes.java b/archive/java/resonantinduction/api/recipe/MachineRecipes.java deleted file mode 100644 index f490f4ed..00000000 --- a/archive/java/resonantinduction/api/recipe/MachineRecipes.java +++ /dev/null @@ -1,103 +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.item.ItemStack; -import resonantinduction.api.recipe.RecipeUtils.ItemStackResource; -import resonantinduction.api.recipe.RecipeUtils.OreDictResource; -import resonantinduction.api.recipe.RecipeUtils.Resource; - -public final class MachineRecipes -{ - public static enum RecipeType - { - GRINDER, SAWMILL, SMELTER; - } - - private final Map> recipes = new HashMap>(); - - public static final MachineRecipes INSTANCE = new MachineRecipes(); - - private MachineRecipes() - { - for (RecipeType machine : RecipeType.values()) - { - this.recipes.put(machine, new HashMap()); - } - } - - public void addRecipe(RecipeType machine, Resource[] input, Resource[] output) - { - this.recipes.get(machine).put(input, output); - } - - public void addRecipe(RecipeType machine, ItemStack input, ItemStack output) - { - this.addRecipe(machine, new ItemStackResource[] { new ItemStackResource(input) }, new ItemStackResource[] { new ItemStackResource(output) }); - } - - public void addRecipe(RecipeType machine, String input, ItemStack output) - { - this.addRecipe(machine, new OreDictResource[] { new OreDictResource(input) }, new ItemStackResource[] { new ItemStackResource(output) }); - } - - public void removeRecipe(RecipeType machine, Resource[] input) - { - this.recipes.get(machine).remove(input); - } - - public Map getRecipes(RecipeType machine) - { - return new HashMap(this.recipes.get(machine)); - } - - public Map> getRecipes() - { - return new HashMap>(this.recipes); - } - - public Resource[] getOutput(RecipeType machine, Resource[] input) - { - Iterator> it = this.getRecipes(machine).entrySet().iterator(); - - while (it.hasNext()) - { - Entry entry = it.next(); - - if (Arrays.equals(entry.getKey(), input)) - { - return entry.getValue(); - } - } - - return new Resource[] {}; - } - - public Resource[] getRecipe(RecipeType machine, ItemStack... inputs) - { - Resource[] resourceInputs = new Resource[inputs.length]; - - for (int i = 0; i < inputs.length; i++) - { - resourceInputs[i] = new ItemStackResource(inputs[i]); - } - - return this.getOutput(machine, resourceInputs); - } - - public Resource[] getRecipe(RecipeType machine, String... oreDictNames) - { - Resource[] resourceInputs = new Resource[oreDictNames.length]; - - for (int i = 0; i < oreDictNames.length; i++) - { - resourceInputs[i] = new OreDictResource(oreDictNames[i]); - } - - return this.getOutput(machine, resourceInputs); - } -} diff --git a/archive/java/resonantinduction/api/recipe/OreDetectionBlackList.java b/archive/java/resonantinduction/api/recipe/OreDetectionBlackList.java deleted file mode 100644 index beffc574..00000000 --- a/archive/java/resonantinduction/api/recipe/OreDetectionBlackList.java +++ /dev/null @@ -1,30 +0,0 @@ -package resonantinduction.api.recipe; - -import java.util.LinkedHashSet; -import java.util.Set; - -public class OreDetectionBlackList -{ - private static final Set oreBlackList = new LinkedHashSet(); - private static final Set ingotBlackList = new LinkedHashSet(); - - 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); - } -} diff --git a/archive/java/resonantinduction/api/recipe/RecipeUtils.java b/archive/java/resonantinduction/api/recipe/RecipeUtils.java deleted file mode 100644 index 59b3a5fb..00000000 --- a/archive/java/resonantinduction/api/recipe/RecipeUtils.java +++ /dev/null @@ -1,120 +0,0 @@ -package resonantinduction.api.recipe; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; - -public class RecipeUtils -{ - public static abstract class Resource - { - public final boolean hasChance; - public final float chance; - - protected Resource() - { - this.hasChance = false; - this.chance = 100; - } - - protected Resource(float chance) - { - this.hasChance = true; - this.chance = chance; - } - - public boolean hasChance() - { - return this.hasChance; - } - - public float getChance() - { - return this.chance; - } - } - - public static class ItemStackResource extends Resource - { - 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); - } - - return false; - } - } - - public static class OreDictResource extends Resource - { - public final String name; - - public OreDictResource(String s) - { - super(); - this.name = s; - } - - public OreDictResource(String s, float chance) - { - super(chance); - this.name = s; - } - - @Override - public boolean equals(Object obj) - { - if (obj instanceof OreDictResource) - { - return this.name.equals(((OreDictResource) obj).name); - } - - if (obj instanceof ItemStackResource) - { - return this.name.equals(OreDictionary.getOreName(OreDictionary.getOreID(((ItemStackResource) obj).itemStack))); - } - - return false; - } - } - - public static class FluidStackResource extends Resource - { - 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) - { - return (obj instanceof FluidStack) ? ((FluidStack) obj).equals(obj) : false; - } - } -} diff --git a/archive/java/resonantinduction/archaic/Archaic.java b/archive/java/resonantinduction/archaic/Archaic.java deleted file mode 100644 index dc53a0b6..00000000 --- a/archive/java/resonantinduction/archaic/Archaic.java +++ /dev/null @@ -1,51 +0,0 @@ -package resonantinduction.archaic; - -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInduction; -import resonantinduction.core.Settings; -import calclavia.lib.network.PacketHandler; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.ModMetadata; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkMod; -import cpw.mods.fml.common.network.NetworkRegistry; - -/** - * Resonant Induction Archaic Module - * - * @author DarkCow, Calclavia - * - */ -@Mod(modid = Archaic.ID, name = Archaic.NAME, version = Reference.VERSION, dependencies = "required-after:" + ResonantInduction.ID) -@NetworkMod(channels = Reference.CHANNEL, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) -public class Archaic -{ - /** Mod Information */ - public static final String ID = "ResonantInduction|Archaic"; - public static final String NAME = Reference.NAME + " Archaic"; - - @Instance(ID) - public static Archaic INSTANCE; - - @SidedProxy(clientSide = "resonantinduction.archaic.ClientProxy", serverSide = "resonantinduction.archaic.CommonProxy") - public static CommonProxy proxy; - - @Mod.Metadata(ID) - public static ModMetadata metadata; - - @EventHandler - public void preInit(FMLPreInitializationEvent evt) - { - NetworkRegistry.instance().registerGuiHandler(this, proxy); - } - - @EventHandler - public void init(FMLInitializationEvent evt) - { - Settings.setModMetadata(metadata, ID, NAME); - } -} diff --git a/archive/java/resonantinduction/archaic/ClientProxy.java b/archive/java/resonantinduction/archaic/ClientProxy.java deleted file mode 100644 index dbef319a..00000000 --- a/archive/java/resonantinduction/archaic/ClientProxy.java +++ /dev/null @@ -1,6 +0,0 @@ -package resonantinduction.archaic; - -public class ClientProxy extends CommonProxy -{ - -} diff --git a/archive/java/resonantinduction/archaic/CommonProxy.java b/archive/java/resonantinduction/archaic/CommonProxy.java deleted file mode 100644 index 4fb24c27..00000000 --- a/archive/java/resonantinduction/archaic/CommonProxy.java +++ /dev/null @@ -1,8 +0,0 @@ -package resonantinduction.archaic; - -import resonantinduction.core.prefab.ProxyBase; - -public class CommonProxy extends ProxyBase -{ - -} diff --git a/archive/java/resonantinduction/archaic/blocks/BlockColorGlass.java b/archive/java/resonantinduction/archaic/blocks/BlockColorGlass.java deleted file mode 100644 index 395e8e42..00000000 --- a/archive/java/resonantinduction/archaic/blocks/BlockColorGlass.java +++ /dev/null @@ -1,59 +0,0 @@ -package resonantinduction.archaic.blocks; - -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import resonantinduction.core.Settings; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockColorGlass extends BlockColored -{ - - public BlockColorGlass(String name) - { - super(name, Settings.CONFIGURATION.getBlock(name, Settings.getNextBlockID()).getInt(), Material.glass); - this.setCreativeTab(CreativeTabs.tabDecorations); - this.setHardness(.5f); - this.setResistance(.5f); - this.setStepSound(soundGlassFootstep); - } - - public BlockColorGlass() - { - this("StainedGlass"); - } - - @Override - public int quantityDropped(Random par1Random) - { - return 0; - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderBlockPass() - { - return 1; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - protected boolean canSilkHarvest() - { - return true; - } -} diff --git a/archive/java/resonantinduction/archaic/blocks/BlockColorGlowGlass.java b/archive/java/resonantinduction/archaic/blocks/BlockColorGlowGlass.java deleted file mode 100644 index 806310b6..00000000 --- a/archive/java/resonantinduction/archaic/blocks/BlockColorGlowGlass.java +++ /dev/null @@ -1,13 +0,0 @@ -package resonantinduction.archaic.blocks; - -public class BlockColorGlowGlass extends BlockColorGlass -{ - - public BlockColorGlowGlass() - { - super("GlowGlass"); - this.setLightOpacity(2); - this.setLightValue(1); - } - -} diff --git a/archive/java/resonantinduction/archaic/blocks/BlockColorSand.java b/archive/java/resonantinduction/archaic/blocks/BlockColorSand.java deleted file mode 100644 index b1d567fd..00000000 --- a/archive/java/resonantinduction/archaic/blocks/BlockColorSand.java +++ /dev/null @@ -1,100 +0,0 @@ -package resonantinduction.archaic.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.world.World; -import resonantinduction.core.Settings; - -//TODO fix instant falling sand -public class BlockColorSand extends BlockColored -{ - public BlockColorSand() - { - super("colorSand", Settings.CONFIGURATION.getBlock("colorSand", Settings.getNextBlockID()).getInt(), Material.sand); - this.setCreativeTab(CreativeTabs.tabDecorations); - this.setHardness(1f); - this.setResistance(.5f); - } - - public static boolean fallInstantly = true; - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) - { - par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate()); - } - - @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) - { - par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate()); - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) - { - if (!par1World.isRemote) - { - this.tryToFall(par1World, par2, par3, par4); - } - } - - private void tryToFall(World par1World, int par2, int par3, int par4) - { - int meta = par1World.getBlockMetadata(par2, par3, par4); - if (canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0) - { - byte var8 = 32; - - if (!fallInstantly && par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) - { - if (!par1World.isRemote) - { - return; - } - } - else - { - par1World.setBlock(par2, par3, par4, 0); - - while (canFallBelow(par1World, par2, par3 - 1, par4) && par3 > 0) - { - --par3; - } - - if (par3 > 0) - { - par1World.setBlock(par2, par3, par4, this.blockID, meta, 3); - } - } - } - } - - public int tickRate() - { - return 3; - } - - public static boolean canFallBelow(World par0World, int par1, int par2, int par3) - { - int var4 = par0World.getBlockId(par1, par2, par3); - - if (var4 == 0) - { - return true; - } - else if (var4 == Block.fire.blockID) - { - return true; - } - else - { - Material var5 = Block.blocksList[var4].blockMaterial; - return var5 == Material.water ? true : var5 == Material.lava; - } - } - -} diff --git a/archive/java/resonantinduction/archaic/blocks/BlockColored.java b/archive/java/resonantinduction/archaic/blocks/BlockColored.java deleted file mode 100644 index 8366a654..00000000 --- a/archive/java/resonantinduction/archaic/blocks/BlockColored.java +++ /dev/null @@ -1,100 +0,0 @@ -package resonantinduction.archaic.blocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import resonantinduction.core.Reference; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.helpers.ColorCode; - -/** - * Prefab class to make any block have 16 separate color instances similar to wool block - * - * @author DarkGuardsman - */ -public class BlockColored extends Block -{ - @SideOnly(Side.CLIENT) - private Icon[] icons; - - /** Use a single icon to create all 16 colors */ - boolean colorized = true; - - public BlockColored(String name, int id, Material par2Material) - { - super(id, par2Material); - this.setUnlocalizedName(name); - } - - @SideOnly(Side.CLIENT) - @Override - public Icon getIcon(int side, int meta) - { - if (colorized) - { - return this.blockIcon; - } - return this.icons[~meta & 15]; - } - - @Override - public int damageDropped(int meta) - { - return meta; - } - - @SideOnly(Side.CLIENT) - @Override - public void getSubBlocks(int par1, CreativeTabs tab, List contentList) - { - for (int j = 0; j < 16; ++j) - { - contentList.add(new ItemStack(par1, 1, j)); - } - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister iconReg) - { - if (colorized) - { - this.blockIcon = iconReg.registerIcon(Reference.PREFIX + this.getUnlocalizedName().replace("tile.", "")); - } - else - { - this.icons = new Icon[16]; - - for (int i = 0; i < this.icons.length; ++i) - { - this.icons[i] = iconReg.registerIcon(Reference.PREFIX + ColorCode.get(~i & 15).name + this.getUnlocalizedName().replace("tile.", "")); - } - } - } - - @SideOnly(Side.CLIENT) - @Override - public int colorMultiplier(IBlockAccess world, int x, int y, int z) - { - return this.getRenderColor(world.getBlockMetadata(x, y, z)); - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderColor(int meta) - { - if (this.colorized) - { - return ColorCode.get(~meta & 15).color.getRGB(); - } - return super.getRenderColor(meta); - } - -} diff --git a/archive/java/resonantinduction/archaic/blocks/BlockTurntable.java b/archive/java/resonantinduction/archaic/blocks/BlockTurntable.java deleted file mode 100644 index f38695c0..00000000 --- a/archive/java/resonantinduction/archaic/blocks/BlockTurntable.java +++ /dev/null @@ -1,260 +0,0 @@ -package resonantinduction.archaic.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.transport.ResonantInductionTransport; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.prefab.tile.IRotatable; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.interfaces.IRotatableBlock; - -public class BlockTurntable extends BlockMachine -{ - private Icon top; - - public BlockTurntable() - { - super("turntable", Material.piston); - this.setTickRandomly(true); - } - - @Override - public int tickRate(World par1World) - { - return 5; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconReg) - { - super.registerIcons(iconReg); - this.top = iconReg.registerIcon(ResonantInductionTransport.PREFIX + "turntable"); - } - - @Override - public void updateTick(World world, int x, int y, int z, Random par5Random) - { - this.updateTurntableState(world, x, y, z); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int meta) - { - if (side == meta) - { - return this.top; - } - return this.blockIcon; - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack) - { - int angle = MathHelper.floor_double((entityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - int change = 3; - - switch (angle) - { - case 0: - change = 2; - break; - - case 1: - change = 5; - break; - - case 2: - change = 3; - break; - - case 3: - change = 4; - break; - } - - world.setBlockMetadataWithNotify(x, y, z, change, 3); - world.scheduleBlockUpdate(x, y, z, this.blockID, 20); - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, int side) - { - world.scheduleBlockUpdate(x, y, z, this.blockID, 20); - } - - private void updateTurntableState(World world, int x, int y, int z) - { - if (world.isBlockIndirectlyGettingPowered(x, y, z)) - { - try - { - ForgeDirection direction = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z)); - ForgeDirection blockRotation = null; - - Vector3 position = new Vector3(x, y, z).modifyPositionFromSide(direction); - TileEntity tileEntity = position.getTileEntity(world); - int blockID = position.getBlockID(world); - - if (tileEntity instanceof IRotatable) - { - blockRotation = ((IRotatable) tileEntity).getDirection(); - } - else if (Block.blocksList[blockID] instanceof IRotatableBlock) - { - blockRotation = ((IRotatableBlock) Block.blocksList[blockID]).getDirection(world, position.intX(), position.intY(), position.intZ()); - } - else if (Block.blocksList[blockID] != null) - { - Block.blocksList[blockID].rotateBlock(world, position.intX(), position.intY(), position.intZ(), direction.getOpposite()); - } - if (direction != null) - { - if (direction == ForgeDirection.UP || direction == ForgeDirection.DOWN) - { - if (blockRotation == ForgeDirection.NORTH) - { - blockRotation = ForgeDirection.EAST; - } - else if (blockRotation == ForgeDirection.EAST) - { - blockRotation = ForgeDirection.SOUTH; - } - else if (blockRotation == ForgeDirection.SOUTH) - { - blockRotation = ForgeDirection.WEST; - } - else if (blockRotation == ForgeDirection.WEST) - { - blockRotation = ForgeDirection.NORTH; - } - } - else if (direction == ForgeDirection.EAST || direction == ForgeDirection.WEST) - { - if (blockRotation == ForgeDirection.NORTH) - { - blockRotation = ForgeDirection.UP; - } - else if (blockRotation == ForgeDirection.UP) - { - blockRotation = ForgeDirection.SOUTH; - } - else if (blockRotation == ForgeDirection.SOUTH) - { - blockRotation = ForgeDirection.DOWN; - } - else if (blockRotation == ForgeDirection.DOWN) - { - blockRotation = ForgeDirection.NORTH; - } - } - else if (direction == ForgeDirection.NORTH || direction == ForgeDirection.SOUTH) - { - if (blockRotation == ForgeDirection.EAST) - { - blockRotation = ForgeDirection.UP; - } - else if (blockRotation == ForgeDirection.UP) - { - blockRotation = ForgeDirection.WEST; - } - else if (blockRotation == ForgeDirection.WEST) - { - blockRotation = ForgeDirection.DOWN; - } - else if (blockRotation == ForgeDirection.DOWN) - { - blockRotation = ForgeDirection.EAST; - } - } - world.markBlockForUpdate(position.intX(), position.intY(), position.intZ()); - world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "tile.piston.in", 0.5F, world.rand.nextFloat() * 0.15F + 0.6F); - if (tileEntity instanceof IRotatable) - { - ((IRotatable) tileEntity).setDirection(blockRotation); - world.scheduleBlockUpdate(position.intX(), position.intY(), position.intZ(), this.blockID, 20); - - } - else if (Block.blocksList[blockID] instanceof IRotatableBlock) - { - ((IRotatableBlock) Block.blocksList[blockID]).setDirection(world, position.intX(), position.intY(), position.intZ(), blockRotation); - world.scheduleBlockUpdate(position.intX(), position.intY(), position.intZ(), this.blockID, 20); - } - } - } - catch (Exception e) - { - System.out.println("Error while rotating a block near " + x + "x " + y + "y " + z + "z " + (world != null && world.provider != null ? world.provider.dimensionId + "d" : "null:world")); - e.printStackTrace(); - } - } - } - - @Override - public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (world.isRemote) - { - return true; - } - world.setBlockMetadataWithNotify(x, y, z, side, 3); - return true; - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (world.isRemote) - { - return true; - } - ForgeDirection currentDirection = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z)); - if (currentDirection == ForgeDirection.NORTH) - { - currentDirection = ForgeDirection.UP; - } - else if (currentDirection == ForgeDirection.UP) - { - currentDirection = ForgeDirection.DOWN; - } - else if (currentDirection == ForgeDirection.DOWN) - { - currentDirection = ForgeDirection.EAST; - } - else if (currentDirection == ForgeDirection.EAST) - { - currentDirection = ForgeDirection.SOUTH; - } - else if (currentDirection == ForgeDirection.SOUTH) - { - currentDirection = ForgeDirection.WEST; - } - else if (currentDirection == ForgeDirection.WEST) - { - currentDirection = ForgeDirection.NORTH; - } - world.setBlockMetadataWithNotify(x, y, z, currentDirection.ordinal(), 3); - return true; - } - - @Override - public TileEntity createNewTileEntity(World world) - { - // TODO Auto-generated method stub - return null; - } -} diff --git a/archive/java/resonantinduction/archaic/blocks/ItemBlockColored.java b/archive/java/resonantinduction/archaic/blocks/ItemBlockColored.java deleted file mode 100644 index 0e9a0357..00000000 --- a/archive/java/resonantinduction/archaic/blocks/ItemBlockColored.java +++ /dev/null @@ -1,34 +0,0 @@ -package resonantinduction.archaic.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import dark.lib.helpers.ColorCode; - -public class ItemBlockColored extends ItemBlock -{ - public ItemBlockColored(int par1) - { - super(par1); - this.setMaxDamage(0); - this.setHasSubtypes(true); - } - - @Override - public int getMetadata(int par1) - { - return par1; - } - - @Override - public String getUnlocalizedName(ItemStack par1ItemStack) - { - return Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + ColorCode.get(par1ItemStack.getItemDamage()).name; - } - - @Override - public String getUnlocalizedName() - { - return Block.blocksList[this.getBlockID()].getUnlocalizedName(); - } -} diff --git a/archive/java/resonantinduction/core/ClientProxy.java b/archive/java/resonantinduction/core/ClientProxy.java deleted file mode 100644 index b18d28d2..00000000 --- a/archive/java/resonantinduction/core/ClientProxy.java +++ /dev/null @@ -1,51 +0,0 @@ -package resonantinduction.core; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraftforge.common.MinecraftForge; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -@SideOnly(Side.CLIENT) -public class ClientProxy extends CommonProxy -{ - @Override - public void preInit() - { - MinecraftForge.EVENT_BUS.register(SoundHandler.INSTANCE); - } - - @Override - public void postInit() - { - } - - @Override - public boolean isPaused() - { - if (FMLClientHandler.instance().getClient().isSingleplayer() && !FMLClientHandler.instance().getClient().getIntegratedServer().getPublic()) - { - GuiScreen screen = FMLClientHandler.instance().getClient().currentScreen; - - if (screen != null) - { - if (screen.doesGuiPauseGame()) - { - return true; - } - } - } - - return false; - } - - @Override - public boolean isGraphicsFancy() - { - return FMLClientHandler.instance().getClient().gameSettings.fancyGraphics; - } -} diff --git a/archive/java/resonantinduction/core/CommonProxy.java b/archive/java/resonantinduction/core/CommonProxy.java deleted file mode 100644 index fa0be546..00000000 --- a/archive/java/resonantinduction/core/CommonProxy.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - */ -package resonantinduction.core; - -import resonantinduction.core.prefab.ProxyBase; - -/** - * @author Calclavia - * - */ -public class CommonProxy extends ProxyBase -{ - public boolean isPaused() - { - return false; - } - - public boolean isGraphicsFancy() - { - return false; - } - -} diff --git a/archive/java/resonantinduction/core/Reference.java b/archive/java/resonantinduction/core/Reference.java deleted file mode 100644 index 9c2566ee..00000000 --- a/archive/java/resonantinduction/core/Reference.java +++ /dev/null @@ -1,34 +0,0 @@ -package resonantinduction.core; - -/** - * A class for static references. - * - * @author Calclavia - */ -public class Reference -{ - /** The official name of the mod */ - public static final String NAME = "Resonant Induction"; - - public static final String MAJOR_VERSION = "@MAJOR@"; - public static final String MINOR_VERSION = "@MINOR@"; - public static final String REVISION_VERSION = "@REVIS@"; - public static final String BUILD_VERSION = "@BUILD@"; - public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVISION_VERSION; - public static final String CHANNEL = "resonindc"; - /** - * Directory Information - */ - public static final String DOMAIN = "resonantinduction"; - public static final String PREFIX = DOMAIN + ":"; - public static final String DIRECTORY = "/assets/" + DOMAIN + "/"; - public static final String TEXTURE_DIRECTORY = "textures/"; - public static final String GUI_DIRECTORY = TEXTURE_DIRECTORY + "gui/"; - public static final String BLOCK_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "blocks/"; - public static final String ITEM_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "items/"; - public static final String MODEL_PATH = "models/"; - public static final String MODEL_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + MODEL_PATH; - public static final String MODEL_DIRECTORY = DIRECTORY + MODEL_PATH; - public static final String LANGUAGE_DIRECTORY = DIRECTORY + "languages/"; - public static final String[] LANGUAGES = new String[] { "en_US", "de_DE" }; -} diff --git a/archive/java/resonantinduction/core/ResonantInduction.java b/archive/java/resonantinduction/core/ResonantInduction.java deleted file mode 100644 index a15c35e0..00000000 --- a/archive/java/resonantinduction/core/ResonantInduction.java +++ /dev/null @@ -1,127 +0,0 @@ -package resonantinduction.core; - -import java.util.logging.Logger; - -import net.minecraft.block.Block; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; - -import org.modstats.ModstatInfo; -import org.modstats.Modstats; - -import resonantinduction.core.handler.FluidEventHandler; -import resonantinduction.core.handler.LinkEventHandler; -import resonantinduction.core.prefab.part.PacketMultiPart; -import resonantinduction.core.resource.ResourceGenerator; -import resonantinduction.core.resource.fluid.BlockFluidMixture; -import resonantinduction.core.resource.fluid.TileFluidMixture; -import resonantinduction.core.resource.item.ItemDust; -import calclavia.lib.multiblock.link.BlockMulti; -import calclavia.lib.multiblock.link.TileMultiBlockPart; -import calclavia.lib.network.PacketHandler; -import calclavia.lib.network.PacketTile; -import calclavia.lib.utility.LanguageUtility; -import cpw.mods.fml.common.FMLLog; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.ModMetadata; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkMod; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/** - * The core module of Resonant Induction - * - * @author Calclavia - */ -@Mod(modid = ResonantInduction.ID, name = ResonantInduction.NAME, version = Reference.VERSION, dependencies = "required-after:CalclaviaCore;before:IC2") -@NetworkMod(channels = Reference.CHANNEL, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) -@ModstatInfo(prefix = "resonantin") -public class ResonantInduction -{ - /** Mod Information */ - public static final String ID = "ResonantInduction|Core"; - public static final String NAME = Reference.NAME + " Core"; - - @Instance(ID) - public static ResonantInduction INSTANCE; - - @SidedProxy(clientSide = "resonantinduction.core.ClientProxy", serverSide = "resonantinduction.core.CommonProxy") - public static CommonProxy proxy; - - @Mod.Metadata(ID) - public static ModMetadata metadata; - - public static final Logger LOGGER = Logger.getLogger(Reference.NAME); - - /** Packets */ - public static final PacketTile PACKET_TILE = new PacketTile(Reference.CHANNEL); - public static final PacketMultiPart PACKET_MULTIPART = new PacketMultiPart(Reference.CHANNEL); - - /** - * Blocks and Items - */ - public static BlockMulti blockMulti; - - public static ItemDust itemDust; - public static Block blockFluidMixture; - - public static Fluid MIXTURE = null; - - @EventHandler - public void preInit(FMLPreInitializationEvent evt) - { - ResonantInduction.LOGGER.setParent(FMLLog.getLogger()); - NetworkRegistry.instance().registerGuiHandler(this, proxy); - Modstats.instance().getReporter().registerMod(this); - Settings.load(); - - // Register Forge Events - MinecraftForge.EVENT_BUS.register(ResourceGenerator.INSTANCE); - MinecraftForge.EVENT_BUS.register(new LinkEventHandler()); - MinecraftForge.EVENT_BUS.register(new FluidEventHandler()); - - Settings.CONFIGURATION.load(); - - blockMulti = new BlockMulti(Settings.getNextBlockID()).setPacketType(PACKET_TILE); - - MIXTURE = new Fluid("mixture"); - FluidRegistry.registerFluid(MIXTURE); - blockFluidMixture = new BlockFluidMixture(Settings.getNextBlockID(), MIXTURE); - - // Items - itemDust = new ItemDust(Settings.getNextItemID()); - GameRegistry.registerItem(itemDust, itemDust.getUnlocalizedName()); - - GameRegistry.registerTileEntity(TileMultiBlockPart.class, "TileEntityMultiBlockPart"); - GameRegistry.registerBlock(blockMulti, "blockMulti"); - - GameRegistry.registerBlock(blockFluidMixture, blockFluidMixture.getUnlocalizedName()); - GameRegistry.registerTileEntity(TileFluidMixture.class, blockFluidMixture.getUnlocalizedName()); - - Settings.CONFIGURATION.save(); - } - - @EventHandler - public void init(FMLInitializationEvent evt) - { - // Load Languages - ResonantInduction.LOGGER.fine("Languages Loaded:" + LanguageUtility.loadLanguages(Reference.LANGUAGE_DIRECTORY, Reference.LANGUAGES)); - // Set Mod Metadata - Settings.setModMetadata(metadata, ID, NAME); - } - - @EventHandler - public void postInit(FMLPostInitializationEvent evt) - { - // Generate Dusts - ResourceGenerator.generateDusts(); - } - -} diff --git a/archive/java/resonantinduction/core/ResonantInductionTabs.java b/archive/java/resonantinduction/core/ResonantInductionTabs.java deleted file mode 100644 index 0cc107e6..00000000 --- a/archive/java/resonantinduction/core/ResonantInductionTabs.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * - */ -package resonantinduction.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; - -/** - * @author Calclavia - * - */ -public class ResonantInductionTabs extends CreativeTabs -{ - public static final ResonantInductionTabs CORE = new ResonantInductionTabs(CreativeTabs.getNextID(), Reference.DOMAIN); - public static ItemStack ITEMSTACK; - - public ResonantInductionTabs(int par1, String par2Str) - { - super(par1, par2Str); - - } - - @Override - public ItemStack getIconItemStack() - { - return ITEMSTACK; - } - -} diff --git a/archive/java/resonantinduction/core/Settings.java b/archive/java/resonantinduction/core/Settings.java deleted file mode 100644 index f5fad512..00000000 --- a/archive/java/resonantinduction/core/Settings.java +++ /dev/null @@ -1,94 +0,0 @@ -package resonantinduction.core; - -import java.io.File; -import java.util.Arrays; - -import net.minecraft.server.MinecraftServer; -import net.minecraftforge.common.Configuration; -import calclavia.lib.prefab.block.IDManager; -import calclavia.lib.utility.LanguageUtility; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.ModMetadata; - -/** @author Calclavia */ -public class Settings -{ - /** IDs suggested by Jyzarc and Horfius */ - public static final IDManager idManager = new IDManager(3200, 20150); - - public static int getNextBlockID() - { - return idManager.getNextBlockID(); - } - - public static int getNextItemID() - { - return idManager.getNextItemID(); - } - - /** Settings */ - public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), Reference.NAME + ".cfg")); - public static int FURNACE_WATTAGE = 50000; - public static boolean SOUND_FXS = true; - public static boolean LO_FI_INSULATION = false; - public static boolean SHINY_SILVER = true; - public static boolean REPLACE_FURNACE = true; - public static int MAX_CONTRACTOR_DISTANCE = 200; - - /** - * Called from RI's core. - */ - public static void load() - { - CONFIGURATION.load(); - - // Config - FURNACE_WATTAGE = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Furnace Wattage Per Tick", FURNACE_WATTAGE).getInt(FURNACE_WATTAGE); - SOUND_FXS = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Tesla Sound FXs", SOUND_FXS).getBoolean(SOUND_FXS); - LO_FI_INSULATION = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Use lo-fi insulation texture", LO_FI_INSULATION).getBoolean(LO_FI_INSULATION); - SHINY_SILVER = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Shiny silver wires", SHINY_SILVER).getBoolean(SHINY_SILVER); - MAX_CONTRACTOR_DISTANCE = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Max EM Contractor Path", MAX_CONTRACTOR_DISTANCE).getInt(MAX_CONTRACTOR_DISTANCE); - REPLACE_FURNACE = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Replace vanilla furnace", REPLACE_FURNACE).getBoolean(REPLACE_FURNACE); - - LEVITATOR_ACCELERATION = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Contractor Item Acceleration", Settings.LEVITATOR_ACCELERATION).getDouble(Settings.LEVITATOR_ACCELERATION); - LEVITATOR_MAX_REACH = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Contractor Max Item Reach", Settings.LEVITATOR_MAX_REACH).getInt(Settings.LEVITATOR_MAX_REACH); - LEVITATOR_MAX_SPEED = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Contractor Max Item Speed", Settings.LEVITATOR_MAX_SPEED).getDouble(Settings.LEVITATOR_MAX_SPEED); - LEVITATOR_PUSH_DELAY = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Contractor Item Push Delay", Settings.LEVITATOR_PUSH_DELAY).getInt(Settings.LEVITATOR_PUSH_DELAY); - } - - public static void save() - { - CONFIGURATION.save(); - } - - public static void setModMetadata(ModMetadata metadata, String id, String name) - { - metadata.modId = id; - metadata.name = name; - metadata.description = LanguageUtility.getLocal("meta.resonantinduction.description"); - metadata.url = "http://calclavia.com/resonant-induction"; - metadata.logoFile = "ri_logo.png"; - metadata.version = Reference.VERSION + "." + Reference.BUILD_VERSION; - metadata.authorList = Arrays.asList(new String[] { "Calclavia", "DarkCow" }); - metadata.credits = LanguageUtility.getLocal("meta.resonantinduction.credits"); - metadata.autogenerated = false; - } - - public static boolean isOp(String username) - { - MinecraftServer theServer = FMLCommonHandler.instance().getMinecraftServerInstance(); - - if (theServer != null) - { - return theServer.getConfigurationManager().getOps().contains(username.trim().toLowerCase()); - } - - return false; - } - - public static int LEVITATOR_MAX_REACH = 40; - public static int LEVITATOR_PUSH_DELAY = 5; - public static double LEVITATOR_MAX_SPEED = .2; - public static double LEVITATOR_ACCELERATION = .02; -} diff --git a/archive/java/resonantinduction/core/SoundHandler.java b/archive/java/resonantinduction/core/SoundHandler.java deleted file mode 100644 index 19f6b721..00000000 --- a/archive/java/resonantinduction/core/SoundHandler.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - */ -package resonantinduction.core; - -import net.minecraftforge.client.event.sound.SoundLoadEvent; -import net.minecraftforge.event.ForgeSubscribe; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -@SideOnly(Side.CLIENT) -public class SoundHandler -{ - public static final SoundHandler INSTANCE = new SoundHandler(); - - public static final String[] SOUND_FILES = { "grinder1.ogg", "grinder2.ogg", "electricshock1.ogg", "electricshock2.ogg", "electricshock3.ogg", "electricshock4.ogg", "electricshock5.ogg", "electricshock6.ogg", "electricshock7.ogg" }; - - @ForgeSubscribe - public void loadSoundEvents(SoundLoadEvent event) - { - for (int i = 0; i < SOUND_FILES.length; i++) - { - event.manager.addSound(Reference.PREFIX + SOUND_FILES[i]); - } - - ResonantInduction.LOGGER.fine("Loaded sound fxs"); - } -} diff --git a/archive/java/resonantinduction/core/Utility.java b/archive/java/resonantinduction/core/Utility.java deleted file mode 100644 index de7ebe4a..00000000 --- a/archive/java/resonantinduction/core/Utility.java +++ /dev/null @@ -1,54 +0,0 @@ -package resonantinduction.core; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.oredict.OreDictionary; -import codechicken.lib.vec.BlockCoord; -import codechicken.multipart.TileMultipart; - -/** - * General Utilities - * - * @author Calclavia - * - */ -public class Utility -{ - public static TileMultipart getMultipartTile(IBlockAccess access, BlockCoord pos) - { - TileEntity te = access.getBlockTileEntity(pos.x, pos.y, pos.z); - return te instanceof TileMultipart ? (TileMultipart) te : null; - } - - public static boolean canPlaceWireOnSide(World w, int x, int y, int z, ForgeDirection side, boolean _default) - { - if (!w.blockExists(x, y, z)) - return _default; - - Block b = Block.blocksList[w.getBlockId(x, y, z)]; - if (b == null) - return false; - // Manual list of allowed blocks that wire can sit on. - if (b == Block.glowStone || b == Block.pistonBase || b == Block.pistonStickyBase || b == Block.pistonMoving) - return true; - return b.isBlockSolidOnSide(w, x, y, z, side); - } - - public static int isDye(ItemStack is) - { - String[] dyes = { "dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple", "dyeCyan", "dyeLightGray", "dyeGray", "dyePink", "dyeLime", "dyeYellow", "dyeLightBlue", "dyeMagenta", "dyeOrange", "dyeWhite" }; - - for (int i = 0; i < dyes.length; i++) - { - if (OreDictionary.getOreID(is) != -1 && OreDictionary.getOreName(OreDictionary.getOreID(is)).equals(dyes[i])) - return i; - } - - return -1; - } - -} diff --git a/archive/java/resonantinduction/core/debug/BlockDebug.java b/archive/java/resonantinduction/core/debug/BlockDebug.java deleted file mode 100644 index 9ccd4820..00000000 --- a/archive/java/resonantinduction/core/debug/BlockDebug.java +++ /dev/null @@ -1,208 +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 net.minecraftforge.common.Configuration; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.transport.ResonantInductionTransport; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.IExtraInfo.IExtraBlockInfo; - -public class BlockDebug extends BlockMachine implements IExtraBlockInfo -{ - public static float DebugWattOut, DebugWattDemand; - - public BlockDebug() - { - super("DebugBlock"); - this.setCreativeTab(ResonantInductionTabs.CORE); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconReg) - { - super.registerIcons(iconReg); - for (DebugBlocks block : DebugBlocks.values()) - { - if (block.enabled) - { - block.icon = iconReg.registerIcon(ResonantInductionTransport.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 onBlockAdded(World world, int x, int y, int z) - { - super.onBlockAdded(world, x, y, z); - int meta = world.getBlockMetadata(x, y, z); - if (meta >= DebugBlocks.values().length || !DebugBlocks.values()[meta].enabled) - { - world.setBlock(x, y, z, 0); - } - } - - @Override - public void getSubBlocks(int blockID, CreativeTabs tab, List creativeTabList) - { - for (DebugBlocks block : DebugBlocks.values()) - { - if (block.enabled) - { - creativeTabList.add(new ItemStack(blockID, 1, block.ordinal())); - } - } - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - for (DebugBlocks block : DebugBlocks.values()) - { - if (block.enabled && block.clazz != null && block.name != null) - { - list.add(new Pair>(block.name, block.clazz)); - } - } - } - - @Override - public void loadExtraConfigs(Configuration config) - { - for (DebugBlocks block : DebugBlocks.values()) - { - block.enabled = config.get("Blocks", "Enable" + block.name + "Block", true).getBoolean(true); - } - - } - - @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", TileEntityInfSupply.class, "infSource"), - FLUID("UnlimitedFluid", TileEntityInfFluid.class, "infFluid"), - VOID("FluidVoid", TileEntityVoid.class, "void"), - LOAD("PowerVampire", TileEntityInfLoad.class, "infLoad"); - public Icon icon; - public String name; - public String texture; - public boolean enabled; - 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 boolean hasExtraConfigs() - { - // TODO Auto-generated method stub - return false; - } - - @Override - public void loadOreNames() - { - // TODO Auto-generated method stub - - } - - @Override - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - // TODO Auto-generated method stub - - } - -} diff --git a/archive/java/resonantinduction/core/debug/ItemInstaHole.java b/archive/java/resonantinduction/core/debug/ItemInstaHole.java deleted file mode 100644 index a893b0b0..00000000 --- a/archive/java/resonantinduction/core/debug/ItemInstaHole.java +++ /dev/null @@ -1,56 +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/archive/java/resonantinduction/core/debug/TileEntityInfFluid.java b/archive/java/resonantinduction/core/debug/TileEntityInfFluid.java deleted file mode 100644 index 66393c8a..00000000 --- a/archive/java/resonantinduction/core/debug/TileEntityInfFluid.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.tileentity.TileEntity; -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.link.IBlockActivate; -import calclavia.lib.utility.FluidHelper; - -import com.builtbroken.common.lang.TextHelper.TextColor; - -public class TileEntityInfFluid extends TileEntity 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) - { - FluidHelper.fillTanksAllSides(this.worldObj, new Vector3(this), FluidHelper.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, FluidHelper.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/archive/java/resonantinduction/core/debug/TileEntityInfLoad.java b/archive/java/resonantinduction/core/debug/TileEntityInfLoad.java deleted file mode 100644 index 0c8e7a6c..00000000 --- a/archive/java/resonantinduction/core/debug/TileEntityInfLoad.java +++ /dev/null @@ -1,32 +0,0 @@ -package resonantinduction.core.debug; - -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.tile.TileEntityEnergyMachine; - -public class TileEntityInfLoad extends TileEntityEnergyMachine -{ - - @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; - } - - @Override - public long getMaxEnergyStored() - { - return Long.MAX_VALUE; - } -} diff --git a/archive/java/resonantinduction/core/debug/TileEntityInfSupply.java b/archive/java/resonantinduction/core/debug/TileEntityInfSupply.java deleted file mode 100644 index a7aa2683..00000000 --- a/archive/java/resonantinduction/core/debug/TileEntityInfSupply.java +++ /dev/null @@ -1,53 +0,0 @@ -package resonantinduction.core.debug; - -import java.util.EnumSet; - -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.tile.TileEntityEnergyMachine; - -public class TileEntityInfSupply extends TileEntityEnergyMachine -{ - @Override - public void updateEntity() - { - super.updateEntity(); - this.setJoulesPerTick(10000); - 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; - } - - @Override - public long getMaxEnergyStored() - { - return Long.MAX_VALUE; - } -} diff --git a/archive/java/resonantinduction/core/debug/TileEntityVoid.java b/archive/java/resonantinduction/core/debug/TileEntityVoid.java deleted file mode 100644 index 0b3a09c7..00000000 --- a/archive/java/resonantinduction/core/debug/TileEntityVoid.java +++ /dev/null @@ -1,66 +0,0 @@ -package resonantinduction.core.debug; - -import java.util.HashMap; - -import net.minecraft.tileentity.TileEntity; -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; - -/** - * Designed to debug fluid devices by draining everything that comes in at one time - * - * @author DarkGuardsman - */ -public class TileEntityVoid extends TileEntity 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/archive/java/resonantinduction/core/handler/FluidEventHandler.java b/archive/java/resonantinduction/core/handler/FluidEventHandler.java deleted file mode 100644 index b3e1f95c..00000000 --- a/archive/java/resonantinduction/core/handler/FluidEventHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -package resonantinduction.core.handler; - -import java.util.HashMap; - -import net.minecraft.util.Icon; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.event.ForgeSubscribe; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInduction; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -public class FluidEventHandler -{ - public static final HashMap fluidIconMap = new HashMap(); - - public void registerIcon(String name, TextureStitchEvent.Pre event) - { - fluidIconMap.put(name, event.map.registerIcon(name)); - } - - @ForgeSubscribe - @SideOnly(Side.CLIENT) - public void preTextureHook(TextureStitchEvent.Pre event) - { - if (event.map.textureType == 0) - { - registerIcon(Reference.PREFIX + "mixture", event); - } - } - - @ForgeSubscribe - @SideOnly(Side.CLIENT) - public void textureHook(TextureStitchEvent.Post event) - { - ResonantInduction.MIXTURE.setIcons(fluidIconMap.get(Reference.PREFIX + "mixture")); - } -} diff --git a/archive/java/resonantinduction/core/handler/ILinkable.java b/archive/java/resonantinduction/core/handler/ILinkable.java deleted file mode 100644 index fdb26504..00000000 --- a/archive/java/resonantinduction/core/handler/ILinkable.java +++ /dev/null @@ -1,19 +0,0 @@ -package resonantinduction.core.handler; - -import net.minecraft.entity.player.EntityPlayer; -import universalelectricity.api.vector.VectorWorld; - -/** - * @author Calclavia - * - */ -public interface ILinkable -{ - /** - * - * @param player - * @param vector - * @return True to clear the link. - */ - public boolean onLink(EntityPlayer player, VectorWorld vector); -} diff --git a/archive/java/resonantinduction/core/handler/LinkEventHandler.java b/archive/java/resonantinduction/core/handler/LinkEventHandler.java deleted file mode 100644 index 3302f4d3..00000000 --- a/archive/java/resonantinduction/core/handler/LinkEventHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * - */ -package resonantinduction.core.handler; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.event.Event.Result; -import net.minecraftforge.event.ForgeSubscribe; -import universalelectricity.api.vector.VectorWorld; -import calclavia.components.event.MultitoolEvent; -import codechicken.multipart.ControlKeyModifer; - -/** - * @author Calclavia - */ -public class LinkEventHandler -{ - @ForgeSubscribe - public void linkEvent(MultitoolEvent evt) - { - if (ControlKeyModifer.isControlDown(evt.player)) - { - TileEntity tile = evt.world.getBlockTileEntity(evt.x, evt.y, evt.z); - - if (tile instanceof ILinkable && this.hasLink(evt.toolStack)) - { - if (!evt.world.isRemote) - { - if (((ILinkable) tile).onLink(evt.player, this.getLink(evt.toolStack))) - { - this.clearLink(evt.toolStack); - evt.player.addChatMessage("Link cleared."); - } - } - evt.setResult(Result.DENY); - } - else - { - if (!evt.world.isRemote) - { - evt.player.addChatMessage("Set link to block [" + evt.x + ", " + evt.y + ", " + evt.z + "], Dimension: '" + evt.world.provider.getDimensionName() + "'"); - this.setLink(evt.toolStack, new VectorWorld(evt.world, evt.x, evt.y, evt.z)); - } - } - - evt.setCanceled(true); - } - } - - public boolean hasLink(ItemStack itemStack) - { - return getLink(itemStack) != null; - } - - public VectorWorld getLink(ItemStack itemStack) - { - if (itemStack.stackTagCompound == null || !itemStack.getTagCompound().hasKey("link")) - { - return null; - } - - return new VectorWorld(itemStack.getTagCompound().getCompoundTag("link")); - } - - public void setLink(ItemStack itemStack, VectorWorld vec) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - itemStack.getTagCompound().setCompoundTag("link", vec.writeToNBT(new NBTTagCompound())); - } - - public void clearLink(ItemStack itemStack) - { - itemStack.getTagCompound().removeTag("link"); - } -} diff --git a/archive/java/resonantinduction/core/network/ISimplePacketReceiver.java b/archive/java/resonantinduction/core/network/ISimplePacketReceiver.java deleted file mode 100644 index 4791e85b..00000000 --- a/archive/java/resonantinduction/core/network/ISimplePacketReceiver.java +++ /dev/null @@ -1,25 +0,0 @@ -package resonantinduction.core.network; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; - -/** - * Simplified version of IPackerReceiver for tiles that only need a packet ID, data, and player - * Reference - * - * @author DarkGuardsman - */ -public interface ISimplePacketReceiver -{ - /** - * Simplified version of IPacketReceiver's HandlePacketData - * - * @param id - packet ID as a string - * @param data - data from the packet, after location has been read - * @param player - player that the packet was sent to or came from - * @return true if the packet was used - */ - public boolean simplePacket(String id, ByteArrayDataInput data, Player player); - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/core/network/PacketIDTile.java b/archive/java/resonantinduction/core/network/PacketIDTile.java deleted file mode 100644 index 5acbf9a5..00000000 --- a/archive/java/resonantinduction/core/network/PacketIDTile.java +++ /dev/null @@ -1,72 +0,0 @@ -package resonantinduction.core.network; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; -import calclavia.lib.network.IPacketReceiver; -import calclavia.lib.network.PacketType; - -import com.google.common.io.ByteArrayDataInput; - -/** - * Packet handler for blocks and tile entities. - * - * @author Calclavia - */ -public class PacketIDTile extends PacketType -{ - public PacketIDTile(String channel) - { - super(channel); - } - - public Packet getPacket(TileEntity tileEntity, String id, Object... args) - { - return this.getPacket(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, id, args); - } - - public Packet getPacket(int x, int y, int z, String id, Object... args) - { - List newArgs = new ArrayList(); - - newArgs.add(x); - newArgs.add(y); - newArgs.add(z); - newArgs.add(id); - - for (Object obj : args) - { - newArgs.add(obj); - } - - return super.getPacket(newArgs.toArray()); - } - - @Override - public void receivePacket(ByteArrayDataInput data, EntityPlayer player) - { - int x = data.readInt(); - int y = data.readInt(); - int z = data.readInt(); - String id = data.readUTF(); - TileEntity tileEntity = player.worldObj.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof IPacketReceiver) - { - ((IPacketReceiver) tileEntity).onReceivePacket(data, player); - } - else - { - int blockID = player.worldObj.getBlockId(x, y, z); - - if (Block.blocksList[blockID] instanceof IPacketReceiver) - { - ((IPacketReceiver) Block.blocksList[blockID]).onReceivePacket(data, player, x, y, z); - } - } - } -} diff --git a/archive/java/resonantinduction/core/part/BlockMachinePart.java b/archive/java/resonantinduction/core/part/BlockMachinePart.java deleted file mode 100644 index 13587eca..00000000 --- a/archive/java/resonantinduction/core/part/BlockMachinePart.java +++ /dev/null @@ -1,17 +0,0 @@ -package resonantinduction.core.part; - -import resonantinduction.core.prefab.block.BlockBase; - -/** - * A block used to build machines. - * - * @author Calclavia - * - */ -public class BlockMachinePart extends BlockBase -{ - public BlockMachinePart() - { - super("machinePart"); - } -} diff --git a/archive/java/resonantinduction/core/prefab/ProxyBase.java b/archive/java/resonantinduction/core/prefab/ProxyBase.java deleted file mode 100644 index 1b121d34..00000000 --- a/archive/java/resonantinduction/core/prefab/ProxyBase.java +++ /dev/null @@ -1,33 +0,0 @@ -package resonantinduction.core.prefab; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import cpw.mods.fml.common.network.IGuiHandler; - -public abstract class ProxyBase implements IGuiHandler -{ - public void preInit() - { - } - - public void init() - { - } - - public void postInit() - { - } - - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - return null; - } - - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - return null; - } - -} diff --git a/archive/java/resonantinduction/core/prefab/block/BlockBase.java b/archive/java/resonantinduction/core/prefab/block/BlockBase.java deleted file mode 100644 index a5fbdb9d..00000000 --- a/archive/java/resonantinduction/core/prefab/block/BlockBase.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - */ -package resonantinduction.core.prefab.block; - -import net.minecraft.block.material.Material; -import net.minecraftforge.common.Configuration; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; -import universalelectricity.api.UniversalElectricity; -import calclavia.lib.prefab.block.BlockAdvanced; - -/** @author Calclavia */ -public class BlockBase extends BlockAdvanced -{ - public BlockBase(String name) - { - this(name, UniversalElectricity.machine); - } - - public BlockBase(String name, Material material) - { - this(Settings.getNextBlockID(), name, material); - } - - public BlockBase(int id, String name, Material material) - { - super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, name, id).getInt(id), material); - this.setCreativeTab(ResonantInductionTabs.CORE); - this.setUnlocalizedName(Reference.PREFIX + name); - this.setTextureName(Reference.PREFIX + name); - this.setHardness(1f); - } -} diff --git a/archive/java/resonantinduction/core/prefab/block/BlockIOBase.java b/archive/java/resonantinduction/core/prefab/block/BlockIOBase.java deleted file mode 100644 index a46e45fb..00000000 --- a/archive/java/resonantinduction/core/prefab/block/BlockIOBase.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * - */ -package resonantinduction.core.prefab.block; - -import net.minecraft.block.material.Material; -import net.minecraftforge.common.Configuration; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; -import calclavia.lib.prefab.block.BlockSidedIO; - -/** - * Blocks that have specific sided input and output should extend this. - * - * @author Calclavia - * - */ -public class BlockIOBase extends BlockSidedIO -{ - public BlockIOBase(String name, int id) - { - super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, name, id).getInt(id), Material.piston); - this.setCreativeTab(ResonantInductionTabs.CORE); - this.setUnlocalizedName(Reference.PREFIX + name); - this.setTextureName(Reference.PREFIX + name); - this.setHardness(1f); - } -} diff --git a/archive/java/resonantinduction/core/prefab/block/BlockImprintable.java b/archive/java/resonantinduction/core/prefab/block/BlockImprintable.java deleted file mode 100644 index d5c3d949..00000000 --- a/archive/java/resonantinduction/core/prefab/block/BlockImprintable.java +++ /dev/null @@ -1,145 +0,0 @@ -package resonantinduction.core.prefab.block; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import resonantinduction.core.prefab.tile.TileEntityFilterable; -import resonantinduction.old.api.IFilterable; -import resonantinduction.old.transport.imprinter.ItemImprinter; - -/** Extend this block class if a filter is allowed to be placed inside of this block. - * - * @author Calclavia */ -public abstract class BlockImprintable extends BlockMachine -{ - - public BlockImprintable(String blockName, Material material) - { - super(blockName, material); - } - - /** Allows filters to be placed inside of this block. */ - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity != null) - { - if (tileEntity instanceof IFilterable) - { - ItemStack containingStack = ((IFilterable) tileEntity).getFilter(); - - if (containingStack != null) - { - if (!world.isRemote) - { - EntityItem dropStack = new EntityItem(world, player.posX, player.posY, player.posZ, containingStack); - dropStack.delayBeforeCanPickup = 0; - world.spawnEntityInWorld(dropStack); - } - - ((IFilterable) tileEntity).setFilter(null); - return true; - } - else - { - if (player.getCurrentEquippedItem() != null) - { - if (player.getCurrentEquippedItem().getItem() instanceof ItemImprinter) - { - ((IFilterable) tileEntity).setFilter(player.getCurrentEquippedItem()); - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); - return true; - } - } - } - - } - } - - return false; - } - - @Override - public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity != null) - { - if (tileEntity instanceof TileEntityFilterable) - { - ((TileEntityFilterable) tileEntity).toggleInversion(); - world.markBlockForRenderUpdate(x, y, z); - world.markBlockForUpdate(x, y, z); - } - } - - return true; - } - - @Override - public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) - { - return this.onMachineActivated(world, x, y, z, player, side, hitX, hitY, hitZ); - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack stack) - { - int angle = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - int change = 2; - - switch (angle) - { - case 0: - change = 2; - break; - case 1: - change = 5; - break; - case 2: - change = 3; - break; - case 3: - change = 4; - break; - - } - world.setBlockMetadataWithNotify(x, y, z, change, 3); - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - int original = world.getBlockMetadata(x, y, z); - int change = 2; - - switch (original) - { - case 2: - change = 4; - break; - case 3: - change = 5; - break; - case 4: - change = 3; - break; - case 5: - change = 2; - break; - - } - - world.setBlockMetadataWithNotify(x, y, z, change, 3); - - return true; - } -} diff --git a/archive/java/resonantinduction/core/prefab/block/BlockMachine.java b/archive/java/resonantinduction/core/prefab/block/BlockMachine.java deleted file mode 100644 index 7be7e9c1..00000000 --- a/archive/java/resonantinduction/core/prefab/block/BlockMachine.java +++ /dev/null @@ -1,37 +0,0 @@ -package resonantinduction.core.prefab.block; - -import net.minecraft.block.material.Material; -import net.minecraftforge.common.Configuration; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; -import universalelectricity.api.UniversalElectricity; -import calclavia.lib.prefab.block.BlockTile; -/** - * Basic prefab for machine - * @author DarkGuardsman - * - */ -public class BlockMachine extends BlockTile -{ - - public BlockMachine(String name) - { - this(name, UniversalElectricity.machine); - } - - public BlockMachine(String name, Material material) - { - this(Settings.getNextBlockID(), name, material); - } - - public BlockMachine(int id, String name, Material material) - { - super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, name, id).getInt(id), material); - this.setCreativeTab(ResonantInductionTabs.CORE); - this.setUnlocalizedName(Reference.PREFIX + name); - this.setTextureName(Reference.PREFIX + name); - this.setHardness(1f); - } - -} diff --git a/archive/java/resonantinduction/core/prefab/block/BlockRotatableBase.java b/archive/java/resonantinduction/core/prefab/block/BlockRotatableBase.java deleted file mode 100644 index b3662587..00000000 --- a/archive/java/resonantinduction/core/prefab/block/BlockRotatableBase.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * - */ -package resonantinduction.core.prefab.block; - -import net.minecraftforge.common.Configuration; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; -import universalelectricity.api.UniversalElectricity; -import calclavia.lib.prefab.block.BlockRotatable; - -/** - * @author Calclavia - * - */ -public class BlockRotatableBase extends BlockRotatable -{ - public BlockRotatableBase(String name, int id) - { - super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, name, id).getInt(id), UniversalElectricity.machine); - this.setCreativeTab(ResonantInductionTabs.CORE); - this.setUnlocalizedName(Reference.PREFIX + name); - this.setTextureName(Reference.PREFIX + name); - this.setHardness(1f); - } -} diff --git a/archive/java/resonantinduction/core/prefab/item/ItemBase.java b/archive/java/resonantinduction/core/prefab/item/ItemBase.java deleted file mode 100644 index 93b8fca3..00000000 --- a/archive/java/resonantinduction/core/prefab/item/ItemBase.java +++ /dev/null @@ -1,23 +0,0 @@ -package resonantinduction.core.prefab.item; - -import net.minecraft.item.Item; -import net.minecraftforge.common.Configuration; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; - -/** - * - * @author AidanBrady - * - */ -public class ItemBase extends Item -{ - public ItemBase(String name, int id) - { - super(Settings.CONFIGURATION.get(Configuration.CATEGORY_ITEM, name, id).getInt(id)); - this.setCreativeTab(ResonantInductionTabs.CORE); - this.setUnlocalizedName(Reference.PREFIX + name); - this.setTextureName(Reference.PREFIX + name); - } -} diff --git a/archive/java/resonantinduction/core/prefab/part/ItemMultipartBase.java b/archive/java/resonantinduction/core/prefab/part/ItemMultipartBase.java deleted file mode 100644 index c450d71c..00000000 --- a/archive/java/resonantinduction/core/prefab/part/ItemMultipartBase.java +++ /dev/null @@ -1,23 +0,0 @@ -package resonantinduction.core.prefab.part; - -import net.minecraftforge.common.Configuration; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; -import codechicken.multipart.JItemMultiPart; - -/** - * @author Calclavia - * - */ -public abstract class ItemMultipartBase extends JItemMultiPart -{ - public ItemMultipartBase(String name, int id) - { - super(Settings.CONFIGURATION.get(Configuration.CATEGORY_ITEM, name, id).getInt(id)); - this.setCreativeTab(ResonantInductionTabs.CORE); - this.setUnlocalizedName(Reference.PREFIX + name); - this.setTextureName(Reference.PREFIX + name); - } - -} diff --git a/archive/java/resonantinduction/core/prefab/part/PacketMultiPart.java b/archive/java/resonantinduction/core/prefab/part/PacketMultiPart.java deleted file mode 100644 index 3f4d8ecc..00000000 --- a/archive/java/resonantinduction/core/prefab/part/PacketMultiPart.java +++ /dev/null @@ -1,64 +0,0 @@ -package resonantinduction.core.prefab.part; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.network.IPacketReceiver; -import calclavia.lib.network.PacketType; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TileMultipart; - -import com.google.common.io.ByteArrayDataInput; - -/** - * Packet handler for blocks and tile entities. - * - * @author Calclavia - */ -public class PacketMultiPart extends PacketType -{ - public PacketMultiPart(String channel) - { - super(channel); - } - - public Packet getPacket(Vector3 position, int partID, Object... args) - { - List newArgs = new ArrayList(); - - newArgs.add(position.intX()); - newArgs.add(position.intY()); - newArgs.add(position.intZ()); - newArgs.add(partID); - - for (Object obj : args) - { - newArgs.add(obj); - } - - return super.getPacket(newArgs.toArray()); - } - - @Override - public void receivePacket(ByteArrayDataInput data, EntityPlayer player) - { - int x = data.readInt(); - int y = data.readInt(); - int z = data.readInt(); - TileEntity tileEntity = player.worldObj.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof TileMultipart) - { - TMultiPart part = ((TileMultipart) tileEntity).partMap(data.readInt()); - - if (part instanceof IPacketReceiver) - { - ((IPacketReceiver) part).onReceivePacket(data, player); - } - } - } -} diff --git a/archive/java/resonantinduction/core/prefab/part/PartAdvanced.java b/archive/java/resonantinduction/core/prefab/part/PartAdvanced.java deleted file mode 100644 index 47c173b3..00000000 --- a/archive/java/resonantinduction/core/prefab/part/PartAdvanced.java +++ /dev/null @@ -1,37 +0,0 @@ -package resonantinduction.core.prefab.part; - -import net.minecraft.world.World; -import codechicken.multipart.TMultiPart; - -public abstract class PartAdvanced extends TMultiPart -{ - protected long ticks = 0; - - @Override - public void update() - { - if (ticks == 0) - { - initiate(); - } - - if (ticks >= Long.MAX_VALUE) - { - ticks = 1; - } - - ticks++; - } - - /** - * Called on the TileEntity's first tick. - */ - public void initiate() - { - } - - public World getWorld() - { - return world(); - } -} diff --git a/archive/java/resonantinduction/core/prefab/tile/TileEntityEnergyMachine.java b/archive/java/resonantinduction/core/prefab/tile/TileEntityEnergyMachine.java deleted file mode 100644 index 5e93b41e..00000000 --- a/archive/java/resonantinduction/core/prefab/tile/TileEntityEnergyMachine.java +++ /dev/null @@ -1,421 +0,0 @@ -package resonantinduction.core.prefab.tile; - -import java.util.EnumSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.oredict.OreDictionary; -import universalelectricity.api.CompatibilityModule; -import universalelectricity.api.electricity.IVoltageInput; -import universalelectricity.api.electricity.IVoltageOutput; -import universalelectricity.api.energy.IEnergyContainer; -import universalelectricity.api.energy.IEnergyInterface; -import universalelectricity.api.vector.Vector3; -import universalelectricity.api.vector.VectorHelper; -import dark.lib.interfaces.IPowerLess; - -/** - * Basic energy tile that can consume power - * - * Based off both UE universal electrical tile, and electrical tile prefabs - * - * @author DarkGuardsman - */ -public abstract class TileEntityEnergyMachine extends TileEntityMachine implements IEnergyInterface, IEnergyContainer, IPowerLess, IVoltageInput, IVoltageOutput -{ - /** Forge Ore Directory name of the item to toggle infinite power mode */ - public static String powerToggleItemID = "battery"; - /** Demand per tick in watts */ - protected long JOULES_PER_TICK; - /** Max limit of the internal battery/buffer of the machine */ - protected long MAX_JOULES_STORED; - /** Current energy stored in the machine's battery/buffer */ - protected long energyStored = 0; - /** Should we run without power */ - private boolean runWithoutPower = true; - /** Point by which this machines suffers low voltage damage */ - protected long brownOutVoltage = -1; - /** Point by which this machines suffers over voltage damage */ - protected long shortOutVoltage = -1; - /** Voltage by which the machine was designed and rated for */ - protected long ratedVoltage = 240; - - public TileEntityEnergyMachine() - { - this.brownOutVoltage = this.getVoltage() / 2; - this.shortOutVoltage = (long) ((Math.sqrt(2) * this.getVoltage()) + 0.05 * this.getVoltage()); - } - - public TileEntityEnergyMachine(long wattsPerTick) - { - this(); - this.JOULES_PER_TICK = wattsPerTick; - this.MAX_JOULES_STORED = wattsPerTick * 20; - } - - public TileEntityEnergyMachine(long wattsPerTick, long maxEnergy) - { - this(wattsPerTick); - this.MAX_JOULES_STORED = maxEnergy; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if (!this.worldObj.isRemote && this.isFunctioning()) - { - this.consumePower(this.JOULES_PER_TICK, true); - } - } - - /** Does this tile have power to run and do work */ - @Override - public boolean canFunction() - { - return super.canFunction() && (this.runPowerLess() || this.consumePower(this.JOULES_PER_TICK, false)); - } - - /** Called when a player activates the tile's block */ - public boolean onPlayerActivated(EntityPlayer player) - { - if (player != null && player.capabilities.isCreativeMode) - { - ItemStack itemStack = player.getHeldItem(); - if (itemStack != null) - { - for (ItemStack stack : OreDictionary.getOres(powerToggleItemID)) - { - if (stack.isItemEqual(itemStack)) - { - this.togglePowerMode(); - return true; - } - } - } - } - return false; - } - - @Override - public void updateContainingBlockInfo() - { - super.updateContainingBlockInfo(); - // TODO use this to reset any values that are based on the block as this gets called when - // the block changes - } - - /* ******************************************** - * Electricity logic - * ********************************************* - */ - - @Override - public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) - { - if (!this.runPowerLess() && this.getInputDirections().contains(from) && receive > 0) - { - long prevEnergyStored = Math.max(this.getEnergy(from), 0); - long newStoredEnergy = Math.min(this.getEnergy(from) + receive, this.getEnergyCapacity(from)); - if (doReceive) - { - this.setEnergy(from, newStoredEnergy); - } - - return Math.max(newStoredEnergy - prevEnergyStored, 0); - } - return 0; - } - - /** Called to consume power from the internal storage */ - protected boolean consumePower(long watts, boolean doDrain) - { - if (watts <= 0) - { - return true; - } - if (!this.runPowerLess() && this.getEnergy(ForgeDirection.UNKNOWN) >= watts) - { - if (doDrain) - { - this.setEnergy(ForgeDirection.UNKNOWN, this.getEnergyStored() - watts); - } - return true; - } - return this.runPowerLess(); - } - - @Override - public long onExtractEnergy(ForgeDirection from, long request, boolean doExtract) - { - if (this.getOutputDirections().contains(from) && request > 0) - { - long requestedEnergy = Math.min(request, this.energyStored); - if (doExtract) - { - this.setEnergy(from, this.energyStored - requestedEnergy); - } - return requestedEnergy; - } - return 0; - } - - /** Called to produce power using the output enumset for directions to output in */ - protected void produce() - { - for (ForgeDirection direction : this.getOutputDirections()) - { - if (direction != ForgeDirection.UNKNOWN) - { - TileEntity entity = VectorHelper.getTileEntityFromSide(this.worldObj, new Vector3(this), direction); - if (CompatibilityModule.canConnect(entity, direction.getOpposite())) - { - long output = this.onExtractEnergy(direction, this.JOULES_PER_TICK, false); - long input = CompatibilityModule.receiveEnergy(entity, direction.getOpposite(), output, true); - if (input > 0 && this.onExtractEnergy(direction, input, true) > 0) - { - break; - } - } - } - } - } - - @Override - public long getVoltageInput(ForgeDirection direction) - { - if (this.getInputDirections().contains(direction)) - { - return this.ratedVoltage; - } - return 0; - } - - @Override - public void onWrongVoltage(ForgeDirection direction, long voltage) - { - if (voltage > this.ratedVoltage) - { - if (voltage > this.shortOutVoltage) - { - // TODO damage machine - } - } - else - { - if (voltage < this.brownOutVoltage) - { - // TODO cause machine to run slow - } - } - } - - @Override - public long getVoltageOutput(ForgeDirection direction) - { - if (this.getOutputDirections().contains(direction)) - { - return this.ratedVoltage; - } - return 0; - } - - /* ******************************************** - * Electricity connection logic - * ********************************************* - */ - - @Override - public boolean canConnect(ForgeDirection direction) - { - if (direction == null || direction.equals(ForgeDirection.UNKNOWN)) - { - return false; - } - - return this.getInputDirections().contains(direction) || this.getOutputDirections().contains(direction); - } - - /** - * The electrical input direction. - * - * @return The direction that electricity is entered into the tile. Return null for no input. By - * default you can accept power from all sides. - */ - public EnumSet getInputDirections() - { - return EnumSet.allOf(ForgeDirection.class); - } - - /** - * The electrical output direction. - * - * @return The direction that electricity is output from the tile. Return null for no output. By - * default it will return an empty EnumSet. - */ - public EnumSet getOutputDirections() - { - return EnumSet.noneOf(ForgeDirection.class); - } - - /* ******************************************** - * Machine energy parms - * ********************************************* - */ - - public long getVoltage() - { - return this.ratedVoltage; - } - - public TileEntityEnergyMachine setVoltage(long volts) - { - this.ratedVoltage = volts; - return this; - } - - public long getMaxEnergyStored() - { - return this.MAX_JOULES_STORED; - } - - @Override - public long getEnergyCapacity(ForgeDirection from) - { - if (this.canConnect(from) || from == ForgeDirection.UNKNOWN) - { - return this.getMaxEnergyStored(); - } - return 0; - } - - public void setMaxEnergyStored(long energy) - { - this.MAX_JOULES_STORED = energy; - } - - public long getEnergyStored() - { - return this.energyStored; - } - - @Override - public void setEnergy(ForgeDirection from, long energy) - { - if (this.canConnect(from) || from == ForgeDirection.UNKNOWN) - { - this.energyStored = Math.max(Math.min(energy, this.getMaxEnergyStored()), 0); - } - } - - @Override - public long getEnergy(ForgeDirection from) - { - if (this.canConnect(from) || from == ForgeDirection.UNKNOWN) - { - return this.energyStored; - } - return 0; - } - - @Override - public boolean runPowerLess() - { - return !runWithoutPower; - } - - @Override - public void setPowerLess(boolean bool) - { - runWithoutPower = !bool; - } - - public void togglePowerMode() - { - this.setPowerLess(!this.runPowerLess()); - } - - public long getJoulesPerTick() - { - return this.JOULES_PER_TICK; - } - - public long getJoulesPerSec() - { - return getJoulesPerTick() * 20; - } - - public long getJoulesPerMin() - { - return getJoulesPerSec() * 60; - } - - public long getJoulesPerHour() - { - return getJoulesPerMin() * 60; - } - - public TileEntityEnergyMachine setJoulesPerTick(long energy) - { - this.JOULES_PER_TICK = energy; - return this; - } - - public TileEntityEnergyMachine setJoulesPerSecound(long energy) - { - this.JOULES_PER_TICK = energy / 20; - return this; - } - - public TileEntityEnergyMachine setJoulesPerMin(long energy) - { - this.JOULES_PER_TICK = energy / 1200; - return this; - } - - public TileEntityEnergyMachine setJoulesPerHour(long energy) - { - this.JOULES_PER_TICK = energy / 72000; - return this; - } - - /* ******************************************** - * DATA/SAVE/LOAD - * ********************************************* - */ - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - - NBTBase tag = nbt.getTag("energyStored"); - if (tag instanceof NBTTagFloat) - { - this.energyStored = (long) nbt.getFloat("energyStored") * 1000; - } - else if (tag instanceof NBTTagLong) - { - this.energyStored = nbt.getLong("energyStored"); - } - - runWithoutPower = !nbt.getBoolean("shouldPower"); - this.functioning = nbt.getBoolean("isRunning"); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setBoolean("shouldPower", !runWithoutPower); - nbt.setLong("energyStored", this.getEnergyStored()); - nbt.setBoolean("isRunning", this.functioning); - } - -} diff --git a/archive/java/resonantinduction/core/prefab/tile/TileEntityFilterable.java b/archive/java/resonantinduction/core/prefab/tile/TileEntityFilterable.java deleted file mode 100644 index 62401b15..00000000 --- a/archive/java/resonantinduction/core/prefab/tile/TileEntityFilterable.java +++ /dev/null @@ -1,121 +0,0 @@ -package resonantinduction.core.prefab.tile; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.old.api.IFilterable; -import resonantinduction.old.transport.TileEntityAssembly; -import resonantinduction.old.transport.imprinter.ItemImprinter; -import calclavia.lib.prefab.tile.IRotatable; - -public abstract class TileEntityFilterable extends TileEntityAssembly implements IRotatable, IFilterable -{ - private ItemStack filterItem; - private boolean inverted; - public static final int FILTER_SLOT = 0; - public static final int BATERY_DRAIN_SLOT = 1; - - public TileEntityFilterable() - { - super(0); - this.invSlots = 2; - } - - public TileEntityFilterable(long wattsPerTick, long maxEnergy) - { - super(wattsPerTick, maxEnergy); - } - - public TileEntityFilterable(long wattsPerTick) - { - super(wattsPerTick); - } - - /** - * Looks through the things in the filter and finds out which item is being filtered. - * - * @return Is this filterable block filtering this specific ItemStack? - */ - public boolean isFiltering(ItemStack itemStack) - { - if (this.getFilter() != null && itemStack != null) - { - ArrayList checkStacks = ItemImprinter.getFilters(getFilter()); - - if (checkStacks != null) - { - for (ItemStack stack : checkStacks) - { - if (stack.isItemEqual(itemStack)) - { - return !inverted; - } - } - } - } - - return inverted; - } - - @Override - public void setFilter(ItemStack filter) - { - this.filterItem = filter; - this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - @Override - public ItemStack getFilter() - { - return this.filterItem; - } - - public void setInverted(boolean inverted) - { - this.inverted = inverted; - this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - public boolean isInverted() - { - return this.inverted; - } - - public void toggleInversion() - { - setInverted(!isInverted()); - } - - @Override - public ForgeDirection getDirection() - { - return ForgeDirection.getOrientation(this.getBlockMetadata()); - } - - @Override - public void setDirection(ForgeDirection facingDirection) - { - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, facingDirection.ordinal(), 3); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setBoolean("inverted", inverted); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - if (nbt.hasKey("filter")) - { - this.getInventory().setInventorySlotContents(0, ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("filter"))); - } - inverted = nbt.getBoolean("inverted"); - } - -} diff --git a/archive/java/resonantinduction/core/prefab/tile/TileEntityInv.java b/archive/java/resonantinduction/core/prefab/tile/TileEntityInv.java deleted file mode 100644 index 19cc5ae1..00000000 --- a/archive/java/resonantinduction/core/prefab/tile/TileEntityInv.java +++ /dev/null @@ -1,341 +0,0 @@ -package resonantinduction.core.prefab.tile; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.tilenetwork.prefab.NetworkTileEntities; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.access.AccessGroup; -import calclavia.lib.access.AccessUser; -import calclavia.lib.access.GroupRegistry; -import calclavia.lib.access.ISpecialAccess; -import calclavia.lib.access.Nodes; -import calclavia.lib.prefab.tile.TileAdvanced; -import dark.lib.interfaces.IExternalInv; -import dark.lib.interfaces.IInvBox; -import dark.lib.prefab.invgui.InvChest; - -/** - * Prefab for simple object who only need basic inv support and nothing more - * - * @author Darkguardsman - */ -public class TileEntityInv extends TileAdvanced implements IExternalInv, ISidedInventory, ISpecialAccess -{ - protected IInvBox inventory; - protected boolean lockInv; - protected int invSlots = 1; - private Vector3 thisPos; - /** A list of user access data. */ - protected List groups = new ArrayList(); - - @Override - public void initiate() - { - thisPos = new Vector3(this); - } - - public Vector3 getThisPos() - { - if (this.thisPos == null || this.thisPos.intX() != xCoord || this.thisPos.intY() != yCoord || this.thisPos.intZ() != zCoord) - { - this.thisPos = new Vector3(this); - } - return this.thisPos; - } - - @Override - public void invalidate() - { - super.invalidate(); - NetworkTileEntities.invalidate(this); - } - - @Override - public IInvBox getInventory() - { - if (inventory == null) - { - inventory = new InvChest(this, this.invSlots); - } - return inventory; - } - - /** Gets the container class that goes with this tileEntity when creating a gui */ - public Class getContainer() - { - return null; - } - - @Override - public int getSizeInventory() - { - return this.getInventory().getSizeInventory(); - } - - @Override - public ItemStack getStackInSlot(int i) - { - return this.getInventory().getStackInSlot(i); - } - - @Override - public ItemStack decrStackSize(int i, int j) - { - return this.getInventory().decrStackSize(i, j); - } - - @Override - public ItemStack getStackInSlotOnClosing(int i) - { - return this.getInventory().getStackInSlotOnClosing(i); - } - - @Override - public void setInventorySlotContents(int i, ItemStack itemstack) - { - this.getInventory().setInventorySlotContents(i, itemstack); - - } - - @Override - public String getInvName() - { - return this.getInventory().getInvName(); - } - - @Override - public boolean isInvNameLocalized() - { - return this.getInventory().isInvNameLocalized(); - } - - @Override - public int getInventoryStackLimit() - { - return this.getInventory().getInventoryStackLimit(); - } - - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) - { - return this.getInventory().isUseableByPlayer(entityplayer); - } - - @Override - public void openChest() - { - this.getInventory().openChest(); - - } - - @Override - public void closeChest() - { - this.getInventory().closeChest(); - - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) - { - return this.getInventory().isItemValidForSlot(i, itemstack); - } - - @Override - public int[] getAccessibleSlotsFromSide(int var1) - { - return this.getInventory().getAccessibleSlotsFromSide(var1); - } - - @Override - public boolean canInsertItem(int i, ItemStack itemstack, int j) - { - return this.getInventory().canInsertItem(i, itemstack, j); - } - - @Override - public boolean canExtractItem(int i, ItemStack itemstack, int j) - { - return this.getInventory().canExtractItem(i, itemstack, j); - } - - @Override - public boolean canStore(ItemStack stack, int slot, ForgeDirection side) - { - return false; - } - - @Override - public boolean canRemove(ItemStack stack, int slot, ForgeDirection side) - { - if (slot >= this.getSizeInventory()) - { - return false; - } - return true; - } - - /* - * User access - */ - public boolean canOpen(String username) - { - return this.getUserAccess(username) != null && this.getUserAccess(username).hasNode(Nodes.INV_OPEN_NODE) || this.getOwnerGroup().getMembers().size() <= 0; - } - - @Override - public AccessUser getUserAccess(String username) - { - for (AccessGroup group : this.groups) - { - AccessUser user = group.getMember(username); - if (user != null) - { - return user; - } - } - return new AccessUser(username); - } - - @Override - public List getUsers() - { - List users = new ArrayList(); - for (AccessGroup group : this.groups) - { - users.addAll(group.getMembers()); - } - return users; - } - - @Override - public boolean setUserAccess(String player, AccessGroup g, boolean save) - { - return setUserAccess(new AccessUser(player).setTempary(save), g); - } - - @Override - public boolean setUserAccess(AccessUser user, AccessGroup group) - { - boolean bool = false; - - if (user != null && user.getName() != null) - { - bool = this.removeUserAccess(user.getName()) && group == null; - if (group != null) - { - bool = group.addMemeber(user); - } - if (bool) - { - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - } - return bool; - } - - public boolean removeUserAccess(String player) - { - boolean re = false; - for (AccessGroup group : this.groups) - { - AccessUser user = group.getMember(player); - if (user != null && group.removeMemeber(user)) - { - re = true; - } - } - if (re) - { - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - return re; - } - - @Override - public AccessGroup getGroup(String name) - { - for (AccessGroup group : this.getGroups()) - { - if (group.getName().equalsIgnoreCase(name)) - { - return group; - } - } - return null; - } - - @Override - public boolean addGroup(AccessGroup group) - { - if (!this.groups.contains(group)) - { - for (AccessGroup g : this.groups) - { - if (group.getName().equalsIgnoreCase(g.getName())) - { - return false; - } - } - return this.groups.add(group); - } - return false; - } - - @Override - public AccessGroup getOwnerGroup() - { - return this.getGroup("owner"); - } - - @Override - public List getGroups() - { - if (this.groups == null || this.groups.isEmpty()) - { - GroupRegistry.loadNewGroupSet(this); - } - return this.groups; - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.getInventory().loadInv(nbt); - NBTTagList userList = nbt.getTagList("groups"); - if (userList != null && userList.tagCount() > 0) - { - this.groups.clear(); - for (int i = 0; i < userList.tagCount(); i++) - { - AccessGroup group = new AccessGroup(""); - group.load((NBTTagCompound) userList.tagAt(i)); - this.groups.add(group); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - this.getInventory().saveInv(nbt); - - NBTTagList usersTag = new NBTTagList(); - for (AccessGroup group : this.getGroups()) - { - usersTag.appendTag(group.save(new NBTTagCompound())); - } - nbt.setTag("groups", usersTag); - } - -} diff --git a/archive/java/resonantinduction/core/prefab/tile/TileEntityMachine.java b/archive/java/resonantinduction/core/prefab/tile/TileEntityMachine.java deleted file mode 100644 index f9323868..00000000 --- a/archive/java/resonantinduction/core/prefab/tile/TileEntityMachine.java +++ /dev/null @@ -1,245 +0,0 @@ -package resonantinduction.core.prefab.tile; - -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.ResonantInduction; -import resonantinduction.core.network.ISimplePacketReceiver; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.network.PacketHandler; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.PacketDispatcher; -import cpw.mods.fml.common.network.Player; -import dark.lib.IExtraInfo.IExtraTileEntityInfo; -import dark.lib.interfaces.IExternalInv; -import dark.lib.interfaces.IInvBox; - -public abstract class TileEntityMachine extends TileEntityInv implements ISidedInventory, IExternalInv, ISimplePacketReceiver, IExtraTileEntityInfo -{ - /** Number of players with the machine's gui container open */ - protected int playersUsingMachine = 0; - /** Is the machine functioning normally */ - protected boolean functioning = false; - /** Prev state of function of last update */ - protected boolean prevFunctioning = false; - /** Does the machine have a gui */ - protected boolean hasGUI = false; - /** Does teh machine rotate in meta groups of four */ - protected boolean rotateByMetaGroup = false; - /** Can the machine be temp disabled */ - protected boolean canBeDisabled = false; - /** Is the machine enabled by the player */ - protected boolean enabled = true; - /** Is the machine locked by the player */ - protected boolean locked = false; - - /** Inventory manager used by this machine */ - protected IInvBox inventory; - - /** Default generic packet types used by all machines */ - public static enum SimplePacketTypes - { - /** Normal packet data of any kind */ - GENERIC("generic"), - /** Power updates */ - RUNNING("isRunning"), - /** GUI display data update */ - GUI("guiGeneral"), - /** Full tile read/write data from tile NBT */ - NBT("nbtAll"), GUI_EVENT("clientGui"), GUI_COMMAND("clientCommand"), - TERMINAL_OUTPUT("serverTerminal"); - - public String name; - - private SimplePacketTypes(String name) - { - this.name = name; - } - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if (!this.worldObj.isRemote) - { - this.prevFunctioning = this.functioning; - this.functioning = this.isFunctioning(); - - if (prevFunctioning != this.functioning) - { - this.sendPowerUpdate(); - } - this.sendGUIPacket(); - } - } - - /** Can this tile function, or run threw normal processes */ - public boolean canFunction() - { - return this.enabled; - } - - public boolean isFunctioning() - { - if (this.worldObj.isRemote) - { - return this.functioning; - } - else - { - return this.canFunction(); - } - } - - public void doRunningDebug() - { - System.out.println("\n CanRun: " + this.canFunction()); - System.out.println(" RedPower: " + this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)); - System.out.println(" IsRunning: " + this.functioning); - } - - /** Called every tick while this tile entity is disabled. */ - protected void whileDisable() - { - - } - - public ForgeDirection getDirection() - { - if (this.rotateByMetaGroup) - { - switch (this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord) % 4) - { - case 0: - return ForgeDirection.NORTH; - case 1: - return ForgeDirection.SOUTH; - case 2: - return ForgeDirection.SOUTH; - default: - return ForgeDirection.WEST; - } - } - return ForgeDirection.UNKNOWN; - } - - public void setDirection(ForgeDirection direction) - { - if (this.rotateByMetaGroup) - { - switch (direction) - { - case NORTH: - this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord) / 4, 3); - case WEST: - this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, (this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord) / 4) + 1, 3); - case SOUTH: - this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, (this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord) / 4) + 2, 3); - default: - this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, (this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord) / 4) + 3, 3); - } - } - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput dis, Player player) - { - try - { - if (this.worldObj.isRemote) - { - if (id.equalsIgnoreCase(SimplePacketTypes.RUNNING.name)) - { - this.functioning = dis.readBoolean(); - return true; - } - if (id.equalsIgnoreCase(SimplePacketTypes.NBT.name)) - { - this.readFromNBT(PacketHandler.readNBTTagCompound(dis)); - return true; - } - } - } - catch (IOException e) - { - e.printStackTrace(); - } - return false; - } - - /** Sends the tileEntity save data to the client */ - public void sendNBTPacket() - { - if (!this.worldObj.isRemote) - { - NBTTagCompound tag = new NBTTagCompound(); - this.writeToNBT(tag); - PacketHandler.sendPacketToClients(ResonantInduction.PACKET_TILE.getPacket(this, SimplePacketTypes.NBT.name, this, tag), worldObj, new Vector3(this), 64); - } - } - - /** Sends a simple true/false am running power update */ - public void sendPowerUpdate() - { - if (!this.worldObj.isRemote) - { - PacketHandler.sendPacketToClients(ResonantInduction.PACKET_TILE.getPacket(this, SimplePacketTypes.RUNNING.name, this, this.functioning), worldObj, new Vector3(this), 64); - } - } - - /** Sends a gui packet only to the given player */ - public Packet getGUIPacket() - { - return null; - } - - public void sendGUIPacket() - { - Packet packet = this.getGUIPacket(); - if (this.hasGUI && this.getContainer() != null && packet != null) - { - this.playersUsingMachine = 0; - for (Object entity : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1).expand(10, 10, 10))) - { - if (entity instanceof EntityPlayer && ((EntityPlayer) entity).openContainer != null) - { - if (((EntityPlayer) entity).openContainer.getClass().isAssignableFrom(this.getContainer())) - { - this.playersUsingMachine += 1; - PacketDispatcher.sendPacketToPlayer(packet, (Player) entity); - } - } - } - } - } - - @Override - public Packet getDescriptionPacket() - { - return ResonantInduction.PACKET_TILE.getPacket(this, this.functioning); - } - - @Override - public boolean hasExtraConfigs() - { - // TODO Auto-generated method stub - return false; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - // TODO Auto-generated method stub - - } - -} diff --git a/archive/java/resonantinduction/core/prefab/tile/TileGenerator.java b/archive/java/resonantinduction/core/prefab/tile/TileGenerator.java deleted file mode 100644 index 634b2f0b..00000000 --- a/archive/java/resonantinduction/core/prefab/tile/TileGenerator.java +++ /dev/null @@ -1,100 +0,0 @@ -package resonantinduction.core.prefab.tile; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.api.CompatibilityModule; -import universalelectricity.api.vector.Vector3; -import universalelectricity.api.vector.VectorHelper; - -public abstract class TileGenerator extends TileEntityEnergyMachine -{ - public TileGenerator() - { - super(); - } - - public TileGenerator(long wattsPerTick) - { - super(wattsPerTick); - } - - public TileGenerator(long wattsPerTick, long maxEnergy) - { - super(wattsPerTick, maxEnergy); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if (!this.worldObj.isRemote && this.enabled) - { - this.consumeFuel(); - if (this.isFunctioning()) - { - this.produce(); - } - } - } - - @Override - protected void produce() - { - for (ForgeDirection direction : this.getOutputDirections()) - { - if (direction != ForgeDirection.UNKNOWN) - { - TileEntity entity = VectorHelper.getTileEntityFromSide(this.worldObj, new Vector3(this), direction); - if (CompatibilityModule.canConnect(entity, direction.getOpposite())) - { - CompatibilityModule.receiveEnergy(entity, direction.getOpposite(), this.JOULES_PER_TICK, true); - } - } - } - } - - @Override - public long onExtractEnergy(ForgeDirection from, long receive, boolean doReceive) - { - if (this.canConnect(from) && this.getOutputDirections().contains(from)) - { - return Math.min(receive, this.JOULES_PER_TICK); - } - return 0; - } - - @Override - public boolean canFunction() - { - return this.enabled && this.hasFuel(); - } - - /** Does this generator have fuel time left to burn */ - public abstract boolean hasFuel(); - - /** Called each tick to handle anything fuel related */ - public abstract void consumeFuel(); - - /* ******************************************** - * Electricity reception logic - all of which is set to zero to prevent input from wires - * ********************************************* - */ - - @Override - public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) - { - return 0; - } - - @Override - public long getEnergy(ForgeDirection from) - { - return 0; - } - - @Override - public long getEnergyCapacity(ForgeDirection from) - { - return 0; - } -} diff --git a/archive/java/resonantinduction/core/render/InvertX.java b/archive/java/resonantinduction/core/render/InvertX.java deleted file mode 100644 index 1570424e..00000000 --- a/archive/java/resonantinduction/core/render/InvertX.java +++ /dev/null @@ -1,25 +0,0 @@ -package resonantinduction.core.render; - -import codechicken.lib.vec.Matrix4; -import codechicken.lib.vec.Transformation; -import codechicken.lib.vec.VariableTransformation; - -public class InvertX extends VariableTransformation -{ - public InvertX() - { - super(new Matrix4(1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1)); - } - - @Override - public Transformation inverse() - { - return this; - } - - @Override - public void apply(codechicken.lib.vec.Vector3 vec) - { - vec.x = -vec.x; - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/core/resource/BlockGasOre.java b/archive/java/resonantinduction/core/resource/BlockGasOre.java deleted file mode 100644 index a7ba7d23..00000000 --- a/archive/java/resonantinduction/core/resource/BlockGasOre.java +++ /dev/null @@ -1,196 +0,0 @@ -package resonantinduction.core.resource; - -import java.awt.Color; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.MapColor; -import net.minecraft.block.material.Material; -import net.minecraft.block.material.MaterialTransparent; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidBlock; -import resonantinduction.core.Reference; -import resonantinduction.core.Settings; -import resonantinduction.mechanical.fluid.EnumGas; -import universalelectricity.api.vector.Vector3; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Gas that is designed to generate underground in the same way as an ore - * - * TODO code actual gas behavior such as expanding to fill an area but at the same time losing - * volume - * - * @author DarkGuardsman - */ -public class BlockGasOre extends Block implements IFluidBlock -{ - public static final int[] volumePerMeta = new int[] { 10, 35, 75, 125, 250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 12800, 256000, 512000 }; - public static final Material gas = new MaterialTransparent(MapColor.airColor).setReplaceable(); - - public BlockGasOre() - { - super(Settings.CONFIGURATION.getBlock("GasBlock", Settings.getNextBlockID()).getInt(), gas); - this.setUnlocalizedName("BlockGas"); - this.setTickRandomly(true); - } - - @Override - public int tickRate(World par1World) - { - return 1; - } - - @Override - public void updateTick(World world, int x, int y, int z, Random rand) - { - if (!world.isRemote) - { - - final Vector3 vec = new Vector3(x, y, z); - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - int meta = world.getBlockMetadata(x, y, z); - - Vector3 sVec = vec.clone().modifyPositionFromSide(dir); - int sMeta = sVec.getBlockMetadata(world); - int blockID = sVec.getBlockID(world); - Block block = Block.blocksList[blockID]; - - if (blockID == 0 || block == null || block != null && block.isAirBlock(world, x, y, z) && blockID != this.blockID) - { - if (meta == 0) - { - world.setBlockToAir(x, y, z); - break; - } - else - { - world.setBlock(x, y, z, this.blockID, meta / 2, 2); - sVec.setBlock(world, this.blockID, meta / 2, 2); - break; - } - } - else if (blockID == this.blockID && meta > sMeta) - { - meta += sMeta; - world.setBlock(x, y, z, this.blockID, meta / 2, 2); - sVec.setBlock(world, this.blockID, meta / 2, 2); - break; - } - } - } - } - - /* IFluidBlock */ - @Override - public FluidStack drain(World world, int x, int y, int z, boolean doDrain) - { - int meta = world.getBlockMetadata(x, y, z); - FluidStack fluid = new FluidStack(EnumGas.NATURAL_GAS.getGas(), volumePerMeta[meta]); - if (doDrain || fluid == null) - { - world.setBlockToAir(x, y, z); - } - return fluid; - } - - @Override - public boolean canDrain(World world, int x, int y, int z) - { - return false; - } - - @Override - public Fluid getFluid() - { - return EnumGas.NATURAL_GAS.getGas(); - } - - @Override - public int idDropped(int par1, Random par2Random, int par3) - { - return 0; - } - - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) - { - return null; - } - - @Override - public boolean isCollidable() - { - return false; - } - - @Override - public Icon getIcon(int par1, int par2) - { - return this.blockIcon; - } - - @Override - public void registerIcons(IconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon(Reference.PREFIX + "gas"); - } - - @Override - public int getRenderBlockPass() - { - return 1; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() - { - return Color.yellow.getRGB(); - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(int par1) - { - // TODO make the color darker as the meta value goes higher - return this.getBlockColor(); - } - - @SideOnly(Side.CLIENT) - @Override - public int colorMultiplier(IBlockAccess world, int x, int y, int z) - { - return this.getRenderColor(world.getBlockMetadata(x, y, z)); - } - - @Override - public void getSubBlocks(int blockID, CreativeTabs tab, List creativeTabList) - { - creativeTabList.add(new ItemStack(blockID, 1, 15)); - } -} diff --git a/archive/java/resonantinduction/core/resource/BlockOre.java b/archive/java/resonantinduction/core/resource/BlockOre.java deleted file mode 100644 index 4dc14a2c..00000000 --- a/archive/java/resonantinduction/core/resource/BlockOre.java +++ /dev/null @@ -1,167 +0,0 @@ -package resonantinduction.core.resource; - -import java.util.List; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.oredict.OreDictionary; -import resonantinduction.core.Reference; -import resonantinduction.core.Settings; -import resonantinduction.old.core.recipe.RecipeLoader; -import calclavia.lib.ore.OreGenReplaceStone; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.EnumMaterial; -import dark.lib.IExtraInfo.IExtraBlockInfo; - -public class BlockOre extends Block implements IExtraBlockInfo -{ - Icon[] icons = new Icon[EnumMaterial.values().length]; - - public BlockOre() - { - super(Settings.CONFIGURATION.getBlock("Ore", Settings.getNextBlockID()).getInt(), Material.rock); - this.setCreativeTab(CreativeTabs.tabBlock); - this.setUnlocalizedName(Reference.PREFIX + "Ore"); - this.setHardness(2.5f); - this.setResistance(5.0f); - - for (OreData data : OreData.values()) - { - data.stack = new ItemStack(this.blockID, 1, data.ordinal()); - } - } - - @Override - public int damageDropped(int par1) - { - return par1; - } - - @Override - public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (OreData data : OreData.values()) - { - par3List.add(data.stack); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) - { - for (OreData data : OreData.values()) - { - data.oreIcon = par1IconRegister.registerIcon(Reference.PREFIX + data.name + "Ore"); - } - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int metadata) - { - if (metadata < OreData.values().length) - { - return OreData.values()[metadata].oreIcon; - } - return Block.stone.getIcon(side, metadata); - } - - @Override - public void loadOreNames() - { - for (OreData data : OreData.values()) - { - OreDictionary.registerOre(data.oreName, data.stack); - } - } - - public static enum OreData - { - TIN(EnumMaterial.TIN, "tin", "oreTin", 20, 8, 128), - COPPER(EnumMaterial.COPPER, "copper", "copperOre", 20, 8, 128), - SILVER(EnumMaterial.SILVER, "silver", "silverOre", 3, 8, 45), - LEAD(EnumMaterial.LEAD, "lead", "leadOre", 1, 6, 30), - Bauxite(EnumMaterial.ALUMINIUM, "bauxite", "bauxiteOre", 4, 6, 128); - - public String name, oreName; - public ItemStack stack; - public EnumMaterial mat; - - @SideOnly(Side.CLIENT) - public Icon oreIcon; - - /* ORE GENERATOR OPTIONS */ - public boolean doWorldGen = true; - public int ammount, branch, maxY; - - private OreData(EnumMaterial mat, String name, String oreName, int ammount, int branch, int maxY) - { - this.name = name; - this.oreName = oreName; - this.mat = mat; - - this.maxY = maxY; - this.ammount = ammount; - this.branch = branch; - } - - public OreGenReplaceStone getGeneratorSettings() - { - if (this.doWorldGen) - { - ItemStack stack = new ItemStack(RecipeLoader.blockOre, 1, this.ordinal()); - return (OreGenReplaceStone) new OreGenReplaceStone(this.name, this.name + "Ore", stack, this.maxY, this.ammount, this.branch).enable(Settings.CONFIGURATION); - } - return null; - } - } - - @Override - public boolean hasExtraConfigs() - { - // TODO Auto-generated method stub - return false; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - // TODO Auto-generated method stub - - } - - @Override - public TileEntity createNewTileEntity(World world) - { - // TODO Auto-generated method stub - return null; - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - // TODO Auto-generated method stub - - } - - @Override - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - // TODO Auto-generated method stub - - } -} diff --git a/archive/java/resonantinduction/core/resource/GasOreGenerator.java b/archive/java/resonantinduction/core/resource/GasOreGenerator.java deleted file mode 100644 index d353b30a..00000000 --- a/archive/java/resonantinduction/core/resource/GasOreGenerator.java +++ /dev/null @@ -1,128 +0,0 @@ -package resonantinduction.core.resource; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.world.gen.ChunkProviderEnd; -import net.minecraft.world.gen.ChunkProviderHell; -import net.minecraftforge.fluids.FluidStack; -import resonantinduction.old.core.recipe.RecipeLoader; -import cpw.mods.fml.common.IWorldGenerator; - -public class GasOreGenerator implements IWorldGenerator -{ - - public int minGenerateLevel = 6; - public int maxGenerateLevel = 50; - public int amountPerChunk = 3; - public int amountPerBranch = 15; - public int replaceID = 1; - - public FluidStack stack; - - @Override - public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) - { - chunkX = chunkX << 4; - chunkZ = chunkZ << 4; - - if (this.isOreGeneratedInWorld(world, chunkGenerator)) - { - this.generate(world, rand, chunkX, chunkZ); - } - } - - public void generate(World world, Random random, int varX, int varZ) - { - try - { - // TODO get the biome of the chunk and generate more gas in swamp biomes - // chunk = world.getChunkFromChunkCoords(varX, varZ); - for (int i = 0; i < this.amountPerChunk; i++) - { - int x = varX + random.nextInt(16); - int z = varZ + random.nextInt(16); - int y = random.nextInt(Math.max(this.maxGenerateLevel - this.minGenerateLevel, 0)) + this.minGenerateLevel; - this.generateReplace(world, random, x, y, z); - } - } - catch (Exception e) - { - System.out.println("[CoreMachine]Error generating natural gas"); - e.printStackTrace(); - } - } - - public boolean generateReplace(World world, Random random, int par3, int par4, int par5) - { - float var6 = random.nextFloat() * (float) Math.PI; - double var7 = par3 + 8 + MathHelper.sin(var6) * this.amountPerBranch / 8.0F; - double var9 = par3 + 8 - MathHelper.sin(var6) * this.amountPerBranch / 8.0F; - double var11 = par5 + 8 + MathHelper.cos(var6) * this.amountPerBranch / 8.0F; - double var13 = par5 + 8 - MathHelper.cos(var6) * this.amountPerBranch / 8.0F; - double var15 = par4 + random.nextInt(3) - 2; - double var17 = par4 + random.nextInt(3) - 2; - - for (int oreCount = 0; oreCount <= this.amountPerBranch; ++oreCount) - { - double var20 = var7 + (var9 - var7) * oreCount / this.amountPerBranch; - double var22 = var15 + (var17 - var15) * oreCount / this.amountPerBranch; - double var24 = var11 + (var13 - var11) * oreCount / this.amountPerBranch; - double var26 = random.nextDouble() * this.amountPerBranch / 16.0D; - double var28 = (MathHelper.sin(oreCount * (float) Math.PI / this.amountPerBranch) + 1.0F) * var26 + 1.0D; - double var30 = (MathHelper.sin(oreCount * (float) Math.PI / this.amountPerBranch) + 1.0F) * var26 + 1.0D; - int var32 = MathHelper.floor_double(var20 - var28 / 2.0D); - int var33 = MathHelper.floor_double(var22 - var30 / 2.0D); - int var34 = MathHelper.floor_double(var24 - var28 / 2.0D); - int var35 = MathHelper.floor_double(var20 + var28 / 2.0D); - int var36 = MathHelper.floor_double(var22 + var30 / 2.0D); - int var37 = MathHelper.floor_double(var24 + var28 / 2.0D); - - for (int x = var32; x <= var35; ++x) - { - double var39 = (x + 0.5D - var20) / (var28 / 2.0D); - - if (var39 * var39 < 1.0D) - { - for (int y = var33; y <= var36; ++y) - { - double var42 = (y + 0.5D - var22) / (var30 / 2.0D); - - if (var39 * var39 + var42 * var42 < 1.0D) - { - for (int z = var34; z <= var37; ++z) - { - double var45 = (z + 0.5D - var24) / (var28 / 2.0D); - - int blockid = world.getBlockId(x, y, z); - Block block = Block.blocksList[blockid]; - if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && (block == null || block.isAirBlock(world, x, y, z) || block.canBeReplacedByLeaves(world, x, y, z) || blockid == this.replaceID)) - { - world.setBlock(x, y, z, RecipeLoader.blockGas.blockID, 10 + world.rand.nextInt(5), 2); - } - } - } - } - } - } - } - - return true; - } - - public boolean isOreGeneratedInWorld(World world, IChunkProvider chunkGenerator) - { - if (chunkGenerator instanceof ChunkProviderHell) - { - return false; - } - if (chunkGenerator instanceof ChunkProviderEnd) - { - return false; - } - return true; - } -} diff --git a/archive/java/resonantinduction/core/resource/ResourceGenerator.java b/archive/java/resonantinduction/core/resource/ResourceGenerator.java deleted file mode 100644 index 8a7ed8ed..00000000 --- a/archive/java/resonantinduction/core/resource/ResourceGenerator.java +++ /dev/null @@ -1,151 +0,0 @@ -package resonantinduction.core.resource; - -import java.awt.Color; -import java.awt.image.BufferedImage; -import java.io.InputStream; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; - -import javax.imageio.ImageIO; - -import net.minecraft.client.Minecraft; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.event.ForgeSubscribe; -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.resource.item.ItemDust; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -public class ResourceGenerator -{ - public static final ResourceGenerator INSTANCE = new ResourceGenerator(); - public static final Set materialNames = new HashSet(); - public static final HashMap materialColors = new HashMap(); - - @ForgeSubscribe - public void oreRegisterEvent(OreRegisterEvent evt) - { - if (evt.Name.startsWith("ingot")) - { - String ingotName = evt.Name.replace("ingot", ""); - - if (OreDetectionBlackList.isIngotBlackListed("ingot" + ingotName) || OreDetectionBlackList.isOreBlackListed("ore" + ingotName)) - return; - - ResourceGenerator.materialNames.add(ingotName.toLowerCase()); - } - } - - public static void generateDusts() - { - for (String materialName : materialNames) - { - String name = materialName.substring(0, 1).toUpperCase() + materialName.substring(1); - - if (OreDictionary.getOres("ore" + name).size() > 0) - { - // if (OreDictionary.getOres("dust" + name).size() == 0) - { - ItemDust.dusts.add(ResonantInduction.itemDust.getStackFromDust(materialName)); - OreDictionary.registerOre("dust" + name, ResonantInduction.itemDust.getStackFromDust(materialName)); - - } - - // Add to machine recipes - ItemStack dust = OreDictionary.getOres("dust" + name).get(0).copy(); - dust.stackSize = 2; - MachineRecipes.INSTANCE.addRecipe(RecipeType.GRINDER, "ore" + name, dust); - } - } - } - - @ForgeSubscribe - @SideOnly(Side.CLIENT) - public void reloadTextures(TextureStitchEvent.Post e) - { - computeColors(); - } - - @SideOnly(Side.CLIENT) - public static void computeColors() - { - for (String ingotName : materialNames) - { - // Compute color - int totalR = 0; - int totalG = 0; - int totalB = 0; - - int colorCount = 0; - - for (ItemStack ingotStack : OreDictionary.getOres("ingot" + ingotName.substring(0, 1).toUpperCase() + ingotName.substring(1))) - { - Item theIngot = ingotStack.getItem(); - - try - { - Icon icon = theIngot.getIconIndex(ingotStack); - String iconString = icon.getIconName(); - - if (iconString != null && !iconString.contains("MISSING_ICON_ITEM")) - { - iconString = (iconString.contains(":") ? iconString.replace(":", ":" + Reference.ITEM_TEXTURE_DIRECTORY) : Reference.ITEM_TEXTURE_DIRECTORY + iconString) + ".png"; - ResourceLocation textureLocation = new ResourceLocation(iconString); - - InputStream inputstream = Minecraft.getMinecraft().getResourceManager().getResource(textureLocation).getInputStream(); - BufferedImage bufferedimage = ImageIO.read(inputstream); - - int width = bufferedimage.getWidth(); - int height = bufferedimage.getWidth(); - - for (int x = 0; x < width; x++) - { - for (int y = 0; y < height; y++) - { - Color rgb = new Color(bufferedimage.getRGB(x, y)); - totalR += rgb.getRed(); - totalG += rgb.getGreen(); - totalB += rgb.getBlue(); - colorCount++; - } - } - } - } - catch (Exception e) - { - System.out.println("Failed to compute colors for: " + theIngot); - e.printStackTrace(); - } - } - - if (colorCount > 0) - { - totalR /= colorCount; - totalG /= colorCount; - totalB /= colorCount; - int resultantColor = new Color(totalR, totalG, totalB).brighter().getRGB(); - materialColors.put(ingotName, resultantColor); - } - - if (!materialColors.containsKey(ingotName)) - { - materialColors.put(ingotName, 0xFFFFFF); - } - } - } -} diff --git a/archive/java/resonantinduction/core/resource/fluid/BlockFluidMixture.java b/archive/java/resonantinduction/core/resource/fluid/BlockFluidMixture.java deleted file mode 100644 index 219b2512..00000000 --- a/archive/java/resonantinduction/core/resource/fluid/BlockFluidMixture.java +++ /dev/null @@ -1,53 +0,0 @@ -package resonantinduction.core.resource.fluid; - -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.fluids.BlockFluidFinite; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -import resonantinduction.core.ResonantInduction; - -/** - * @author Calclavia - * - */ -public class BlockFluidMixture extends BlockFluidFinite implements ITileEntityProvider -{ - public BlockFluidMixture(int id, Fluid fluid) - { - super(id, fluid, Material.water); - this.setTextureName("water_flow"); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) - { - // If this item can be smelted into another fluid, add it to the mixture. - } - - /* IFluidBlock */ - @Override - public FluidStack drain(World world, int x, int y, int z, boolean doDrain) - { - TileFluidMixture tileFluid = (TileFluidMixture) world.getBlockTileEntity(x, y, z); - FluidStack stack = new FluidStack(ResonantInduction.MIXTURE, (int) (FluidContainerRegistry.BUCKET_VOLUME * this.getFilledPercentage(world, x, y, z))); - tileFluid.writeFluidToNBT(stack.tag); - return stack; - } - - @Override - public boolean canDrain(World world, int x, int y, int z) - { - return true; - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileFluidMixture(); - } -} diff --git a/archive/java/resonantinduction/core/resource/fluid/TileFluidMixture.java b/archive/java/resonantinduction/core/resource/fluid/TileFluidMixture.java deleted file mode 100644 index d039cb5f..00000000 --- a/archive/java/resonantinduction/core/resource/fluid/TileFluidMixture.java +++ /dev/null @@ -1,90 +0,0 @@ -package resonantinduction.core.resource.fluid; - -import java.util.TreeSet; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraftforge.fluids.FluidStack; -import calclavia.lib.prefab.tile.TileAdvanced; - -/** - * @author Calclavia - * - */ -public class TileFluidMixture extends TileAdvanced -{ - public final TreeSet fluids = new TreeSet(); - - @Override - public boolean canUpdate() - { - return false; - } - - public void mix(FluidStack fluid) - { - if (fluids.contains(fluid)) - { - for (FluidStack checkFluid : fluids) - { - if (fluid.equals(checkFluid)) - { - checkFluid.amount += fluid.amount; - } - } - } - else - { - fluids.add(fluid); - } - } - - /** - * @return The color of the liquid based on the fluidStacks stored. - */ - public int getColor() - { - return 0xFFFFFF; - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - readFluidFromNBT(nbt); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - writeFluidToNBT(nbt); - } - - public void readFluidFromNBT(NBTTagCompound nbt) - { - fluids.clear(); - - NBTTagList nbtList = nbt.getTagList("fluids"); - - for (int i = 0; i < nbtList.tagCount(); ++i) - { - NBTTagCompound fluidNBT = (NBTTagCompound) nbtList.tagAt(i); - fluids.add(FluidStack.loadFluidStackFromNBT(fluidNBT)); - } - } - - public void writeFluidToNBT(NBTTagCompound nbt) - { - NBTTagList nbtList = new NBTTagList(); - - for (FluidStack fluid : fluids) - { - NBTTagCompound nbtElement = new NBTTagCompound(); - fluid.writeToNBT(nbtElement); - nbtList.appendTag(nbtElement); - } - - nbt.setTag("fluids", nbtList); - } -} diff --git a/archive/java/resonantinduction/core/resource/item/ItemBlockOre.java b/archive/java/resonantinduction/core/resource/item/ItemBlockOre.java deleted file mode 100644 index 2c3bdd57..00000000 --- a/archive/java/resonantinduction/core/resource/item/ItemBlockOre.java +++ /dev/null @@ -1,34 +0,0 @@ -package resonantinduction.core.resource.item; - -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import resonantinduction.core.Reference; -import resonantinduction.core.resource.BlockOre.OreData; - -public class ItemBlockOre extends ItemBlock -{ - - public ItemBlockOre(int par1) - { - super(par1); - this.setMaxDamage(0); - this.setHasSubtypes(true); - } - - @Override - public int getMetadata(int damage) - { - return damage; - } - - @Override - public String getUnlocalizedName(ItemStack par1ItemStack) - { - if (par1ItemStack != null && par1ItemStack.getItemDamage() < OreData.values().length) - { - return "tile." + Reference.PREFIX + OreData.values()[par1ItemStack.getItemDamage()].name + "Ore"; - } - return super.getUnlocalizedName(); - } - -} diff --git a/archive/java/resonantinduction/core/resource/item/ItemDust.java b/archive/java/resonantinduction/core/resource/item/ItemDust.java deleted file mode 100644 index 3f742aba..00000000 --- a/archive/java/resonantinduction/core/resource/item/ItemDust.java +++ /dev/null @@ -1,90 +0,0 @@ -package resonantinduction.core.resource.item; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.oredict.OreDictionary; -import resonantinduction.core.Reference; -import resonantinduction.core.prefab.item.ItemBase; -import resonantinduction.core.resource.ResourceGenerator; -import calclavia.lib.utility.LanguageUtility; -import calclavia.lib.utility.NBTUtility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * An item used for auto-generated dusts based on registered ingots in the OreDict. - * - * @author Calclavia - * - */ -public class ItemDust extends ItemBase -{ - public static final Set dusts = new HashSet(); - - public ItemDust(int id) - { - super("dust", id); - this.setTextureName(Reference.PREFIX + "dust"); - } - - @Override - public String getItemDisplayName(ItemStack is) - { - String dustName = getDustFromStack(is); - ItemStack type = OreDictionary.getOres("ingot" + dustName.substring(0, 1).toUpperCase() + dustName.substring(1)).get(0); - - String name = type.getDisplayName().replace(LanguageUtility.getLocal("misc.resonantinduction.ingot"), ""); - return (LanguageUtility.getLocal(this.getUnlocalizedName() + ".name")).replace("%v", name).replace(" ", " "); - } - - public ItemStack getStackFromDust(String name) - { - ItemStack itemStack = new ItemStack(this); - NBTTagCompound nbt = NBTUtility.getNBTTagCompound(itemStack); - nbt.setString("name", name); - return itemStack; - } - - public static String getDustFromStack(ItemStack itemStack) - { - NBTTagCompound nbt = NBTUtility.getNBTTagCompound(itemStack); - - if (nbt.hasKey("name")) - { - return nbt.getString("name"); - } - - return null; - } - - @Override - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (ItemStack dust : dusts) - { - par3List.add(dust); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack itemStack, int par2) - { - /** - * Auto-color based on the texture of the ingot. - */ - String name = ItemDust.getDustFromStack(itemStack); - - if (ResourceGenerator.materialColors.containsKey(name)) - { - return ResourceGenerator.materialColors.get(name); - } - - return 16777215; - } -} diff --git a/archive/java/resonantinduction/core/resource/item/ItemParts.java b/archive/java/resonantinduction/core/resource/item/ItemParts.java deleted file mode 100644 index 45580b55..00000000 --- a/archive/java/resonantinduction/core/resource/item/ItemParts.java +++ /dev/null @@ -1,130 +0,0 @@ -package resonantinduction.core.resource.item; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.oredict.OreDictionary; -import resonantinduction.core.Reference; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.item.ItemBase; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.IExtraInfo.IExtraItemInfo; - -/** - * A meta data item containing parts of various crafting recipes. These parts do not do anything but - * allow new crafting recipes to be created. - * - * @author DarkGuardsman - */ -public class ItemParts extends ItemBase implements IExtraItemInfo -{ - public ItemParts() - { - super("DMParts", Settings.getNextItemID()); - this.setHasSubtypes(true); - this.setMaxDamage(0); - this.setMaxStackSize(64); - this.setCreativeTab(CreativeTabs.tabMaterials); - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) - { - if (itemStack != null && itemStack.getItemDamage() < Parts.values().length) - { - return "item." + Parts.values()[itemStack.getItemDamage()].name; - } - return super.getUnlocalizedName(); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int meta) - { - if (meta < Parts.values().length) - { - return Parts.values()[meta].icon; - } - return this.itemIcon; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) - { - super.registerIcons(iconRegister); - for (Parts part : Parts.values()) - { - part.icon = iconRegister.registerIcon(Reference.PREFIX + "part." + part.name); - } - } - - @Override - public int getMetadata(int meta) - { - return meta; - } - - @Override - public void getSubItems(int blockID, CreativeTabs tab, List itemStackList) - { - for (Parts part : Parts.values()) - { - if (part.show) - { - itemStackList.add(new ItemStack(this, 1, part.ordinal())); - } - } - } - - public static enum Parts - { - Seal("leatherSeal"), GasSeal("gasSeal"), Tank("unfinishedTank"), Valve("valvePart"), - MiningIcon("miningIcon", false), CircuitBasic("circuitBasic"), - CircuitAdvanced("circuitAdvanced"), CircuitElite("circuitElite"), Motor("motor"), - IC("ic_chip"), COIL("coilCopper"), LASER("diodeLaser"); - - public String name; - public Icon icon; - boolean show = true; - - private Parts(String name) - { - this.name = name; - } - - private Parts(String name, boolean show) - { - this(name); - this.show = show; - } - } - - @Override - public boolean hasExtraConfigs() - { - return false; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - // TODO Auto-generated method stub - - } - - @Override - public void loadOreNames() - { - for (Parts part : Parts.values()) - { - OreDictionary.registerOre(part.name, new ItemStack(this, 1, part.ordinal())); - } - - } -} diff --git a/archive/java/resonantinduction/core/tilenetwork/INetworkContainer.java b/archive/java/resonantinduction/core/tilenetwork/INetworkContainer.java deleted file mode 100644 index 2935edbb..00000000 --- a/archive/java/resonantinduction/core/tilenetwork/INetworkContainer.java +++ /dev/null @@ -1,22 +0,0 @@ -package resonantinduction.core.tilenetwork; - -/** - * Used on tiles that can contain more than one tile network. Currently WIP so don't use unless you - * know what your doing. When using this use networks like items and store them in slots. - * - * @author DarkGuardsman - */ -public interface INetworkContainer -{ - /** - * Gets a list of all networks slots and their connected networks. Used both to see the max - * limit of networks this tile may contain, and if there are networks currently in use - */ - public ITileNetwork[] getContainedNetworks(); - - /** Sets the network in the given slot */ - public boolean setNetwork(int slot, ITileNetwork network); - - /** Gets the network in the slot */ - public ITileNetwork getNetwork(int slot); -} diff --git a/archive/java/resonantinduction/core/tilenetwork/INetworkEnergyPart.java b/archive/java/resonantinduction/core/tilenetwork/INetworkEnergyPart.java deleted file mode 100644 index e5c43982..00000000 --- a/archive/java/resonantinduction/core/tilenetwork/INetworkEnergyPart.java +++ /dev/null @@ -1,22 +0,0 @@ -package resonantinduction.core.tilenetwork; - -import universalelectricity.api.energy.IEnergyContainer; - -/** - * Tiles that use NetworkSharedPower class should implements this. All methods in IElectricalStorage - * should point to the network instead of the tile. This is why more energy methods are added to - * this interface - * - * @author DarkGuardsman - */ -public interface INetworkEnergyPart extends INetworkPart, IEnergyContainer -{ - /** Gets the energy stored in the part */ - public long getPartEnergy(); - - /** Gets the max energy storage limit of the part */ - public long getPartMaxEnergy(); - - /** Sets the energy stored in the part */ - public void setPartEnergy(long energy); -} diff --git a/archive/java/resonantinduction/core/tilenetwork/INetworkPart.java b/archive/java/resonantinduction/core/tilenetwork/INetworkPart.java deleted file mode 100644 index 99a9aedb..00000000 --- a/archive/java/resonantinduction/core/tilenetwork/INetworkPart.java +++ /dev/null @@ -1,20 +0,0 @@ -package resonantinduction.core.tilenetwork; - -import java.util.List; - -import net.minecraft.tileentity.TileEntity; - -public interface INetworkPart extends ITileConnector -{ - /** Array of connections this tile has to other tiles */ - public List getNetworkConnections(); - - /** Update the connection this tile has to other tiles */ - public void refresh(); - - /** Gets the networkPart's primary network */ - public ITileNetwork getTileNetwork(); - - /** Sets the networkPart's primary network */ - public void setTileNetwork(ITileNetwork network); -} diff --git a/archive/java/resonantinduction/core/tilenetwork/ITileConnector.java b/archive/java/resonantinduction/core/tilenetwork/ITileConnector.java deleted file mode 100644 index 6e62ca5d..00000000 --- a/archive/java/resonantinduction/core/tilenetwork/ITileConnector.java +++ /dev/null @@ -1,44 +0,0 @@ -package resonantinduction.core.tilenetwork; - -import net.minecraftforge.common.ForgeDirection; - -/** - * Used on tiles that want control over what can connect to there device. It is suggest that other - * interfaces for connection be routed threw this to reduce the need to change things - * - * @author DarkGuardsman - */ -public interface ITileConnector -{ - /** Can this tile connect on the given side */ - public boolean canTileConnect(Connection type, ForgeDirection dir); - - /** Types of connections */ - public static enum Connection - { - /** Energy from BC, UE, IC2 */ - Eletricity(), - /** Fluids from anything including BC pipes, DM pipes, Mek pipes */ - FLUIDS(), - /** Force mainly from rotating rods */ - FORCE(), - /** Hydraulic pressure from DM pipe */ - FLUID_PRESSURE(), AIR_PRESSURE(), - /** Item pipe */ - ITEMS(), - /** Data line input */ - DATA(), - /** Another tile entity */ - TILE(), - /** Network of tile entities */ - NETWORK(), - /** Thermal connection */ - HEAT(), - /** Wire containing several wires of unknown color */ - MULTI_WIRE(), - /** Bundle of pipes containing several colored pipes */ - MULTI_PIPE(), - /** Device that contains several networks that can be of any type */ - MULTI_NETWORK(); - } -} diff --git a/archive/java/resonantinduction/core/tilenetwork/ITileNetwork.java b/archive/java/resonantinduction/core/tilenetwork/ITileNetwork.java deleted file mode 100644 index 6b1283f2..00000000 --- a/archive/java/resonantinduction/core/tilenetwork/ITileNetwork.java +++ /dev/null @@ -1,68 +0,0 @@ -package resonantinduction.core.tilenetwork; - -import java.util.Set; - -import net.minecraft.tileentity.TileEntity; - -/** - * Applies to objects that act as a collection of tile entities. - * - * @author DarkGuardsman - */ -public interface ITileNetwork -{ - /** Gets the name of the network */ - public String getName(); - - /** Gets a list of all tiles that are part of this network */ - public Set getMembers(); - - /** - * Called when something want the network to add the tile - * - * @param entity - tile in question - * @param member - add it as a member if true - * @return true if added without issue - */ - public boolean addTile(TileEntity ent, boolean member); - - /** Removes a tile from all parts of the network */ - public boolean removeTile(TileEntity ent); - - /** Called when this network is just created */ - public void onCreated(); - - /** How many ticks should base between updates, return 0 or bellow for no ticks */ - public int getUpdateRate(); - - /** Called every so many ticks so the network has a chance to update */ - public void updateTick(); - - /** - * Called every so many mins when the networks needs to refresh and repair. Each part should - * still handle there own refresh when edited, or updated. This is more for the network to do - * house cleaning - */ - public void refreshTick(); - - /** Called when two networks try to merge together */ - public void mergeNetwork(ITileNetwork network, INetworkPart mergePoint); - - /** Called when a peace of the network is removed and might need to split in two */ - public void splitNetwork(INetworkPart splitPoint); - - /** Check by the network handle if this network is invalid or no longer functional */ - public boolean isInvalid(); - - /** - * This is called when your network is considered invalid. You should cut all ties in the - * network to its object so GC will delete it - */ - public void invalidate(); - - /** Called when the network needs to save */ - public void save(); - - /** Called when the network needs to load */ - public void load(); -} diff --git a/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkPathFinder.java b/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkPathFinder.java deleted file mode 100644 index eb3bc7d9..00000000 --- a/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkPathFinder.java +++ /dev/null @@ -1,52 +0,0 @@ -package resonantinduction.core.tilenetwork.prefab; - -import java.util.HashSet; -import java.util.Set; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import resonantinduction.core.tilenetwork.INetworkPart; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.path.IPathCallBack; -import calclavia.lib.path.Pathfinder; - -/** Check if a conductor connects with another. */ -public class NetworkPathFinder extends Pathfinder -{ - public NetworkPathFinder(final World world, final INetworkPart targetPoint, final INetworkPart... ignoredTiles) - { - super(new IPathCallBack() - { - @Override - public Set getConnectedNodes(Pathfinder finder, Vector3 currentNode) - { - Set neighbors = new HashSet(); - TileEntity tile = currentNode.getTileEntity(world); - if (tile instanceof INetworkPart) - { - for (TileEntity ent : ((INetworkPart) tile).getNetworkConnections()) - { - if (ent instanceof INetworkPart) - { - neighbors.add(new Vector3(ent)); - } - } - } - - return neighbors; - } - - @Override - public boolean onSearch(Pathfinder finder, Vector3 start, Vector3 node) - { - if (node.getTileEntity(world) == targetPoint) - { - finder.results.add(node); - return true; - } - - return false; - } - }); - } -} diff --git a/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkResourceSupply.java b/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkResourceSupply.java deleted file mode 100644 index 5ac6a801..00000000 --- a/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkResourceSupply.java +++ /dev/null @@ -1,31 +0,0 @@ -package resonantinduction.core.tilenetwork.prefab; - -import java.util.HashMap; -import java.util.List; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.tilenetwork.INetworkPart; - -/** - * Network that supplies resources to tiles that demand a set resource - * - * @param C - Storage class used to handle what the network transports - * @param I - Base acceptor class - * @author DarkGuardsman - */ -public class NetworkResourceSupply extends NetworkTileEntities -{ - protected C storage; - protected HashMap> acceptors = new HashMap(); - - public NetworkResourceSupply(INetworkPart... parts) - { - super(parts); - } - - public boolean isValidAcceptor(TileEntity entity) - { - return entity != null && !entity.isInvalid(); - } -} diff --git a/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkSharedPower.java b/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkSharedPower.java deleted file mode 100644 index 1ba43bb3..00000000 --- a/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkSharedPower.java +++ /dev/null @@ -1,156 +0,0 @@ -package resonantinduction.core.tilenetwork.prefab; - -import net.minecraft.tileentity.TileEntity; -import resonantinduction.core.tilenetwork.INetworkEnergyPart; -import resonantinduction.core.tilenetwork.INetworkPart; -import dark.lib.interfaces.IPowerLess; - -/** - * Used for tile networks that only need to share power or act like a group battery that doesn't - * store power on world save - * - * @author DarkGuardsman - */ -public class NetworkSharedPower extends NetworkTileEntities implements IPowerLess -{ - private long energy, energyMax; - private boolean runPowerLess; - - public NetworkSharedPower(INetworkPart... parts) - { - super(parts); - } - - @Override - public boolean isValidMember(INetworkPart part) - { - return super.isValidMember(part) && part instanceof INetworkEnergyPart; - } - - public long addPower(TileEntity entity, long receive, boolean doReceive) - { - if (!this.runPowerLess() && receive > 0) - { - long prevEnergyStored = this.getEnergy(); - long newStoredEnergy = Math.min(this.getEnergy() + receive, this.getEnergyCapacity()); - - if (doReceive) - { - this.setEnergy(newStoredEnergy); - } - - return Math.max(newStoredEnergy - prevEnergyStored, 0); - } - return 0; - } - - public long removePower(TileEntity entity, long request, boolean doExtract) - { - if (request > 0) - { - long requestedEnergy = Math.min(request, this.getEnergy()); - if (doExtract) - { - this.setEnergy(this.getEnergy() - requestedEnergy); - } - return requestedEnergy; - } - return 0; - } - - @Override - public void cleanUpMembers() - { - super.cleanUpMembers(); - boolean set = false; - this.energyMax = 0; - for (INetworkPart part : this.networkMembers) - { - if (!set && part instanceof IPowerLess && ((IPowerLess) part).runPowerLess()) - { - this.setPowerLess(((IPowerLess) part).runPowerLess()); - set = true; - } - if (part instanceof INetworkEnergyPart) - { - this.energyMax += ((INetworkEnergyPart) part).getPartMaxEnergy(); - } - } - - } - - @Override - public boolean runPowerLess() - { - return this.runPowerLess; - } - - @Override - public void setPowerLess(boolean bool) - { - this.runPowerLess = bool; - for (INetworkPart part : this.networkMembers) - { - if (part instanceof IPowerLess) - { - ((IPowerLess) part).setPowerLess(bool); - } - - } - } - - public void setEnergy(long energy) - { - this.energy = energy; - } - - public long getEnergy() - { - return this.energy; - } - - public long getEnergyCapacity() - { - return this.energyMax; - } - - /** Space left to store more energy */ - public float getEnergySpace() - { - return Math.max(this.getEnergyCapacity() - this.getEnergy(), 0); - } - - @Override - public void save() - { - this.cleanUpMembers(); - long energyRemaining = this.getEnergy(); - for (INetworkPart part : this.getMembers()) - { - long watts = energyRemaining / this.getMembers().size(); - if (part instanceof INetworkEnergyPart) - { - ((INetworkEnergyPart) part).setPartEnergy(Math.min(watts, ((INetworkEnergyPart) part).getPartMaxEnergy())); - energyRemaining -= Math.min(((INetworkEnergyPart) part).getPartEnergy(), ((INetworkEnergyPart) part).getPartMaxEnergy()); - } - } - } - - @Override - public void load() - { - this.setEnergy(0); - this.cleanUpMembers(); - this.energyMax = 0; - for (INetworkPart part : this.getMembers()) - { - if (part instanceof INetworkEnergyPart) - { - this.energyMax += ((INetworkEnergyPart) part).getPartMaxEnergy(); - this.setEnergy(this.getEnergy() + ((INetworkEnergyPart) part).getPartEnergy()); - - } - } - } - -} diff --git a/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkTileEntities.java b/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkTileEntities.java deleted file mode 100644 index f475eb3f..00000000 --- a/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkTileEntities.java +++ /dev/null @@ -1,280 +0,0 @@ -package resonantinduction.core.tilenetwork.prefab; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.tilenetwork.INetworkPart; -import resonantinduction.core.tilenetwork.ITileNetwork; -import universalelectricity.api.vector.Vector3; -import universalelectricity.api.vector.VectorHelper; -import calclavia.lib.path.Pathfinder; - -public class NetworkTileEntities implements ITileNetwork -{ - protected Set networkMembers = new HashSet(); - - public NetworkTileEntities() - { - NetworkUpdateHandler.instance().registerNetwork(this); - } - - public NetworkTileEntities(INetworkPart... parts) - { - this(); - if (parts != null) - { - for (INetworkPart part : parts) - { - if (this.isValidMember(part)) - { - part.setTileNetwork(this); - networkMembers.add(part); - } - } - } - } - - @Override - public String getName() - { - return "TileNetwork"; - } - - @Override - public Set getMembers() - { - if (this.networkMembers == null) - { - this.networkMembers = new HashSet(); - } - return networkMembers; - } - - @Override - public void onCreated() - { - this.load(); - this.cleanUpMembers(); - } - - @Override - public int getUpdateRate() - { - return -1; - } - - @Override - public void updateTick() - { - // TODO Auto-generated method stub - - } - - @Override - public void refreshTick() - { - // TODO Auto-generated method stub - - } - - @Override - public boolean addTile(TileEntity ent, boolean member) - { - if (ent == null || ent.isInvalid()) - { - return false; - } - else if (ent instanceof INetworkPart && this.isValidMember((INetworkPart) ent) && member) - { - ((INetworkPart) ent).setTileNetwork(this); - if (this.networkMembers.contains(ent)) - { - return true; - } - return this.networkMembers.add((INetworkPart) ent); - } - return false; - } - - @Override - public boolean removeTile(TileEntity ent) - { - return this.networkMembers.remove(ent); - } - - /** Cleans the list of networkMembers and remove those that no longer belong */ - public void cleanUpMembers() - { - Iterator it = this.networkMembers.iterator(); - - while (it.hasNext()) - { - INetworkPart part = it.next(); - if (!this.isValidMember(part)) - { - it.remove(); - } - else - { - part.setTileNetwork(this); - } - } - - } - - /** Is this part a valid member of the network */ - public boolean isValidMember(INetworkPart part) - { - return part != null && part instanceof TileEntity && !((TileEntity) part).isInvalid(); - } - - @Override - public void save() - { - // TODO Auto-generated method stub - - } - - @Override - public void load() - { - // TODO Auto-generated method stub - - } - - @Override - public void mergeNetwork(ITileNetwork network, INetworkPart mergePoint) - { - if (network != null && network != this && network.getClass().equals(this.getClass())) - { - if (this.preMergeProcessing(network, mergePoint)) - { - this.mergeDo(network); - } - } - } - - /** - * Processing that needs too be done before the network merges. Use this to do final network - * merge calculations and to cause network merge failure - * - * @param network the network that is to merge with this one - * @param part the part at which started the network merge. Use this to cause damage if two - * networks merge with real world style failures - * - * @return false if the merge needs to be canceled. - * - * Cases in which the network should fail to merge are were the two networks merge with error. - * Or, in the case of pipes the two networks merge and the merge point was destroyed by - * combination of liquids. - * - * Ex Lava and water - */ - public boolean preMergeProcessing(ITileNetwork network, INetworkPart part) - { - this.save(); - return true; - } - - /** Merges the two networks together */ - protected void mergeDo(ITileNetwork network) - { - ITileNetwork newNetwork = NetworkUpdateHandler.createNewNetwork(NetworkUpdateHandler.getID(this.getClass())); - if (newNetwork != null) - { - newNetwork.getMembers().addAll(this.getMembers()); - newNetwork.getMembers().addAll(network.getMembers()); - newNetwork.onCreated(); - this.invalidate(); - } - else - { - System.out.println("[CoreMachine]NetworkTileEntities: Failed to merge network due to network creation failure"); - } - } - - @Override - public void splitNetwork(INetworkPart splitPoint) - { - this.getMembers().remove(splitPoint); - if (splitPoint instanceof TileEntity) - { - List connections = splitPoint.getNetworkConnections(); - - for (final TileEntity connectionStart : connections) - { - if (connectionStart instanceof INetworkPart) - { - for (final TileEntity connectionEnd : connections) - { - if (connectionStart != connectionEnd && connectionEnd instanceof INetworkPart) - { - Pathfinder finder = new NetworkPathFinder(connectionEnd.worldObj, (INetworkPart) connectionEnd, splitPoint); - finder.init(new Vector3(connectionStart)); - - if (finder.results.size() <= 0) - { - this.save(); - /* NO LONGER CONNECTED ELSE WHERE SO SPLIT AND REFRESH */ - ITileNetwork newNetwork = NetworkUpdateHandler.createNewNetwork(NetworkUpdateHandler.getID(this.getClass())); - if (newNetwork != null) - { - for (Vector3 node : finder.closedSet) - { - TileEntity entity = node.getTileEntity(connectionEnd.worldObj); - if (entity instanceof INetworkPart) - { - if (node != splitPoint) - { - newNetwork.getMembers().add((INetworkPart) entity); - } - } - } - newNetwork.onCreated(); - } - } - } - } - } - } - - } - - } - - @Override - public String toString() - { - return this.getName() + "[" + this.hashCode() + "| Parts:" + this.networkMembers.size() + "]"; - } - - @Override - public boolean isInvalid() - { - return this.networkMembers.isEmpty(); - } - - @Override - public void invalidate() - { - this.networkMembers.clear(); - } - - public static void invalidate(TileEntity tileEntity) - { - for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity checkTile = VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction); - - if (checkTile instanceof INetworkPart && ((INetworkPart) checkTile).getTileNetwork() != null) - { - ((INetworkPart) checkTile).getTileNetwork().removeTile(tileEntity); - } - } - } - -} diff --git a/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkUpdateHandler.java b/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkUpdateHandler.java deleted file mode 100644 index d77718f3..00000000 --- a/archive/java/resonantinduction/core/tilenetwork/prefab/NetworkUpdateHandler.java +++ /dev/null @@ -1,159 +0,0 @@ -package resonantinduction.core.tilenetwork.prefab; - -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import resonantinduction.core.tilenetwork.ITileNetwork; -import cpw.mods.fml.common.ITickHandler; -import cpw.mods.fml.common.TickType; - -/** - * Manages all the tile networks making sure they get world save events, and updates every so often - * - * @author DarkGuardsman - */ -public class NetworkUpdateHandler implements ITickHandler -{ - private static HashMap> nameToClassMap = new HashMap>(); - private static HashMap, String> classToNameMap = new HashMap, String>(); - - private int count = 0; - private static int refreshTicks = 6000; - - private Set activeNetworks = new HashSet(); - private Set allNetworks = new HashSet(); - - private static NetworkUpdateHandler instance; - - static - { - registerNetworkClass("base", NetworkTileEntities.class); - } - - public static NetworkUpdateHandler instance() - { - if (instance == null) - { - instance = new NetworkUpdateHandler(); - } - return instance; - } - - public void registerNetwork(ITileNetwork network) - { - if (network != null && !activeNetworks.contains(network)) - { - this.allNetworks.add(network); - if (network.getUpdateRate() > 0) - { - this.activeNetworks.add(network); - } - } - } - - public static void registerNetworkClass(String id, Class clazz) - { - if (!nameToClassMap.containsKey(id) && !classToNameMap.containsKey(clazz)) - { - nameToClassMap.put(id, clazz); - classToNameMap.put(clazz, id); - } - } - - public static String getID(Class clazz) - { - return classToNameMap.get(clazz); - } - - public static Class getClazz(String id) - { - return nameToClassMap.get(id); - } - - public static ITileNetwork createNewNetwork(String id) - { - Class clazz = getClazz(id); - if (clazz != null) - { - try - { - Object object = clazz.newInstance(); - if (object instanceof ITileNetwork) - { - return (ITileNetwork) object; - } - } - catch (Exception e) - { - System.out.println("[CoreMachine]TileNetworkHandler: Failed to create a new network object"); - e.printStackTrace(); - } - } - else - { - System.out.println("[CoreMachine]TileNetworkHandler: Unkown id: " + id); - } - - return null; - } - - @Override - public void tickStart(EnumSet type, Object... tickData) - { - if (count + 1 >= NetworkUpdateHandler.refreshTicks) - { - count = 0; - for (ITileNetwork network : allNetworks) - { - if (!network.isInvalid()) - { - network.refreshTick(); - } - } - } - else - { - count++; - for (ITileNetwork network : activeNetworks) - { - if (!network.isInvalid()) - { - network.updateTick(); - } - } - } - - } - - @Override - public void tickEnd(EnumSet type, Object... tickData) - { - Iterator it = activeNetworks.iterator(); - while (it.hasNext()) - { - ITileNetwork network = it.next(); - if (network.isInvalid()) - { - network.invalidate(); - it.remove(); - allNetworks.remove(network); - } - } - - } - - @Override - public EnumSet ticks() - { - return EnumSet.of(TickType.SERVER); - } - - @Override - public String getLabel() - { - return "[CoreMachine]TileNetworkHandler"; - } -} diff --git a/archive/java/resonantinduction/electrical/ClientProxy.java b/archive/java/resonantinduction/electrical/ClientProxy.java deleted file mode 100644 index 8ac0e2de..00000000 --- a/archive/java/resonantinduction/electrical/ClientProxy.java +++ /dev/null @@ -1,79 +0,0 @@ -package resonantinduction.electrical; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; -import resonantinduction.electrical.battery.RenderBattery; -import resonantinduction.electrical.battery.TileBattery; -import resonantinduction.electrical.generator.solar.RenderSolarPanel; -import resonantinduction.electrical.generator.solar.TileSolarPanel; -import resonantinduction.electrical.levitator.RenderLevitator; -import resonantinduction.electrical.levitator.TileEMLevitator; -import resonantinduction.electrical.multimeter.GuiMultimeter; -import resonantinduction.electrical.multimeter.PartMultimeter; -import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; -import resonantinduction.electrical.render.FXElectricBolt; -import resonantinduction.electrical.tesla.RenderTesla; -import resonantinduction.electrical.tesla.TileTesla; -import resonantinduction.old.core.render.RenderRIItem; -import universalelectricity.api.vector.Vector3; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TileMultipart; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -@SideOnly(Side.CLIENT) -public class ClientProxy extends CommonProxy -{ - @Override - public void preInit() - { - RenderingRegistry.registerBlockHandler(ElectricalBlockRenderingHandler.INSTANCE); - MinecraftForgeClient.registerItemRenderer(Electrical.itemMultimeter.itemID, RenderRIItem.INSTANCE); - MinecraftForgeClient.registerItemRenderer(Electrical.itemTransformer.itemID, RenderRIItem.INSTANCE); - ClientRegistry.bindTileEntitySpecialRenderer(TileTesla.class, new RenderTesla()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEMLevitator.class, new RenderLevitator()); - ClientRegistry.bindTileEntitySpecialRenderer(TileBattery.class, new RenderBattery()); - ClientRegistry.bindTileEntitySpecialRenderer(TileSolarPanel.class, new RenderSolarPanel()); - } - - @Override - public void postInit() - { - } - - @Override - public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof TileMultipart) - { - TMultiPart part = ((TileMultipart) tileEntity).partMap(id); - - if (part instanceof PartMultimeter) - { - return new GuiMultimeter(player.inventory, (PartMultimeter) part); - } - } - - return null; - } - - @Override - public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b, boolean split) - { - if (world.isRemote) - { - FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXElectricBolt(world, start, target, split).setColor(r, g, b)); - } - } -} diff --git a/archive/java/resonantinduction/electrical/CommonProxy.java b/archive/java/resonantinduction/electrical/CommonProxy.java deleted file mode 100644 index adbe5350..00000000 --- a/archive/java/resonantinduction/electrical/CommonProxy.java +++ /dev/null @@ -1,64 +0,0 @@ -package resonantinduction.electrical; - -import java.awt.Color; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import resonantinduction.core.prefab.ProxyBase; -import resonantinduction.electrical.multimeter.ContainerMultimeter; -import resonantinduction.electrical.multimeter.PartMultimeter; -import universalelectricity.api.vector.Vector3; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TileMultipart; - -public class CommonProxy extends ProxyBase -{ - @Override - public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof TileMultipart) - { - TMultiPart part = ((TileMultipart) tileEntity).partMap(id); - if (part instanceof PartMultimeter) - { - return new ContainerMultimeter(player.inventory, ((PartMultimeter) part)); - } - } - - return null; - } - - public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b, boolean split) - { - - } - - public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b) - { - this.renderElectricShock(world, start, target, r, g, b, true); - } - - public void renderElectricShock(World world, Vector3 start, Vector3 target, Color color) - { - this.renderElectricShock(world, start, target, color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f); - } - - public void renderElectricShock(World world, Vector3 start, Vector3 target, Color color, boolean split) - { - this.renderElectricShock(world, start, target, color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, split); - } - - public void renderElectricShock(World world, Vector3 start, Vector3 target) - { - this.renderElectricShock(world, start, target, true); - } - - public void renderElectricShock(World world, Vector3 start, Vector3 target, boolean b) - { - this.renderElectricShock(world, start, target, 0.55f, 0.7f, 1f, b); - - } -} diff --git a/archive/java/resonantinduction/electrical/Electrical.java b/archive/java/resonantinduction/electrical/Electrical.java deleted file mode 100644 index 9f1fef70..00000000 --- a/archive/java/resonantinduction/electrical/Electrical.java +++ /dev/null @@ -1,241 +0,0 @@ -package resonantinduction.electrical; - -import ic2.api.item.Items; - -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInduction; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; -import resonantinduction.core.part.BlockMachinePart; -import resonantinduction.electrical.battery.BlockBattery; -import resonantinduction.electrical.battery.ItemBlockBattery; -import resonantinduction.electrical.battery.TileBattery; -import resonantinduction.electrical.generator.solar.BlockSolarPanel; -import resonantinduction.electrical.generator.solar.TileSolarPanel; -import resonantinduction.electrical.levitator.BlockLevitator; -import resonantinduction.electrical.levitator.ItemBlockContractor; -import resonantinduction.electrical.levitator.TileEMLevitator; -import resonantinduction.electrical.multimeter.ItemMultimeter; -import resonantinduction.electrical.tesla.BlockTesla; -import resonantinduction.electrical.tesla.TileTesla; -import resonantinduction.electrical.transformer.ItemTransformer; -import resonantinduction.electrical.wire.EnumWireMaterial; -import resonantinduction.electrical.wire.ItemWire; -import resonantinduction.mechanical.grinder.BlockGrinderWheel; -import resonantinduction.mechanical.grinder.TileGrinderWheel; -import resonantinduction.mechanical.grinder.TilePurifier; -import resonantinduction.old.mechanics.furnace.BlockAdvancedFurnace; -import resonantinduction.old.mechanics.furnace.TileAdvancedFurnace; -import resonantinduction.old.mechanics.purifier.BlockPurifier; -import calclavia.lib.network.PacketHandler; -import calclavia.lib.recipe.UniversalRecipe; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.ModMetadata; -import cpw.mods.fml.common.ObfuscationReflectionHelper; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkMod; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/** - * Resonant Induction Electrical Module - * - * @author Calclavia - * - */ -@Mod(modid = Electrical.ID, name = Electrical.NAME, version = Reference.VERSION, dependencies = "before:ThermalExpansion;after:" + ResonantInduction.ID + "|Mechanical;required-after:" + ResonantInduction.ID) -@NetworkMod(channels = Reference.CHANNEL, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) -public class Electrical -{ - /** Mod Information */ - public static final String ID = "ResonantInduction|Electrical"; - public static final String NAME = Reference.NAME + " Electrical"; - - @Instance(ID) - public static Electrical INSTANCE; - - @SidedProxy(clientSide = "resonantinduction.electrical.ClientProxy", serverSide = "resonantinduction.electrical.CommonProxy") - public static CommonProxy proxy; - - @Mod.Metadata(ID) - public static ModMetadata metadata; - - // Energy - private static Item itemPartWire; - public static Item itemMultimeter; - public static Item itemTransformer; - public static Block blockTesla; - public static Block blockBattery; - - // Generators - public static Block blockSolarPanel; - - // Machines - public static Block blockAdvancedFurnace, blockMachinePart, blockGrinderWheel, blockPurifier; - - // Transport - public static Block blockEMContractor; - - @EventHandler - public void preInit(FMLPreInitializationEvent evt) - { - NetworkRegistry.instance().registerGuiHandler(this, proxy); - - Settings.CONFIGURATION.load(); - - // Energy - itemPartWire = new ItemWire(Settings.getNextItemID()); - itemMultimeter = new ItemMultimeter(Settings.getNextItemID()); - itemTransformer = new ItemTransformer(Settings.getNextItemID()); - blockTesla = new BlockTesla(Settings.getNextBlockID()); - blockBattery = new BlockBattery(Settings.getNextBlockID()); - - // Transport - blockEMContractor = new BlockLevitator(); - - // Machines - blockMachinePart = new BlockMachinePart(); - blockGrinderWheel = new BlockGrinderWheel(Settings.getNextBlockID()); - blockPurifier = new BlockPurifier(Settings.getNextBlockID()); - - // Generator - blockSolarPanel = new BlockSolarPanel(); - - if (Settings.REPLACE_FURNACE) - { - blockAdvancedFurnace = BlockAdvancedFurnace.createNew(false); - GameRegistry.registerBlock(blockAdvancedFurnace, "ri_" + blockAdvancedFurnace.getUnlocalizedName()); - GameRegistry.registerTileEntity(TileAdvancedFurnace.class, "ri_" + blockAdvancedFurnace.getUnlocalizedName()); - } - - Settings.CONFIGURATION.save(); - - GameRegistry.registerItem(itemMultimeter, itemMultimeter.getUnlocalizedName()); - GameRegistry.registerItem(itemTransformer, itemTransformer.getUnlocalizedName()); - - GameRegistry.registerBlock(blockSolarPanel, blockSolarPanel.getUnlocalizedName()); - GameRegistry.registerBlock(blockTesla, blockTesla.getUnlocalizedName()); - GameRegistry.registerBlock(blockBattery, ItemBlockBattery.class, blockBattery.getUnlocalizedName()); - GameRegistry.registerBlock(blockGrinderWheel, blockGrinderWheel.getUnlocalizedName()); - GameRegistry.registerBlock(blockPurifier, blockPurifier.getUnlocalizedName()); - GameRegistry.registerBlock(blockMachinePart, blockMachinePart.getUnlocalizedName()); - GameRegistry.registerBlock(blockEMContractor, ItemBlockContractor.class, blockEMContractor.getUnlocalizedName()); - - // Tiles - GameRegistry.registerTileEntity(TileTesla.class, blockTesla.getUnlocalizedName()); - GameRegistry.registerTileEntity(TileBattery.class, blockBattery.getUnlocalizedName()); - GameRegistry.registerTileEntity(TileSolarPanel.class, blockSolarPanel.getUnlocalizedName()); - GameRegistry.registerTileEntity(TilePurifier.class, blockPurifier.getUnlocalizedName()); - GameRegistry.registerTileEntity(TileGrinderWheel.class, blockGrinderWheel.getUnlocalizedName()); - GameRegistry.registerTileEntity(TileEMLevitator.class, blockEMContractor.getUnlocalizedName()); - - /** - * Set reference itemstacks - */ - ResonantInductionTabs.ITEMSTACK = new ItemStack(blockBattery); - - for (EnumWireMaterial material : EnumWireMaterial.values()) - { - material.setWire(itemPartWire); - } - - proxy.preInit(); - Settings.CONFIGURATION.save(); - } - - @EventHandler - public void init(FMLInitializationEvent evt) - { - Settings.setModMetadata(metadata, ID, NAME); - MultipartElectrical.INSTANCE = new MultipartElectrical(); - proxy.init(); - } - - @EventHandler - public void postInit(FMLPostInitializationEvent evt) - { - /** - * Recipes - */ - final ItemStack defaultWire = EnumWireMaterial.IRON.getWire(); - - /** Tesla - by Jyzarc */ - GameRegistry.addRecipe(new ShapedOreRecipe(blockTesla, "WEW", " C ", " I ", 'W', defaultWire, 'E', Item.eyeOfEnder, 'C', UniversalRecipe.BATTERY.get(), 'I', UniversalRecipe.PRIMARY_PLATE.get())); - - /** Multimeter */ - GameRegistry.addRecipe(new ShapedOreRecipe(itemMultimeter, "WWW", "ICI", 'W', defaultWire, 'C', UniversalRecipe.BATTERY.get(), 'I', UniversalRecipe.PRIMARY_METAL.get())); - - /** Battery */ - GameRegistry.addRecipe(new ShapedOreRecipe(blockBattery, "III", "IRI", "III", 'R', Block.blockRedstone, 'I', UniversalRecipe.PRIMARY_METAL.get())); - - /** Wires **/ - GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.COPPER.getWire(3), "MMM", 'M', "ingotCopper")); - GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.TIN.getWire(3), "MMM", 'M', "ingotTin")); - GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.IRON.getWire(3), "MMM", 'M', Item.ingotIron)); - GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.ALUMINUM.getWire(3), "MMM", 'M', "ingotAluminum")); - GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.SILVER.getWire(), "MMM", 'M', "ingotSilver")); - GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.SUPERCONDUCTOR.getWire(3), "MMM", 'M', "ingotSuperconductor")); - GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.SUPERCONDUCTOR.getWire(3), "MMM", "MEM", "MMM", 'M', Item.ingotGold, 'E', Item.eyeOfEnder)); - - /** Wire Compatiblity **/ - if (Loader.isModLoaded("IC2")) - { - GameRegistry.addRecipe(new ShapelessOreRecipe(EnumWireMaterial.COPPER.getWire(), Items.getItem("copperCableItem"))); - GameRegistry.addRecipe(new ShapelessOreRecipe(EnumWireMaterial.TIN.getWire(), Items.getItem("tinCableItem"))); - GameRegistry.addRecipe(new ShapelessOreRecipe(EnumWireMaterial.IRON.getWire(), Items.getItem("ironCableItem"))); - GameRegistry.addRecipe(new ShapelessOreRecipe(EnumWireMaterial.SUPERCONDUCTOR.getWire(), Items.getItem("glassFiberCableItem"))); - } - - if (Loader.isModLoaded("Mekanism")) - { - GameRegistry.addRecipe(new ShapelessOreRecipe(EnumWireMaterial.COPPER.getWire(), "universalCable")); - } - - proxy.postInit(); - /** Inject new furnace tile class */ - replaceTileEntity(TileEntityFurnace.class, TileAdvancedFurnace.class); - } - - public static void replaceTileEntity(Class findTile, Class replaceTile) - { - try - { - Map nameToClassMap = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "70326_a", "nameToClassMap", "a"); - Map classToNameMap = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "70326_b", "classToNameMap", "b"); - - String findTileID = classToNameMap.get(findTile); - - if (findTileID != null) - { - nameToClassMap.put(findTileID, replaceTile); - classToNameMap.put(replaceTile, findTileID); - classToNameMap.remove(findTile); - ResonantInduction.LOGGER.fine("Replaced TileEntity: " + findTile); - } - else - { - ResonantInduction.LOGGER.severe("Failed to replace TileEntity: " + findTile); - } - } - catch (Exception e) - { - ResonantInduction.LOGGER.severe("Failed to replace TileEntity: " + findTile); - e.printStackTrace(); - } - } -} diff --git a/archive/java/resonantinduction/electrical/MultipartElectrical.java b/archive/java/resonantinduction/electrical/MultipartElectrical.java deleted file mode 100644 index 11376706..00000000 --- a/archive/java/resonantinduction/electrical/MultipartElectrical.java +++ /dev/null @@ -1,49 +0,0 @@ -package resonantinduction.electrical; - -import resonantinduction.electrical.multimeter.PartMultimeter; -import resonantinduction.electrical.transformer.PartTransformer; -import resonantinduction.electrical.wire.flat.PartFlatSwitchWire; -import resonantinduction.electrical.wire.flat.PartFlatWire; -import resonantinduction.electrical.wire.framed.PartFramedSwitchWire; -import resonantinduction.electrical.wire.framed.PartFramedWire; -import codechicken.multipart.MultiPartRegistry; -import codechicken.multipart.MultiPartRegistry.IPartFactory; -import codechicken.multipart.MultipartGenerator; -import codechicken.multipart.TMultiPart; - -public class MultipartElectrical implements IPartFactory -{ - public static MultipartElectrical INSTANCE; - - public static final String[] PART_TYPES = { "resonant_induction_wire", "resonant_induction_switch_wire", "resonant_induction_flat_wire", "resonant_induction_flat_switch_wire", "resonant_induction_multimeter", "resonant_induction_transformer" }; - - public MultipartElectrical() - { - MultiPartRegistry.registerParts(this, PART_TYPES); - MultipartGenerator.registerTrait("universalelectricity.api.energy.IConductor", "resonantinduction.electrical.wire.trait.TraitConductor"); - MultipartGenerator.registerTrait("cofh.api.energy.IEnergyHandler", "resonantinduction.electrical.wire.trait.TraitEnergyHandler"); - MultipartGenerator.registerTrait("ic2.api.energy.tile.IEnergySink", "resonantinduction.electrical.wire.trait.TraitEnergySink"); - } - - @Override - public TMultiPart createPart(String name, boolean client) - { - switch (name) - { - case "resonant_induction_wire": - return new PartFramedWire(); - case "resonant_induction_switch_wire": - return new PartFramedSwitchWire(); - case "resonant_induction_flat_wire": - return new PartFlatWire(); - case "resonant_induction_flat_switch_wire": - return new PartFlatSwitchWire(); - case "resonant_induction_multimeter": - return new PartMultimeter(); - case "resonant_induction_transformer": - return new PartTransformer(); - } - - return null; - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/BlockArmbot.java b/archive/java/resonantinduction/electrical/armbot/BlockArmbot.java deleted file mode 100644 index 33a1e92c..00000000 --- a/archive/java/resonantinduction/electrical/armbot/BlockArmbot.java +++ /dev/null @@ -1,142 +0,0 @@ -package resonantinduction.electrical.armbot; - -import java.util.List; -import java.util.Random; -import java.util.Set; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import resonantinduction.core.ResonantInduction; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.mechanical.render.MechanicalBlockRenderingHandler; -import resonantinduction.old.client.render.RenderArmbot; -import calclavia.lib.multiblock.link.IBlockActivate; -import calclavia.lib.multiblock.link.IMultiBlock; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.IExtraInfo.IExtraBlockInfo; - -public class BlockArmbot extends BlockMachine implements IExtraBlockInfo -{ - public BlockArmbot() - { - super("armbot"); - } - - @Override - public boolean canBlockStay(World world, int x, int y, int z) - { - return world.getBlockMaterial(x, y - 1, z).isSolid(); - } - - @Override - public void onBlockAdded(World world, int x, int y, int z) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof IMultiBlock) - { - ResonantInduction.blockMulti.createMultiBlockStructure((IMultiBlock) tileEntity); - } - } - - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof IBlockActivate) - { - return ((IBlockActivate) tileEntity).onActivated(player); - } - - return false; - } - - @Override - public void breakBlock(World world, int x, int y, int z, int par5, int par6) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof TileEntityArmbot) - { - ((TileEntityArmbot) tileEntity).dropHeldObject(); - ResonantInduction.blockMulti.destroyMultiBlockStructure((TileEntityArmbot) tileEntity); - } - this.dropBlockAsItem_do(world, x, y, z, new ItemStack(this)); - super.breakBlock(world, x, y, z, par5, par6); - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - return new ItemStack(this); - } - - @Override - public int quantityDropped(Random par1Random) - { - return 0; - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair("ALArmbot", TileEntityArmbot.class)); - } - - @Override - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - list.add(new Pair, TileEntitySpecialRenderer>(TileEntityArmbot.class, new RenderArmbot())); - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityArmbot(); - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderType() - { - return MechanicalBlockRenderingHandler.BLOCK_RENDER_ID; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean hasExtraConfigs() - { - // TODO Auto-generated method stub - return false; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - // TODO Auto-generated method stub - - } - - @Override - public void loadOreNames() - { - // TODO Auto-generated method stub - - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/Program.java b/archive/java/resonantinduction/electrical/armbot/Program.java deleted file mode 100644 index 6fa26ba7..00000000 --- a/archive/java/resonantinduction/electrical/armbot/Program.java +++ /dev/null @@ -1,355 +0,0 @@ -package resonantinduction.electrical.armbot; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import resonantinduction.old.api.coding.ILogicTask; -import resonantinduction.old.api.coding.IProgram; -import resonantinduction.old.api.coding.IProgrammableMachine; -import resonantinduction.old.api.coding.ITask; -import resonantinduction.old.api.coding.TaskRegistry; -import universalelectricity.api.vector.Vector2; -import calclavia.lib.utility.NBTUtility; - -public class Program implements IProgram -{ - protected Vector2 currentPos = new Vector2(0, 0); - protected ITask currentTask; - protected IProgrammableMachine machine; - protected HashMap tasks = new HashMap(); - protected HashMap varables = new HashMap(); - protected int width = 0, hight = 0; - boolean editing = false; - - @Override - public void init(IProgrammableMachine machine) - { - this.machine = machine; - int w = 0; - int h = 0; - List removeList = new ArrayList(); - for (Entry entry : this.tasks.entrySet()) - { - if (entry.getValue() != null) - { - entry.getValue().setProgram(this); - if (entry.getValue().getCol() > w) - { - w = entry.getValue().getCol(); - } - if (entry.getValue().getRow() > h) - { - h = entry.getValue().getRow(); - } - } - else - { - // Should be rare that one of the slots would be null - removeList.add(entry.getKey()); - } - } - for (Vector2 vec : removeList) - { - this.tasks.remove(vec); - } - this.width = w; - this.hight = h; - } - - @Override - public IProgrammableMachine getMachine() - { - return this.machine; - } - - @Override - public HashMap getDeclairedVarables() - { - return varables; - } - - @Override - public ITask getNextTask() - { - if (this.currentTask != null) - { - this.currentTask.reset(); - } - this.currentTask = this.getTaskAt(currentPos.intX(), currentPos.intY()); - this.currentPos.add(new Vector2(0, 1)); - if (this.currentTask != null) - { - this.currentTask.refresh(); - } - if (this.currentTask instanceof ILogicTask) - { - if (((ILogicTask) this.currentTask).getExitPoint() != null) - { - this.currentTask = ((ILogicTask) this.currentTask).getExitPoint(); - this.currentPos = new Vector2(this.currentTask.getCol(), this.currentTask.getRow() + 1); - } - } - return this.currentTask; - } - - @Override - public ITask getTaskAt(int col, int row) - { - return this.tasks.get(new Vector2(col, row)); - } - - @Override - public HashMap getTaskMap() - { - return this.tasks; - } - - @Override - public void setTaskAt(int col, int row, ITask task) - { - if (!this.editing) - { - if (task != null) - { - task.setPosition(col, row); - if (task.getCol() > this.width) - { - this.width = task.getCol(); - } - if (task.getRow() > this.hight) - { - this.hight = task.getRow(); - } - this.tasks.put(new Vector2(col, row), task); - } - else if (this.tasks.containsKey(new Vector2(col, row))) - { - this.tasks.remove(new Vector2(col, row)); - if (col == this.hight && !this.isThereATaskInRow(this.hight)) - { - this.hight--; - } - else if (!this.isThereATaskInRow(col)) - { - this.moveAll(col, true); - } - } - } - } - - public boolean isThereATaskInRow(int row) - { - int colume = 0; - for (int x = 0; x <= this.width; x++) - { - if (this.getTaskAt(colume, row) != null) - { - return true; - } - colume++; - } - return false; - } - - public boolean isThereATaskInColume(int colume) - { - int row = 0; - for (int y = 0; y <= this.width; y++) - { - if (this.getTaskAt(row, colume) != null) - { - return true; - } - row++; - } - return false; - } - - /** - * Move all tasks at the row and in the direction given. - * - * @param row - row number or Y value of the position from the task - * @param up - true will move all the tasks up one, false will move all the tasks down one - */ - public void moveAll(int row, boolean up) - { - if (!this.editing) - { - this.editing = true; - List moveList = new ArrayList(); - final int move = up ? -1 : 1; - Vector2 targetPos; - ITask tagetTask; - /* Gather all task and remove them so they can be re-added wither there new positions */ - for (int x = 0; x <= this.width; x++) - { - for (int y = row; y <= this.hight; y++) - { - targetPos = new Vector2(x, y); - tagetTask = this.getTaskAt(x, y); - if (tagetTask != null) - { - // Add the task to the move list - moveList.add(tagetTask); - // Removes the task - this.tasks.remove(targetPos); - } - } - } - /* Update all the task locations */ - for (ITask moveTask : moveList) - { - this.setTaskAt(moveTask.getCol(), moveTask.getRow() + move, moveTask); - } - this.editing = false; - } - } - - @Override - public void insertTask(int col, int row, ITask task) - { - if (task != null && !this.editing) - { - if (this.getTaskAt(col, row) != null) - { - this.moveAll(row, false); - this.setTaskAt(col, row, task); - } - else - { - this.setTaskAt(col, row, task); - } - - } - } - - @Override - public void reset() - { - if (this.currentTask != null) - { - this.currentTask.reset(); - } - this.currentPos = new Vector2(0, 0); - } - - @Override - public void setVar(String name, Object object) - { - if (name != null) - { - if (object != null) - { - this.varables.put(name, object); - } - else - { - this.varables.remove(name); - } - } - - } - - @Override - public Object getVar(String name) - { - return this.varables.get(name); - } - - @Override - public NBTTagCompound save(NBTTagCompound nbt) - { - // Save process list - NBTTagList taskList = new NBTTagList(); - for (Entry entry : this.tasks.entrySet()) - { - entry.getValue().setPosition(entry.getKey().intX(), entry.getKey().intY()); - NBTTagCompound task = new NBTTagCompound(); - entry.getValue().save(task); - if (this.currentTask != null && entry.getKey().equals(new Vector2(this.currentTask.getCol(), this.currentTask.getRow()))) - { - task.setBoolean("currentTask", true); - entry.getValue().saveProgress(task); - } - task.setString("methodName", entry.getValue().getMethodName()); - taskList.appendTag(task); - } - nbt.setTag("tasks", taskList); - // save varables - taskList = new NBTTagList(); - for (Entry var : this.varables.entrySet()) - { - taskList.appendTag(NBTUtility.saveObject(var.getKey(), var.getValue())); - } - nbt.setTag("vars", taskList); - return nbt; - } - - @Override - public void load(NBTTagCompound nbt) - { - // Load process list - NBTTagList taskList = nbt.getTagList("tasks"); - for (int s = 0; s < taskList.tagCount(); ++s) - { - NBTTagCompound tag = (NBTTagCompound) taskList.tagAt(s); - if (tag.hasKey("methodName")) - { - ITask task = TaskRegistry.getCommand(tag.getString("methodName")); - if (task != null) - { - task = task.clone(); - if (task != null) - { - task.load(tag); - if (tag.getBoolean("currentTask")) - { - this.currentTask = task; - task.loadProgress(tag); - this.currentPos = new Vector2(task.getCol(), task.getRow()); - } - this.tasks.put(new Vector2(task.getCol(), task.getRow()), task); - if (task.getCol() > this.width) - { - this.width = task.getCol(); - } - if (task.getRow() > this.hight) - { - this.hight = task.getRow(); - } - } - } - else - { - System.out.println("[CoreMachine]Error: failed to load task " + tag.getString("methodName")); - } - } - } - taskList = nbt.getTagList("vars"); - for (int s = 0; s < taskList.tagCount(); ++s) - { - NBTTagCompound tag = (NBTTagCompound) taskList.tagAt(s); - this.varables.put(tag.getName(), NBTUtility.loadObject(tag, tag.getName())); - } - } - - @Override - public Program clone() - { - Program program = new Program(); - program.load(this.save(new NBTTagCompound())); - program.reset(); - return program; - } - - @Override - public Vector2 getSize() - { - return new Vector2(this.width, this.hight); - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/TaskBase.java b/archive/java/resonantinduction/electrical/armbot/TaskBase.java deleted file mode 100644 index 395b794e..00000000 --- a/archive/java/resonantinduction/electrical/armbot/TaskBase.java +++ /dev/null @@ -1,206 +0,0 @@ -package resonantinduction.electrical.armbot; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import resonantinduction.old.api.coding.IProgram; -import resonantinduction.old.api.coding.IProgrammableMachine; -import resonantinduction.old.api.coding.ITask; -import resonantinduction.old.api.coding.args.ArgumentData; -import universalelectricity.api.vector.Vector2; -import calclavia.lib.utility.NBTUtility; - -/** @author DarkGuardsman */ -public abstract class TaskBase implements ITask -{ - /** Program this is part of. Can be null while stores as a prefab waiting to be copied */ - protected IProgram program; - protected String methodName; - /** The amount of ticks this command has been running for. */ - protected long ticks; - - protected TaskType taskType; - - protected int col; - protected int row; - - protected Vector2 UV; - - /** The parameters this command */ - protected List args = new ArrayList(); - - public TaskBase(String name, TaskType tasktype) - { - this.methodName = name; - this.taskType = tasktype; - this.UV = this.taskType.UV; - } - - @Override - public void refresh() - { - - } - - @Override - public void reset() - { - - } - - @Override - public void setProgram(IProgram program) - { - this.program = program; - } - - @Override - public int getCol() - { - return this.col; - } - - @Override - public int getRow() - { - return this.row; - } - - @Override - public void setPosition(int col, int row) - { - this.col = col; - this.row = row; - } - - @Override - public String getMethodName() - { - return this.methodName; - } - - @Override - public TaskType getType() - { - return this.taskType; - } - - @Override - public Object getArg(String name) - { - if (this.getArgs() != null) - { - for (ArgumentData arg : this.getArgs()) - { - if (arg.getName().equalsIgnoreCase(name)) - { - return arg.getData(); - } - } - } - return null; - } - - @Override - public void setArg(String argName, Object obj) - { - if (this.getArgs() != null) - { - for (ArgumentData arg : this.getArgs()) - { - if (arg.getName().equalsIgnoreCase(argName)) - { - arg.setData(obj); - break; - } - } - } - } - - @Override - public List getArgs() - { - return this.args; - } - - @Override - public abstract TaskBase clone(); - - @Override - public void load(NBTTagCompound nbt) - { - this.col = nbt.getInteger("col"); - this.row = nbt.getInteger("row"); - if (this.getArgs() != null) - { - NBTTagCompound parms = nbt.getCompoundTag("args"); - for (ArgumentData arg : this.getArgs()) - { - Object obj = NBTUtility.loadObject(parms, arg.getName()); - if (arg.isValid(obj)) - { - arg.setData(obj); - } - } - } - } - - @Override - public void save(NBTTagCompound nbt) - { - nbt.setInteger("col", this.col); - nbt.setInteger("row", this.row); - NBTTagCompound parms = new NBTTagCompound(); - for (ArgumentData arg : this.getArgs()) - { - NBTUtility.saveObject(parms, arg.getName(), arg.getData()); - } - nbt.setCompoundTag("args", parms); - } - - @Override - public ITask loadProgress(NBTTagCompound nbt) - { - return this; - } - - @Override - public NBTTagCompound saveProgress(NBTTagCompound nbt) - { - return nbt; - } - - @Override - public boolean canUseTask(IProgrammableMachine device) - { - // TODO Auto-generated method stub - return false; - } - - @Override - public String toString() - { - return "Task[" + this.methodName + "]:"; - } - - @Override - public ResourceLocation getTextureSheet() - { - return ITask.TaskType.TEXTURE; - } - - @Override - public Vector2 getTextureUV() - { - return this.UV; - } - - @Override - public void getToolTips(List list) - { - list.add(this.getMethodName()); - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/TaskBaseArmbot.java b/archive/java/resonantinduction/electrical/armbot/TaskBaseArmbot.java deleted file mode 100644 index 2c595094..00000000 --- a/archive/java/resonantinduction/electrical/armbot/TaskBaseArmbot.java +++ /dev/null @@ -1,40 +0,0 @@ -package resonantinduction.electrical.armbot; - -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.coding.IProgrammableMachine; - -public abstract class TaskBaseArmbot extends TaskBaseProcess -{ - - public TaskBaseArmbot(String name) - { - super(name); - } - - @Override - public ProcessReturn onMethodCalled() - { - if (super.onMethodCalled() == ProcessReturn.CONTINUE && this.program.getMachine() instanceof IArmbot) - { - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE && this.program.getMachine() instanceof IArmbot) - { - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public boolean canUseTask(IProgrammableMachine device) - { - return device instanceof IArmbot; - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/TaskBaseLogic.java b/archive/java/resonantinduction/electrical/armbot/TaskBaseLogic.java deleted file mode 100644 index a4a903d5..00000000 --- a/archive/java/resonantinduction/electrical/armbot/TaskBaseLogic.java +++ /dev/null @@ -1,12 +0,0 @@ -package resonantinduction.electrical.armbot; - -import resonantinduction.old.api.coding.ILogicTask; - -/** @author DarkGuardsman */ -public abstract class TaskBaseLogic extends TaskBase implements ILogicTask -{ - public TaskBaseLogic(String name) - { - super(name, TaskType.DECISION); - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/TaskBaseProcess.java b/archive/java/resonantinduction/electrical/armbot/TaskBaseProcess.java deleted file mode 100644 index de2bfadb..00000000 --- a/archive/java/resonantinduction/electrical/armbot/TaskBaseProcess.java +++ /dev/null @@ -1,84 +0,0 @@ -package resonantinduction.electrical.armbot; - -import net.minecraft.item.ItemStack; -import resonantinduction.old.api.coding.IProcessTask; - -import com.builtbroken.common.science.units.UnitHelper; - -import dan200.computer.api.IComputerAccess; -import dan200.computer.api.ILuaContext; - -/** - * Basic command prefab used by machines like an armbot. You are not required to use this in order - * to make armbot commands but it does help. Delete this if you don't plan to use it. - */ -public abstract class TaskBaseProcess extends TaskBase implements IProcessTask -{ - - public TaskBaseProcess(String name) - { - super(name, TaskType.DEFINEDPROCESS); - this.ticks = 0; - } - - @Override - public ProcessReturn onMethodCalled() - { - if (this.program != null && this.program.getMachine() != null) - { - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (ticks++ >= Long.MAX_VALUE - 1) - { - this.ticks = 0; - } - if (this.program != null && this.program.getMachine() != null) - { - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public Object[] onCCMethodCalled(IComputerAccess computer, ILuaContext context) throws Exception - { - return null; - } - - @Override - public void terminated() - { - } - - public ItemStack getItem(Object object, int ammount) - { - int id = 0; - int meta = 32767; - - if (object instanceof String && ((String) object).contains(":")) - { - String[] blockID = ((String) object).split(":"); - id = Integer.parseInt(blockID[0]); - meta = Integer.parseInt(blockID[1]); - } - else - { - id = UnitHelper.tryToParseInt(object); - } - - if (id == 0) - { - return null; - } - else - { - return new ItemStack(id, ammount, meta); - } - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/TileEntityArmbot.java b/archive/java/resonantinduction/electrical/armbot/TileEntityArmbot.java deleted file mode 100644 index 4c8ac89a..00000000 --- a/archive/java/resonantinduction/electrical/armbot/TileEntityArmbot.java +++ /dev/null @@ -1,542 +0,0 @@ -package resonantinduction.electrical.armbot; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.ResonantInduction; -import resonantinduction.electrical.armbot.command.TaskDrop; -import resonantinduction.electrical.armbot.command.TaskGOTO; -import resonantinduction.electrical.armbot.command.TaskGrabItem; -import resonantinduction.electrical.armbot.command.TaskReturn; -import resonantinduction.electrical.armbot.command.TaskRotateTo; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.coding.IProgram; -import resonantinduction.old.api.coding.ProgramHelper; -import resonantinduction.old.core.recipe.RecipeLoader; -import resonantinduction.old.transport.ResonantInductionTransport; -import resonantinduction.old.transport.TileEntityAssembly; -import resonantinduction.old.transport.encoder.ItemDisk; -import universalelectricity.api.vector.Vector2; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.multiblock.link.IBlockActivate; -import calclavia.lib.multiblock.link.IMultiBlock; -import calclavia.lib.network.PacketHandler; -import calclavia.lib.utility.HelperMethods; -import calclavia.lib.utility.LanguageUtility; -import calclavia.lib.utility.MathUtility; - -import com.builtbroken.common.Pair; -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.network.Player; -import cpw.mods.fml.relauncher.Side; - -public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, IArmbot, IBlockActivate -{ - protected int ROTATION_SPEED = 6; - - /** The rotation of the arms. In Degrees. */ - protected int targetPitch = 0, targetYaw = 0; - protected int actualPitch = 0, actualYaw = 0; - - protected boolean spawnEntity = false; - - protected String displayText = ""; - - /** An entity that the Armbot is grabbed onto. Entity Items are held separately. */ - protected Object grabbedObject = null; - /** Helper class that does all the logic for the armbot's program */ - protected ProgramHelper programHelper; - /** Cached location of the armbot to feed to program tasks */ - protected Pair location; - /** Var used by the armbot renderer */ - public EntityItem renderEntityItem; - - public TileEntityArmbot() - { - super(20); - programHelper = new ProgramHelper(this).setMemoryLimit(20); - Program program = new Program(); - program.setTaskAt(0, 0, new TaskDrop()); - program.setTaskAt(0, 1, new TaskRotateTo(180, 0)); - program.setTaskAt(0, 2, new TaskGrabItem()); - program.setTaskAt(0, 3, new TaskReturn()); - program.setTaskAt(0, 4, new TaskGOTO(0, 0)); - programHelper.setProgram(program); - } - - /************************************ Armbot logic update methods *************************************/ - - @Override - public void updateEntity() - { - super.updateEntity(); - Vector3 handPosition = this.getHandPos(); - if (this.location == null || !this.location.left().equals(this.worldObj) || this.xCoord != this.location.right().intX() || this.yCoord != this.location.right().intY() || this.zCoord != this.location.right().intZ()) - { - this.location = new Pair(this.worldObj, new Vector3(this)); - } - if (this.grabbedObject instanceof Entity) - { - if (this.spawnEntity) - { - this.worldObj.spawnEntityInWorld((Entity) this.grabbedObject); - this.spawnEntity = false; - } - ((Entity) this.grabbedObject).setPosition(handPosition.x, handPosition.y, handPosition.z); - ((Entity) this.grabbedObject).motionX = 0; - ((Entity) this.grabbedObject).motionY = 0; - ((Entity) this.grabbedObject).motionZ = 0; - - if (this.grabbedObject instanceof EntityItem) - { - ((EntityItem) this.grabbedObject).delayBeforeCanPickup = 20; - ((EntityItem) this.grabbedObject).age = 0; - } - } - - if (this.isFunctioning()) - { - float preYaw = this.targetYaw, prePitch = this.targetPitch; - if (!this.worldObj.isRemote && this.ticks % 5 == 0) - { - this.programHelper.onUpdate(this.worldObj, new Vector3(this)); - if (this.targetYaw != preYaw || this.targetPitch != prePitch) - { - PacketHandler.sendPacketToClients(this.getDescriptionPacket(), worldObj, new Vector3(this).translate(new Vector3(.5f, 1f, .5f)), 64); - } - } - this.updateRotation(); - } - } - - public void updateRotation() - { - // Clamp target angles - this.targetYaw = (int) MathUtility.clampAngleTo360(this.targetYaw); - if (this.targetPitch < 0) - this.targetPitch = 0; - if (this.targetPitch > 60) - this.targetPitch = 60; - // Handle change in yaw rotation - if (Math.abs(this.actualYaw - this.targetYaw) > 1) - { - float speedYaw; - if (this.actualYaw > this.targetYaw) - { - if (Math.abs(this.actualYaw - this.targetYaw) >= 180) - { - speedYaw = this.ROTATION_SPEED; - } - else - { - speedYaw = -this.ROTATION_SPEED; - } - } - else - { - if (Math.abs(this.actualYaw - this.targetYaw) >= 180) - { - speedYaw = -this.ROTATION_SPEED; - } - else - { - speedYaw = this.ROTATION_SPEED; - } - } - - this.actualYaw += speedYaw; - - if (Math.abs(this.actualYaw - this.targetYaw) < this.ROTATION_SPEED) - { - this.actualYaw = this.targetYaw; - } - this.playRotationSound(); - } - // Handle change in pitch rotation - if (Math.abs(this.actualPitch - this.targetPitch) > 1) - { - if (this.actualPitch > this.targetPitch) - { - this.actualPitch -= this.ROTATION_SPEED; - } - else - { - this.actualPitch += this.ROTATION_SPEED; - } - - if (Math.abs(this.actualPitch - this.targetPitch) < this.ROTATION_SPEED) - { - this.actualPitch = this.targetPitch; - } - this.playRotationSound(); - } - // Clamp actual angles angles - this.actualYaw = (int) MathUtility.clampAngleTo360(this.actualYaw); - if (this.actualPitch < 0) - this.actualPitch = 0; - if (this.actualPitch > 60) - this.actualPitch = 60; - } - - public void playRotationSound() - { - if (this.ticks % 5 == 0 && this.worldObj.isRemote) - { - this.worldObj.playSound(this.xCoord, this.yCoord, this.zCoord, "mods.assemblyline.conveyor", 2f, 2.5f, true); - } - } - - @Override - public String getInvName() - { - return LanguageUtility.getLocal("tile.armbot.name"); - } - - public String getCommandDisplayText() - { - return this.displayText; - } - - @Override - public boolean onActivated(EntityPlayer player) - { - ItemStack containingStack = this.getStackInSlot(0); - - if (containingStack != null) - { - if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) - { - EntityItem dropStack = new EntityItem(this.worldObj, player.posX, player.posY, player.posZ, containingStack); - dropStack.delayBeforeCanPickup = 0; - this.worldObj.spawnEntityInWorld(dropStack); - } - - this.setInventorySlotContents(0, null); - return true; - } - else - { - if (player.getCurrentEquippedItem() != null) - { - if (player.getCurrentEquippedItem().getItem() instanceof ItemDisk) - { - this.setInventorySlotContents(0, player.getCurrentEquippedItem()); - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); - return true; - } - } - } - - return false; - } - - /************************************ Save and load code *************************************/ - - /** NBT Data */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - - this.targetYaw = nbt.getInteger("armYaw"); - this.targetPitch = nbt.getInteger("armPitch"); - this.actualYaw = nbt.getInteger("armYawActual"); - this.actualPitch = nbt.getInteger("armPitchActual"); - - if (nbt.hasKey("grabbedEntity")) - { - NBTTagCompound tag = nbt.getCompoundTag("grabbedEntity"); - Entity entity = EntityList.createEntityFromNBT(tag, worldObj); - if (entity != null) - { - this.grabbedObject = entity; - this.spawnEntity = true; - } - } - else if (nbt.hasKey("grabbedItem")) - { - ItemStack stack = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("grabbedItem")); - if (stack != null) - { - this.grabbedObject = stack; - } - } - } - - /** Writes a tile entity to NBT. */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - - nbt.setInteger("armYaw", this.targetYaw); - nbt.setInteger("armPitch", this.targetPitch); - nbt.setInteger("armYawActual", this.actualYaw); - nbt.setInteger("armPitchActual", this.actualPitch); - - if (this.grabbedObject instanceof Entity) - { - NBTTagCompound entityNBT = new NBTTagCompound(); - ((Entity) this.grabbedObject).writeToNBT(entityNBT); - ((Entity) this.grabbedObject).writeToNBTOptional(entityNBT); - nbt.setCompoundTag("grabbedEntity", entityNBT); - } - else if (this.grabbedObject instanceof ItemStack) - { - nbt.setCompoundTag("grabbedItem", ((ItemStack) this.grabbedObject).writeToNBT(new NBTTagCompound())); - } - - } - - /************************************ Network Packet code *************************************/ - - @Override - public Packet getDescriptionPacket() - { - return ResonantInduction.PACKET_TILE.getPacket(this, "armbot", this.functioning, this.targetYaw, this.targetPitch, this.actualYaw, this.actualPitch); - } - - public void sendGrabItemToClient() - { - if (this.grabbedObject instanceof ItemStack) - { - PacketHandler.sendPacketToClients(ResonantInductionTransport.getTilePacket().getPacket(this, "armbotItem", true, ((ItemStack) this.grabbedObject).writeToNBT(new NBTTagCompound())), worldObj, new Vector3(this), 64); - } - else - { - PacketHandler.sendPacketToClients(ResonantInductionTransport.getTilePacket().getPacket(this, "armbotItem", false), worldObj, new Vector3(this), 64); - } - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput dis, Player player) - { - try - { - if (this.worldObj.isRemote && !super.simplePacket(id, dis, player)) - { - if (id.equalsIgnoreCase("armbot")) - { - this.functioning = dis.readBoolean(); - this.targetYaw = dis.readInt(); - this.targetPitch = dis.readInt(); - this.actualYaw = dis.readInt(); - this.actualPitch = dis.readInt(); - return true; - } - else if (id.equalsIgnoreCase("armbotItem")) - { - if (dis.readBoolean()) - { - this.grabbedObject = ItemStack.loadItemStackFromNBT(PacketHandler.readNBTTagCompound(dis)); - } - else - { - this.grabbedObject = null; - } - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - return false; - } - - /************************************ Multi Block code *************************************/ - - @Override - public Vector3[] getMultiBlockVectors() - { - return new Vector3[] { new Vector3(this).translate(0, 1, 0) }; - } - - /************************************ Armbot API methods *************************************/ - @Override - public Object getHeldObject() - { - return this.grabbedObject; - } - - @Override - public boolean grabObject(Object entity) - { - if (this.getHeldObject() == null) - { - if (entity instanceof ItemStack) - { - this.grabbedObject = entity; - this.sendGrabItemToClient(); - return true; - } - else if (entity instanceof EntityItem) - { - this.grabbedObject = ((EntityItem) entity).getEntityItem(); - ((EntityItem) entity).setDead(); - this.sendGrabItemToClient(); - return true; - } - else if (entity instanceof Entity) - { - this.grabbedObject = entity; - return true; - } - } - return false; - } - - @Override - public boolean dropHeldObject() - { - if (this.getHeldObject() != null) - { - if (this.getHeldObject() instanceof ItemStack) - { - Vector3 handPosition = this.getHandPos(); - HelperMethods.dropItemStack(worldObj, handPosition, (ItemStack) this.getHeldObject(), false); - } - this.grabbedObject = null; - this.sendGrabItemToClient(); - return true; - } - return false; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) - { - return itemstack != null && itemstack.itemID == RecipeLoader.itemDisk.itemID; - } - - @Override - public Vector3 getHandPos() - { - Vector3 position = new Vector3(this); - position.translate(0.5); - position.translate(this.getDeltaHandPosition()); - return position; - } - - public Vector3 getDeltaHandPosition() - { - // The distance of the position relative to the main position. - double distance = 1f; - Vector3 delta = new Vector3(); - // The delta Y of the hand. - delta.y = Math.sin(Math.toRadians(this.actualPitch)) * distance * 2; - // The horizontal delta of the hand. - double dH = Math.cos(Math.toRadians(this.actualPitch)) * distance; - // The delta X and Z. - delta.x = Math.sin(Math.toRadians(-this.actualYaw)) * dH; - delta.z = Math.cos(Math.toRadians(-this.actualYaw)) * dH; - return delta; - } - - @Override - public Vector2 getRotation() - { - return new Vector2(this.actualYaw, this.actualPitch); - } - - @Override - public void setRotation(int yaw, int pitch) - { - if (!this.worldObj.isRemote) - { - this.actualYaw = yaw; - this.actualPitch = pitch; - } - } - - @Override - public boolean moveArmTo(int yaw, int pitch) - { - if (!this.worldObj.isRemote) - { - this.targetYaw = yaw; - this.targetPitch = pitch; - return true; - } - return false; - } - - @Override - public boolean moveTo(ForgeDirection direction) - { - if (direction == ForgeDirection.SOUTH) - { - this.targetYaw = 0; - return true; - } - else if (direction == ForgeDirection.EAST) - { - this.targetYaw = 90; - return true; - } - else if (direction == ForgeDirection.NORTH) - { - - this.targetYaw = 180; - return true; - } - else if (direction == ForgeDirection.WEST) - { - this.targetYaw = 270; - return true; - } - return false; - } - - @Override - public IProgram getCurrentProgram() - { - if (this.programHelper == null) - { - this.programHelper = new ProgramHelper(this); - } - if (this.programHelper != null) - { - return this.programHelper.getProgram(); - } - return null; - } - - @Override - public void setCurrentProgram(IProgram program) - { - if (this.programHelper == null) - { - this.programHelper = new ProgramHelper(this); - } - if (this.programHelper != null) - { - this.programHelper.setProgram(program); - } - } - - @Override - public boolean clear(Object object) - { - if (this.grabbedObject != null && this.grabbedObject.equals(object)) - { - this.grabbedObject = null; - return true; - } - return false; - } - - @Override - public Pair getLocation() - { - return this.location; - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskBreak.java b/archive/java/resonantinduction/electrical/armbot/command/TaskBreak.java deleted file mode 100644 index 9b8efbe8..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskBreak.java +++ /dev/null @@ -1,92 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import resonantinduction.electrical.armbot.TaskBaseArmbot; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.coding.ITask; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.HelperMethods; - -import com.builtbroken.common.Pair; - -/** - * Used by arms to break a specific block in a position. - * - * @author Calclavia - */ -public class TaskBreak extends TaskBaseArmbot -{ - protected int breakTicks = 30; - protected boolean keep = false; - - public TaskBreak() - { - this("break"); - } - - public TaskBreak(String name) - { - super(name); - this.breakTicks = 30; - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE) - { - - Vector3 serachPosition = ((IArmbot) this.program.getMachine()).getHandPos(); - Pair location = this.program.getMachine().getLocation(); - Block block = Block.blocksList[serachPosition.getBlockID(location.left())]; - this.breakTicks--; - if (block != null && breakTicks <= 0) - { - ArrayList items = block.getBlockDropped(location.left(), serachPosition.intX(), serachPosition.intY(), serachPosition.intZ(), serachPosition.getBlockMetadata(location.left()), 0); - - if (!this.keep || items.size() > 1) - { - HelperMethods.dropBlockAsItem(location.left(), serachPosition); - } - else - { - ((IArmbot) this.program.getMachine()).grabObject(new EntityItem(location.left(), serachPosition.intX() + 0.5D, serachPosition.intY() + 0.5D, serachPosition.intZ() + 0.5D, items.get(0))); - } - - location.left().setBlock(serachPosition.intX(), serachPosition.intY(), serachPosition.intZ(), 0, 0, 3); - return ProcessReturn.DONE; - } - } - - /** Notes on break command Beds Break Wrong Multi blocks don't work */ - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public TaskBaseProcess clone() - { - return new TaskBreak(); - } - - @Override - public ITask loadProgress(NBTTagCompound nbt) - { - this.breakTicks = nbt.getInteger("breakTicks"); - return this; - } - - @Override - public NBTTagCompound saveProgress(NBTTagCompound nbt) - { - nbt.setInteger("breakTicks", this.breakTicks); - return nbt; - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskDrop.java b/archive/java/resonantinduction/electrical/armbot/command/TaskDrop.java deleted file mode 100644 index cbaec637..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskDrop.java +++ /dev/null @@ -1,32 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import resonantinduction.electrical.armbot.TaskBaseArmbot; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.IArmbot; -import universalelectricity.api.vector.Vector2; - -public class TaskDrop extends TaskBaseArmbot -{ - public TaskDrop() - { - super("drop"); - this.UV = new Vector2(20, 80); - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE) - { - ((IArmbot) this.program.getMachine()).dropHeldObject(); - } - return ProcessReturn.DONE; - } - - @Override - public TaskBaseProcess clone() - { - return new TaskDrop(); - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskEnd.java b/archive/java/resonantinduction/electrical/armbot/command/TaskEnd.java deleted file mode 100644 index 15e3c1cb..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskEnd.java +++ /dev/null @@ -1,18 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import resonantinduction.electrical.armbot.TaskBase; - -/** @author DarkGuardsman */ -public class TaskEnd extends TaskBase -{ - public TaskEnd() - { - super("end", TaskType.END); - } - - @Override - public TaskBase clone() - { - return new TaskEnd(); - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskFire.java b/archive/java/resonantinduction/electrical/armbot/command/TaskFire.java deleted file mode 100644 index 2ee4d474..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskFire.java +++ /dev/null @@ -1,198 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.Random; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import resonantinduction.electrical.armbot.TaskBaseArmbot; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.coding.args.ArgumentFloatData; -import universalelectricity.api.vector.Vector3; - -import com.builtbroken.common.Pair; -import com.builtbroken.common.science.units.UnitHelper; - -public class TaskFire extends TaskBaseArmbot -{ - - private static final float MIN_ACTUAL_PITCH = -80; - private static final float MAX_ACTUAL_PITCH = 80; - - private float actualYaw; - private float actualPitch; - private float velocity; - private Vector3 finalVelocity; - - public TaskFire() - { - super("throw"); - this.args.add(new ArgumentFloatData("velocity", 1.0f, 2.5f, 1.0f)); - } - - @Override - public ProcessReturn onMethodCalled() - { - if (super.onMethodCalled() == ProcessReturn.CONTINUE) - { - this.velocity = UnitHelper.tryToParseFloat(this.getArg("velocity")); - if (this.velocity > 2.5f) - { - this.velocity = 2.5f; - } - if (this.velocity < 0.125f) - { - this.velocity = 1f; - } - - this.actualYaw = (float) ((IArmbot) this.program.getMachine()).getRotation().x; - this.actualPitch = ((MAX_ACTUAL_PITCH - MIN_ACTUAL_PITCH) * ((float) ((IArmbot) this.program.getMachine()).getRotation().y / 60f)) + MIN_ACTUAL_PITCH; - - double x, y, z; - double yaw, pitch; - yaw = Math.toRadians(actualYaw); - pitch = Math.toRadians(actualPitch); - // yaw = actualYaw; - // pitch = actualPitch; - - x = -Math.sin(yaw) * Math.cos(pitch); - y = Math.sin(pitch); - z = Math.cos(yaw) * Math.cos(pitch); - - this.finalVelocity = new Vector3(x, y, z); - Random random = new Random(System.currentTimeMillis()); - this.finalVelocity.x *= (1f - (1f / 200f)) + (random.nextFloat() * (1f / 100f)); - this.finalVelocity.y *= (1f - (1f / 200f)) + (random.nextFloat() * (1f / 100f)); - this.finalVelocity.z *= (1f - (1f / 200f)) + (random.nextFloat() * (1f / 100f)); - - this.finalVelocity.scale(velocity); - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE) - { - if (this.finalVelocity == null) // something went wrong - { - this.finalVelocity = new Vector3(0, 0, 0); - } - if (((IArmbot) this.program.getMachine()).getHeldObject() != null) - { - Entity held = null; - Object obj = ((IArmbot) this.program.getMachine()).getHeldObject(); - Pair location = this.program.getMachine().getLocation(); - if (obj instanceof Entity) - { - held = (Entity) obj; - } - if (held != null) - { - location.left().playSound(location.right().x, location.right().y, location.right().z, "random.bow", velocity, 2f - (velocity / 4f), true); - if (held instanceof EntityItem) - { - EntityItem item = (EntityItem) held; - ItemStack stack = item.getEntityItem(); - ItemStack thrown = stack.copy(); - thrown.stackSize = 1; - if (item.getEntityItem().stackSize > 0) - { - stack.stackSize--; - item.setEntityItemStack(stack); - } - else - { - ((IArmbot) this.program.getMachine()).dropHeldObject(); - if (!location.left().isRemote) - { - location.left().removeEntity(held); - } - } - if (item.getEntityItem().itemID == Item.arrow.itemID) - { - EntityArrow arrow = new EntityArrow(location.left(), ((IArmbot) this.program.getMachine()).getHandPos().x, ((IArmbot) this.program.getMachine()).getHandPos().y, ((IArmbot) this.program.getMachine()).getHandPos().z); - arrow.motionX = this.finalVelocity.x; - arrow.motionY = this.finalVelocity.y; - arrow.motionZ = this.finalVelocity.z; - if (!location.left().isRemote) - { - location.left().spawnEntityInWorld(arrow); - } - } - else - { - EntityItem item2 = new EntityItem(location.left(), ((IArmbot) this.program.getMachine()).getHandPos().x, ((IArmbot) this.program.getMachine()).getHandPos().y, ((IArmbot) this.program.getMachine()).getHandPos().z, thrown); - item2.motionX = this.finalVelocity.x; - item2.motionY = this.finalVelocity.y; - item2.motionZ = this.finalVelocity.z; - if (!location.left().isRemote) - { - location.left().spawnEntityInWorld(item2); - } - } - } - else - { - ((IArmbot) this.program.getMachine()).dropHeldObject(); - held.motionX = this.finalVelocity.x; - held.motionY = this.finalVelocity.y; - held.motionZ = this.finalVelocity.z; - } - } - } - return ProcessReturn.DONE; - } - return ProcessReturn.GENERAL_ERROR; - - } - - @Override - public TaskBaseProcess loadProgress(NBTTagCompound taskCompound) - { - super.loadProgress(taskCompound); - this.actualYaw = taskCompound.getFloat("fireYaw"); - this.actualPitch = taskCompound.getFloat("firePitch"); - this.velocity = taskCompound.getFloat("fireVelocity"); - this.finalVelocity = new Vector3(); - this.finalVelocity.x = taskCompound.getDouble("fireVectorX"); - this.finalVelocity.y = taskCompound.getDouble("fireVectorY"); - this.finalVelocity.z = taskCompound.getDouble("fireVectorZ"); - return this; - } - - @Override - public NBTTagCompound saveProgress(NBTTagCompound taskCompound) - { - super.saveProgress(taskCompound); - taskCompound.setFloat("fireYaw", this.actualYaw); - taskCompound.setFloat("firePitch", this.actualPitch); - taskCompound.setFloat("fireVelocity", this.velocity); - if (this.finalVelocity != null) - { - taskCompound.setDouble("fireVectorX", this.finalVelocity.x); - taskCompound.setDouble("fireVectorY", this.finalVelocity.y); - taskCompound.setDouble("fireVectorZ", this.finalVelocity.z); - } - return taskCompound; - } - - @Override - public String toString() - { - return super.toString() + " " + Float.toString(this.velocity); - } - - @Override - public TaskBaseProcess clone() - { - return new TaskFire(); - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskGOTO.java b/archive/java/resonantinduction/electrical/armbot/command/TaskGOTO.java deleted file mode 100644 index f63aec0d..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskGOTO.java +++ /dev/null @@ -1,118 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import resonantinduction.electrical.armbot.TaskBase; -import resonantinduction.old.api.coding.IRedirectTask; -import resonantinduction.old.api.coding.ITask; -import universalelectricity.api.vector.Vector2; - -/** @author DarkGuardsman */ -public class TaskGOTO extends TaskBase implements IRedirectTask -{ - protected ITask task; - protected Vector2 taskPos; - protected boolean render = true; - protected List exits = new ArrayList(); - - public TaskGOTO() - { - super("GoTo", TaskType.DECISION); - } - - public TaskGOTO(int x, int y) - { - this(); - this.taskPos = new Vector2(x, y); - } - - public TaskGOTO(boolean render) - { - this(); - this.render = render; - } - - @Override - public ITask getExitPoint() - { - return task; - } - - @Override - public void refresh() - { - super.refresh(); - if (task == null && taskPos != null) - { - this.task = this.program.getTaskAt(taskPos.intX(), taskPos.intY()); - } - this.exits.clear(); - if (this.task != null) - { - this.exits.add(new Vector2(this.task.getCol(), this.task.getRow())); - } - } - - @Override - public void setExitPoint(int i, ITask task) - { - if (i == 0) - { - this.task = task; - } - } - - public void setExitPoint(int i, Vector2 vector2) - { - if (i == 0) - { - this.taskPos = vector2; - } - } - - @Override - public int getMaxExitPoints() - { - return 1; - } - - @Override - public boolean render() - { - return this.render; - } - - @Override - public void load(NBTTagCompound nbt) - { - super.loadProgress(nbt); - this.taskPos = new Vector2(nbt.getDouble("entryX"), (nbt.getDouble("entryY"))); - } - - @Override - public void save(NBTTagCompound nbt) - { - super.saveProgress(nbt); - if (this.task != null) - { - nbt.setDouble("entryX", this.task.getCol()); - nbt.setDouble("entryY", this.task.getRow()); - } - } - - @Override - public TaskBase clone() - { - return new TaskGOTO(); - } - - @Override - public List getExits() - { - // TODO Auto-generated method stub - return exits; - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskGive.java b/archive/java/resonantinduction/electrical/armbot/command/TaskGive.java deleted file mode 100644 index 953e91c5..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskGive.java +++ /dev/null @@ -1,125 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.electrical.armbot.TaskBaseArmbot; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.coding.IProgrammableMachine; -import resonantinduction.old.api.coding.args.ArgumentIntData; -import universalelectricity.api.vector.Vector2; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.InvInteractionHelper; -import calclavia.lib.utility.MathUtility; - -import com.builtbroken.common.science.units.UnitHelper; - -public class TaskGive extends TaskBaseArmbot -{ - - private ItemStack stack; - private int ammount = -1; - - public TaskGive() - { - super("give"); - this.args.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1)); - this.args.add(new ArgumentIntData("blockMeta", -1, 15, -1)); - this.args.add(new ArgumentIntData("stackSize", -1, 64, -1)); - this.UV = new Vector2(60, 80); - } - - @Override - public ProcessReturn onMethodCalled() - { - if (super.onMethodCalled() == ProcessReturn.CONTINUE) - { - - ammount = UnitHelper.tryToParseInt(this.getArg("stackSize"), -1); - int blockID = UnitHelper.tryToParseInt(this.getArg("blockID"), -1); - int blockMeta = UnitHelper.tryToParseInt(this.getArg("blockMeta"), 32767); - - if (blockID > 0) - { - stack = new ItemStack(blockID, ammount <= 0 ? 1 : ammount, blockMeta == -1 ? 32767 : blockMeta); - } - - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE) - { - TileEntity targetTile = ((IArmbot) this.program.getMachine()).getHandPos().getTileEntity(this.program.getMachine().getLocation().left()); - - if (targetTile != null && ((IArmbot) this.program.getMachine()).getHeldObject() instanceof ItemStack) - { - ForgeDirection direction = MathUtility.getFacingDirectionFromAngle((float) ((IArmbot) this.program.getMachine()).getRotation().x); - ItemStack itemStack = (ItemStack) ((IArmbot) this.program.getMachine()).getHeldObject(); - List stacks = new ArrayList(); - if (this.stack != null) - { - stacks.add(stack); - } - InvInteractionHelper invEx = new InvInteractionHelper(this.program.getMachine().getLocation().left(), this.program.getMachine().getLocation().right(), stacks, false); - ItemStack insertStack = invEx.tryPlaceInPosition(itemStack, new Vector3(targetTile), direction.getOpposite()); - if (((IArmbot) this.program.getMachine()).clear(itemStack)) - { - ((IArmbot) this.program.getMachine()).grabObject(insertStack); - } - } - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public String toString() - { - return super.toString() + " " + (stack != null ? stack.toString() : "1x???@???"); - } - - @Override - public TaskBaseProcess loadProgress(NBTTagCompound taskCompound) - { - super.loadProgress(taskCompound); - this.stack = ItemStack.loadItemStackFromNBT(taskCompound.getCompoundTag("item")); - return this; - } - - @Override - public NBTTagCompound saveProgress(NBTTagCompound taskCompound) - { - super.saveProgress(taskCompound); - if (stack != null) - { - NBTTagCompound tag = new NBTTagCompound(); - this.stack.writeToNBT(tag); - taskCompound.setTag("item", tag); - } - return taskCompound; - } - - @Override - public TaskBaseProcess clone() - { - return new TaskGive(); - } - - @Override - public boolean canUseTask(IProgrammableMachine device) - { - // TODO Auto-generated method stub - return false; - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskGrabEntity.java b/archive/java/resonantinduction/electrical/armbot/command/TaskGrabEntity.java deleted file mode 100644 index c3435a47..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskGrabEntity.java +++ /dev/null @@ -1,135 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.List; - -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.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.EntityDictionary; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.coding.args.ArgumentData; - -public class TaskGrabEntity extends TaskGrabPrefab -{ - /** - * If the grab command is specific to one entity this tell whether or not to grab the child - * version of that entity. - */ - public boolean child = false; - /** The item to be collected. */ - private Class entityToInclude; - - @SuppressWarnings("unchecked") - public TaskGrabEntity() - { - super("Grab-Entity"); - this.args.add(new ArgumentData("child", false)); - // this.defautlArguments.add(new ArgumentListData>("Entity", - // Entity.class, (Class[]) EntityDictionary.getList().toArray(new - // Object[1]))); - } - - @Override - public ProcessReturn onMethodCalled() - { - if (super.onMethodCalled() == ProcessReturn.CONTINUE) - { - this.entityToInclude = Entity.class; - try - { - if (this.getArg("Entity") instanceof Class) - { - this.entityToInclude = (Class) this.getArg("Entity"); - } - } - catch (Exception e) - { - - } - if (this.getArg("child") instanceof Boolean) - { - this.child = (Boolean) this.getArg("child"); - } - - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE) - { - if (((IArmbot) this.program.getMachine()).getHeldObject() != null) - { - return ProcessReturn.DONE; - } - @SuppressWarnings("unchecked") - List found = this.program.getMachine().getLocation().left().getEntitiesWithinAABB(entityToInclude, AxisAlignedBB.getBoundingBox(this.armPos.x - radius, this.armPos.y - radius, this.armPos.z - radius, this.armPos.x + radius, this.armPos.y + radius, this.armPos.z + radius)); - - if (found != null && found.size() > 0) - { - for (Entity entity : found) - { - if ((entity != null && !(entity instanceof EntityArrow) && !(entity instanceof EntityPlayer) && (!(entity instanceof EntityAgeable) || (entity instanceof EntityAgeable && child == ((EntityAgeable) entity).isChild())))) - { - ((IArmbot) this.program.getMachine()).grabObject(entity); - if (this.belt != null) - { - belt.ignoreEntity(entity); - } - return ProcessReturn.DONE; - } - } - } - - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public void load(NBTTagCompound taskCompound) - { - super.loadProgress(taskCompound); - this.child = taskCompound.getBoolean("child"); - this.entityToInclude = EntityDictionary.get(taskCompound.getString("name")); - } - - @Override - public void save(NBTTagCompound taskCompound) - { - super.saveProgress(taskCompound); - taskCompound.setBoolean("child", child); - taskCompound.setString("name", ((this.entityToInclude != null) ? EntityDictionary.get(this.entityToInclude) : "")); - } - - @Override - public String toString() - { - String baby = ""; - String entity = ""; - if (this.entityToInclude != null) - { - entity = EntityDictionary.get(this.entityToInclude); - if (this.child) - { - // TODO do check for EntityAgable - baby = "baby "; - } - } - return "GRAB " + baby + entity; - } - - @Override - public TaskBaseProcess clone() - { - return new TaskGrabEntity(); - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskGrabItem.java b/archive/java/resonantinduction/electrical/armbot/command/TaskGrabItem.java deleted file mode 100644 index c1d5c82a..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskGrabItem.java +++ /dev/null @@ -1,84 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.coding.args.ArgumentIntData; - -import com.builtbroken.common.science.units.UnitHelper; - -public class TaskGrabItem extends TaskGrabPrefab -{ - ItemStack stack = null; - - public TaskGrabItem() - { - super("Grab-Item"); - this.args.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1)); - this.args.add(new ArgumentIntData("blockMeta", -1, 15, -1)); - this.args.add(new ArgumentIntData("stackSize", -1, 64, -1)); - } - - @Override - public ProcessReturn onMethodCalled() - { - if (super.onMethodCalled() == ProcessReturn.CONTINUE) - { - int ammount = UnitHelper.tryToParseInt(this.getArg("stackSize"), -1); - int blockID = UnitHelper.tryToParseInt(this.getArg("blockID"), -1); - int blockMeta = UnitHelper.tryToParseInt(this.getArg("blockMeta"), 32767); - - if (blockID > 0) - { - stack = new ItemStack(blockID, ammount <= 0 ? 1 : ammount, blockMeta == -1 ? 32767 : blockMeta); - } - - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE) - { - if (((IArmbot) this.program.getMachine()).getHeldObject() != null) - { - return ProcessReturn.DONE; - } - List found = this.program.getMachine().getLocation().left().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(this.armPos.x - radius, this.armPos.y - radius, this.armPos.z - radius, this.armPos.x + radius, this.armPos.y + radius, this.armPos.z + radius)); - - if (found != null && found.size() > 0) - { - for (EntityItem item : found) - { - if (stack == null || item.getEntityItem().isItemEqual(stack)) - { - if (((IArmbot) this.program.getMachine()).grabObject(item)) - { - if (this.belt != null) - { - belt.ignoreEntity(item); - } - return ProcessReturn.DONE; - } - } - } - } - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public TaskBaseProcess clone() - { - return new TaskGrabItem(); - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskGrabPrefab.java b/archive/java/resonantinduction/electrical/armbot/command/TaskGrabPrefab.java deleted file mode 100644 index c8af2efd..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskGrabPrefab.java +++ /dev/null @@ -1,61 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.electrical.armbot.TaskBaseArmbot; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.IBelt; -import universalelectricity.api.vector.Vector2; -import universalelectricity.api.vector.Vector3; - -/** - * Prefab for grab based commands - * - * @author DarkGuardsman - */ -public abstract class TaskGrabPrefab extends TaskBaseArmbot -{ - public static final float radius = 0.5f; - protected Vector3 armPos; - protected IBelt belt; - - public TaskGrabPrefab(String name) - { - super(name); - this.UV = new Vector2(0, 80); - } - - @Override - public ProcessReturn onMethodCalled() - { - ProcessReturn re = super.onMethodCalled(); - if (re == ProcessReturn.CONTINUE) - { - this.armPos = ((IArmbot) this.program.getMachine()).getHandPos(); - TileEntity entity = this.armPos.getTileEntity(this.program.getMachine().getLocation().left()); - if (entity == null) - { - entity = this.armPos.clone().translate(new Vector3(ForgeDirection.DOWN)).getTileEntity(this.program.getMachine().getLocation().left()); - } - if (entity instanceof IBelt) - { - this.belt = (IBelt) entity; - } - return ProcessReturn.CONTINUE; - } - return re; - } - - @Override - public ProcessReturn onUpdate() - { - super.onUpdate(); - - if (((IArmbot) this.program.getMachine()).getHeldObject() != null) - { - return ProcessReturn.DONE; - } - - return ProcessReturn.CONTINUE; - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskHarvest.java b/archive/java/resonantinduction/electrical/armbot/command/TaskHarvest.java deleted file mode 100644 index 60d022e8..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskHarvest.java +++ /dev/null @@ -1,22 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -/** - * Used by arms to break a specific block in a position. - * - * @author DarkGuardsman - */ -public class TaskHarvest extends TaskBreak -{ - - public TaskHarvest() - { - super("Harvest"); - } - - @Override - public ProcessReturn onMethodCalled() - { - this.keep = true; - return super.onMethodCalled(); - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskIF.java b/archive/java/resonantinduction/electrical/armbot/command/TaskIF.java deleted file mode 100644 index 562dfe8f..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskIF.java +++ /dev/null @@ -1,102 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.ArrayList; -import java.util.List; - -import resonantinduction.electrical.armbot.TaskBaseLogic; -import resonantinduction.old.api.coding.IProgrammableMachine; -import resonantinduction.old.api.coding.ITask; -import resonantinduction.old.api.coding.args.ArgumentData; -import universalelectricity.api.vector.Vector2; - -/** @author DarkGuardsman */ -public class TaskIF extends TaskBaseLogic -{ - protected ITask exitTruePoint = null; - protected ITask exitFalsePoint = null; - protected List exits = new ArrayList(); - protected boolean isTrue = false; - - public TaskIF() - { - super("IF"); - this.args.add(new ArgumentData("check", "statement")); - this.args.add(new ArgumentData("compare", "statement")); - this.UV = new Vector2(0, 120); - } - - public TaskIF(ITask trueExit, ITask falseExit) - { - this(); - this.exitTruePoint = trueExit; - this.exitFalsePoint = falseExit; - - } - - @Override - public void refresh() - { - super.refresh(); - if (this.getArg("check") != null && this.getArg("compare") != null) - { - this.isTrue = this.getArg("check").equals(this.getArg("compare")); - } - if (exitTruePoint == null) - { - exitTruePoint = this.program.getTaskAt(this.getCol() + 1, this.getRow()); - } - if (exitFalsePoint == null) - { - exitFalsePoint = this.program.getTaskAt(this.getCol(), this.getRow() + 1); - ; - } - } - - @Override - public TaskIF clone() - { - return new TaskIF(); - } - - @Override - public ITask getExitPoint() - { - if (this.isTrue) - { - return this.exitTruePoint; - } - return this.exitFalsePoint; - } - - @Override - public int getMaxExitPoints() - { - return 2; - } - - @Override - public void setExitPoint(int i, ITask task) - { - if (i == 0) - { - this.exitFalsePoint = task; - } - else if (i == 1) - { - this.exitTruePoint = task; - } - } - - @Override - public boolean canUseTask(IProgrammableMachine device) - { - return true; - } - - @Override - public List getExits() - { - return this.exits; - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskIdle.java b/archive/java/resonantinduction/electrical/armbot/command/TaskIdle.java deleted file mode 100644 index 850bef1e..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskIdle.java +++ /dev/null @@ -1,108 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.coding.IProgrammableMachine; -import resonantinduction.old.api.coding.args.ArgumentData; - -import com.builtbroken.common.science.units.UnitHelper; - -public class TaskIdle extends TaskBaseProcess -{ - - /** The amount of time in which the machine will idle. */ - public int idleTime = 80; - private int totalIdleTime = 80; - - public TaskIdle() - { - super("wait"); - this.args.add(new ArgumentData("idleTime", 20)); - } - - @Override - public ProcessReturn onMethodCalled() - { - if (super.onMethodCalled() == ProcessReturn.CONTINUE) - { - - if (UnitHelper.tryToParseInt(this.getArg("idleTime")) > 0) - { - this.totalIdleTime = this.idleTime = UnitHelper.tryToParseInt(this.getArg("idleTime")); - return ProcessReturn.CONTINUE; - } - - return ProcessReturn.ARGUMENT_ERROR; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (this.idleTime > 0) - { - this.idleTime--; - return ProcessReturn.CONTINUE; - } - return ProcessReturn.DONE; - } - - @Override - public void load(NBTTagCompound taskCompound) - { - super.load(taskCompound); - this.totalIdleTime = taskCompound.getInteger("idleTotal"); - } - - @Override - public void save(NBTTagCompound taskCompound) - { - super.save(taskCompound); - taskCompound.setInteger("idleTotal", this.totalIdleTime); - } - - @Override - public TaskBaseProcess loadProgress(NBTTagCompound taskCompound) - { - super.loadProgress(taskCompound); - this.idleTime = taskCompound.getInteger("idleTime"); - return this; - } - - @Override - public NBTTagCompound saveProgress(NBTTagCompound taskCompound) - { - super.saveProgress(taskCompound); - taskCompound.setInteger("idleTime", this.idleTime); - return taskCompound; - } - - @Override - public String toString() - { - return super.toString() + " " + Integer.toString(this.totalIdleTime); - } - - @Override - public TaskBaseProcess clone() - { - return new TaskIdle(); - } - - @Override - public boolean canUseTask(IProgrammableMachine device) - { - return true; - } - - @Override - public void getToolTips(List list) - { - super.getToolTips(list); - list.add(" Wait: " + this.totalIdleTime); - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskPlace.java b/archive/java/resonantinduction/electrical/armbot/command/TaskPlace.java deleted file mode 100644 index 6e311e87..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskPlace.java +++ /dev/null @@ -1,102 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import net.minecraft.block.Block; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.common.IPlantable; -import resonantinduction.electrical.armbot.TaskBaseArmbot; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.IArmbot; -import universalelectricity.api.vector.Vector3; - -/** - * Used by arms to break a specific block in a position. - * - * @author Calclavia - */ -public class TaskPlace extends TaskBaseArmbot -{ - int PLACE_TIME = 30; - - public TaskPlace() - { - super("Place"); - // TODO Auto-generated constructor stub - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE) - { - Vector3 serachPosition = ((IArmbot) this.program.getMachine()).getHandPos(); - - Block block = Block.blocksList[serachPosition.getBlockID(this.program.getMachine().getLocation().left())]; - - if (block == null && ticks >= this.PLACE_TIME) - { - Object entity = ((IArmbot) this.program.getMachine()).getHeldObject(); - ItemStack itemStack = null; - if (entity instanceof EntityItem) - { - itemStack = ((EntityItem) entity).getEntityItem(); - } - if (entity instanceof ItemStack) - { - itemStack = (ItemStack) entity; - } - if (itemStack != null) - { - if (itemStack.getItem() instanceof ItemBlock) - { - ((ItemBlock) itemStack.getItem()).placeBlockAt(itemStack, null, this.program.getMachine().getLocation().left(), serachPosition.intX(), serachPosition.intY(), serachPosition.intZ(), 0, 0.5f, 0.5f, 0.5f, itemStack.getItemDamage()); - - ((IArmbot) this.program.getMachine()).clear(entity); - return ProcessReturn.DONE; - } - else if (itemStack.getItem() instanceof IPlantable) - { - IPlantable plantable = ((IPlantable) itemStack.getItem()); - Block blockBelow = Block.blocksList[Vector3.translate(serachPosition, new Vector3(0, -1, 0)).getBlockID(this.program.getMachine().getLocation().left())]; - - if (blockBelow != null) - { - if (blockBelow.canSustainPlant(this.program.getMachine().getLocation().left(), serachPosition.intX(), serachPosition.intY(), serachPosition.intZ(), ForgeDirection.UP, plantable)) - { - int blockID = plantable.getPlantID(this.program.getMachine().getLocation().left(), serachPosition.intX(), serachPosition.intY(), serachPosition.intZ()); - int blockMetadata = plantable.getPlantMetadata(this.program.getMachine().getLocation().left(), serachPosition.intX(), serachPosition.intY(), serachPosition.intZ()); - - if (this.program.getMachine().getLocation().left().setBlock(serachPosition.intX(), serachPosition.intY(), serachPosition.intZ(), blockID, blockMetadata, 3)) - { - if (this.program.getMachine().getLocation().left().getBlockId(serachPosition.intX(), serachPosition.intY(), serachPosition.intZ()) == blockID) - { - Block.blocksList[blockID].onBlockPlacedBy(this.program.getMachine().getLocation().left(), serachPosition.intX(), serachPosition.intY(), serachPosition.intZ(), null, itemStack); - Block.blocksList[blockID].onPostBlockPlaced(this.program.getMachine().getLocation().left(), serachPosition.intX(), serachPosition.intY(), serachPosition.intZ(), blockMetadata); - ((IArmbot) this.program.getMachine()).clear(entity); - return ProcessReturn.DONE; - } - } - } - } - } - } - } - return ProcessReturn.DONE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public String toString() - { - return "PLACE"; - } - - @Override - public TaskBaseProcess clone() - { - return new TaskPlace(); - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskReturn.java b/archive/java/resonantinduction/electrical/armbot/command/TaskReturn.java deleted file mode 100644 index 28dd25b8..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskReturn.java +++ /dev/null @@ -1,18 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import resonantinduction.electrical.armbot.TaskBaseProcess; - -public class TaskReturn extends TaskRotateTo -{ - public TaskReturn() - { - super("Return", 0, 0); - } - - @Override - public TaskBaseProcess clone() - { - return new TaskReturn(); - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskRotateBy.java b/archive/java/resonantinduction/electrical/armbot/command/TaskRotateBy.java deleted file mode 100644 index 54468505..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskRotateBy.java +++ /dev/null @@ -1,102 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import resonantinduction.electrical.armbot.TaskBaseArmbot; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.coding.args.ArgumentIntData; -import universalelectricity.api.vector.Vector2; -import calclavia.lib.utility.MathUtility; - -import com.builtbroken.common.science.units.UnitHelper; - -/** - * Rotates an armbot by a set amount - * - * @author DarkGuardsman - */ -public class TaskRotateBy extends TaskBaseArmbot -{ - - int targetRotationYaw = 0, targetRotationPitch = 0, deltaPitch = 0, deltaYaw = 0; - - private TaskRotateTo rotateToCommand; - - public TaskRotateBy(int yaw, int pitch) - { - super("RotateBy"); - this.args.add(new ArgumentIntData("yaw", yaw, 360, 0)); - this.args.add(new ArgumentIntData("pitch", pitch, 360, 0)); - this.UV = new Vector2(80, 80); - } - - public TaskRotateBy() - { - this(0, 0); - } - - @Override - public ProcessReturn onMethodCalled() - { - if (super.onMethodCalled() == ProcessReturn.CONTINUE) - { - this.targetRotationYaw = (int) MathUtility.clampAngleTo360((float) (((IArmbot) this.program.getMachine()).getRotation().x + UnitHelper.tryToParseInt(this.getArg("yaw")))); - this.targetRotationPitch = (int) MathUtility.clampAngleTo360((float) (((IArmbot) this.program.getMachine()).getRotation().x + UnitHelper.tryToParseInt(this.getArg("pitch")))); - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (this.rotateToCommand == null) - { - this.rotateToCommand = new TaskRotateTo(this.targetRotationYaw, this.targetRotationPitch); - this.rotateToCommand.setProgram(this.program); - this.rotateToCommand.onMethodCalled(); - } - - return this.rotateToCommand.onUpdate(); - } - - @Override - public void load(NBTTagCompound taskCompound) - { - super.loadProgress(taskCompound); - this.targetRotationPitch = taskCompound.getInteger("rotPitch"); - this.targetRotationYaw = taskCompound.getInteger("rotYaw"); - - } - - @Override - public void save(NBTTagCompound taskCompound) - { - super.saveProgress(taskCompound); - taskCompound.setInteger("rotPitch", this.targetRotationPitch); - taskCompound.setInteger("rotYaw", this.targetRotationYaw); - - } - - @Override - public String toString() - { - return super.toString() + " Yaw:" + Integer.toString(this.targetRotationYaw) + " Pitch:" + Integer.toString(this.targetRotationPitch); - } - - @Override - public TaskBaseProcess clone() - { - return new TaskRotateBy(); - } - - @Override - public void getToolTips(List list) - { - super.getToolTips(list); - list.add(" Yaw: " + this.targetRotationYaw); - list.add(" Pitch: " + this.targetRotationPitch); - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskRotateTo.java b/archive/java/resonantinduction/electrical/armbot/command/TaskRotateTo.java deleted file mode 100644 index 6fc544a1..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskRotateTo.java +++ /dev/null @@ -1,100 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import resonantinduction.electrical.armbot.TaskBaseArmbot; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.coding.args.ArgumentIntData; -import universalelectricity.api.vector.Vector2; -import calclavia.lib.utility.MathUtility; - -import com.builtbroken.common.science.units.UnitHelper; - -/** - * Rotates the armbot to a specific direction. - * - * @author DarkGuardsman - */ -public class TaskRotateTo extends TaskBaseArmbot -{ - int targetRotationYaw = 0, targetRotationPitch = 0; - - public TaskRotateTo() - { - this(0, 0); - } - - public TaskRotateTo(int yaw, int pitch) - { - this("RotateTo", yaw, pitch); - } - - public TaskRotateTo(String string, int yaw, int pitch) - { - super(string); - this.args.add(new ArgumentIntData("yaw", yaw, 360, 0)); - this.args.add(new ArgumentIntData("pitch", pitch, 360, 0)); - this.UV = new Vector2(100, 80); - } - - @Override - public ProcessReturn onMethodCalled() - { - if (super.onMethodCalled() == ProcessReturn.CONTINUE) - { - this.targetRotationYaw = (int) MathUtility.clampAngleTo360(UnitHelper.tryToParseInt(this.getArg("yaw"))); - this.targetRotationPitch = (int) MathUtility.clampAngleTo360(UnitHelper.tryToParseInt(this.getArg("pitch"))); - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE) - { - ((IArmbot) this.program.getMachine()).moveArmTo(this.targetRotationYaw, this.targetRotationPitch); - return ((IArmbot) this.program.getMachine()).getRotation().intX() != this.targetRotationYaw || ((IArmbot) this.program.getMachine()).getRotation().intY() != this.targetRotationPitch ? ProcessReturn.CONTINUE : ProcessReturn.DONE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public String toString() - { - return super.toString() + " Yaw:" + Integer.toString(this.targetRotationYaw) + " Pitch:" + Integer.toString(this.targetRotationPitch); - } - - @Override - public void load(NBTTagCompound taskCompound) - { - super.load(taskCompound); - this.targetRotationPitch = taskCompound.getInteger("rotPitch"); - this.targetRotationYaw = taskCompound.getInteger("rotYaw"); - } - - @Override - public void save(NBTTagCompound taskCompound) - { - super.save(taskCompound); - taskCompound.setInteger("rotPitch", this.targetRotationPitch); - taskCompound.setInteger("rotYaw", this.targetRotationYaw); - } - - @Override - public TaskBaseProcess clone() - { - return new TaskRotateTo(); - } - - @Override - public void getToolTips(List list) - { - super.getToolTips(list); - list.add(" Yaw: " + this.targetRotationYaw); - list.add(" Pitch: " + this.targetRotationPitch); - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskStart.java b/archive/java/resonantinduction/electrical/armbot/command/TaskStart.java deleted file mode 100644 index ca4b851e..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskStart.java +++ /dev/null @@ -1,24 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import resonantinduction.electrical.armbot.TaskBase; - -/** - * Fake task as the player can not create, edit, or do anything with this task. Its only used to - * allow the gui to render the task as an actual task instance - * - * @author DarkGaurdsman - */ -public class TaskStart extends TaskBase -{ - public TaskStart() - { - super("Start", TaskType.START); - } - - @Override - public TaskBase clone() - { - return new TaskStart(); - } - -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskTake.java b/archive/java/resonantinduction/electrical/armbot/command/TaskTake.java deleted file mode 100644 index 7b059fc7..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskTake.java +++ /dev/null @@ -1,113 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.electrical.armbot.TaskBaseArmbot; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.coding.args.ArgumentIntData; -import universalelectricity.api.vector.Vector2; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.InvInteractionHelper; -import calclavia.lib.utility.MathUtility; - -import com.builtbroken.common.science.units.UnitHelper; - -public class TaskTake extends TaskBaseArmbot -{ - - protected ItemStack stack; - protected int ammount = -1; - - public TaskTake() - { - super("Take"); - this.args.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1)); - this.args.add(new ArgumentIntData("blockMeta", -1, 15, -1)); - this.args.add(new ArgumentIntData("stackSize", -1, 64, -1)); - this.UV = new Vector2(40, 80); - } - - @Override - public ProcessReturn onMethodCalled() - { - if (super.onMethodCalled() == ProcessReturn.CONTINUE) - { - ammount = UnitHelper.tryToParseInt(this.getArg("stackSize"), -1); - int blockID = UnitHelper.tryToParseInt(this.getArg("blockID"), -1); - int blockMeta = UnitHelper.tryToParseInt(this.getArg("blockMeta"), 32767); - - if (blockID > 0) - { - stack = new ItemStack(blockID, ammount <= 0 ? 1 : ammount, blockMeta == -1 ? 32767 : blockMeta); - } - - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE) - { - TileEntity targetTile = ((IArmbot) this.program.getMachine()).getHandPos().getTileEntity(this.program.getMachine().getLocation().left()); - - if (targetTile != null && ((IArmbot) this.program.getMachine()).getHeldObject() instanceof ItemStack) - { - ForgeDirection direction = MathUtility.getFacingDirectionFromAngle(((IArmbot) this.program.getMachine()).getRotation().x); - List stacks = new ArrayList(); - if (this.stack != null) - { - stacks.add(stack); - } - InvInteractionHelper invEx = new InvInteractionHelper(this.program.getMachine().getLocation().left(), this.program.getMachine().getLocation().right(), stacks, false); - ((IArmbot) this.program.getMachine()).grabObject(invEx.tryGrabFromPosition(new Vector3(targetTile), direction, this.stack != null ? stack.stackSize : 1)); - return ((IArmbot) this.program.getMachine()).getHeldObject() != null ? ProcessReturn.DONE : ProcessReturn.CONTINUE; - - } - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public String toString() - { - return super.toString() + " " + (stack != null ? stack.toString() : "1x???@??? "); - } - - @Override - public void load(NBTTagCompound taskCompound) - { - super.load(taskCompound); - this.stack = ItemStack.loadItemStackFromNBT(taskCompound.getCompoundTag("item")); - - } - - @Override - public void save(NBTTagCompound taskCompound) - { - super.save(taskCompound); - if (stack != null) - { - NBTTagCompound tag = new NBTTagCompound(); - this.stack.writeToNBT(tag); - taskCompound.setTag("item", tag); - } - - } - - @Override - public TaskBaseProcess clone() - { - return new TaskTake(); - } -} diff --git a/archive/java/resonantinduction/electrical/armbot/command/TaskUse.java b/archive/java/resonantinduction/electrical/armbot/command/TaskUse.java deleted file mode 100644 index fc33c03d..00000000 --- a/archive/java/resonantinduction/electrical/armbot/command/TaskUse.java +++ /dev/null @@ -1,128 +0,0 @@ -package resonantinduction.electrical.armbot.command; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import resonantinduction.electrical.armbot.TaskBaseArmbot; -import resonantinduction.electrical.armbot.TaskBaseProcess; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.IArmbotUseable; -import resonantinduction.old.api.coding.IProcessTask; -import resonantinduction.old.api.coding.args.ArgumentIntData; - -import com.builtbroken.common.science.units.UnitHelper; - -public class TaskUse extends TaskBaseArmbot -{ - - protected int times, curTimes; - - public TaskUse() - { - super("use"); - this.args.add(new ArgumentIntData("repeat", 1, Integer.MAX_VALUE, 1)); - } - - @Override - public ProcessReturn onMethodCalled() - { - if (super.onMethodCalled() == ProcessReturn.CONTINUE) - { - this.curTimes = 0; - this.times = UnitHelper.tryToParseInt(this.getArg("repeat")); - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public ProcessReturn onUpdate() - { - if (super.onUpdate() == ProcessReturn.CONTINUE) - { - Block block = Block.blocksList[((IArmbot) this.program.getMachine()).getHandPos().getBlockID(this.program.getMachine().getLocation().left())]; - TileEntity targetTile = ((IArmbot) this.program.getMachine()).getHandPos().getTileEntity(this.program.getMachine().getLocation().left()); - - if (targetTile != null) - { - if (targetTile instanceof IArmbotUseable) - { - ((IArmbotUseable) targetTile).onUse(((IArmbot) this.program.getMachine()), this.getArgs()); - } - - } - else if (block != null) - { - try - { - boolean f = block.onBlockActivated(this.program.getMachine().getLocation().left(), ((IArmbot) this.program.getMachine()).getHandPos().intX(), ((IArmbot) this.program.getMachine()).getHandPos().intY(), ((IArmbot) this.program.getMachine()).getHandPos().intZ(), null, 0, 0, 0, 0); - } - catch (Exception e) - { - - e.printStackTrace(); - } - - } - - this.curTimes++; - - if (this.curTimes >= this.times) - { - return ProcessReturn.DONE; - } - - return ProcessReturn.CONTINUE; - } - return ProcessReturn.GENERAL_ERROR; - } - - @Override - public String toString() - { - return "USE " + Integer.toString(this.times); - } - - @Override - public void load(NBTTagCompound taskCompound) - { - super.load(taskCompound); - this.times = taskCompound.getInteger("useTimes"); - } - - @Override - public void save(NBTTagCompound taskCompound) - { - super.save(taskCompound); - taskCompound.setInteger("useTimes", this.times); - } - - @Override - public IProcessTask loadProgress(NBTTagCompound nbt) - { - this.curTimes = nbt.getInteger("useCurTimes"); - return this; - } - - @Override - public NBTTagCompound saveProgress(NBTTagCompound nbt) - { - nbt.setInteger("useCurTimes", this.curTimes); - return nbt; - } - - @Override - public TaskBaseProcess clone() - { - return new TaskUse(); - } - - @Override - public void getToolTips(List list) - { - super.getToolTips(list); - list.add(" Repeat: " + this.times); - } -} diff --git a/archive/java/resonantinduction/electrical/battery/BatteryStructure.java b/archive/java/resonantinduction/electrical/battery/BatteryStructure.java deleted file mode 100644 index ca410c6a..00000000 --- a/archive/java/resonantinduction/electrical/battery/BatteryStructure.java +++ /dev/null @@ -1,55 +0,0 @@ -package resonantinduction.electrical.battery; - -import java.util.Arrays; - -import calclavia.lib.multiblock.structure.Structure; - -public class BatteryStructure extends Structure -{ - public void redistribute(TileBattery... exclusion) - { - long totalEnergy = 0; - - for (TileBattery battery : this.get()) - { - totalEnergy += battery.getEnergy(null); - } - - int amountOfNodes = this.get().size() - exclusion.length; - - if (totalEnergy > 0 && amountOfNodes > 0) - { - long totalPerBattery = totalEnergy / amountOfNodes; - long totalPerBatteryRemainder = totalPerBattery + totalEnergy % amountOfNodes; - - TileBattery firstNode = this.getFirstNode(); - - for (TileBattery battery : this.get()) - { - if (!Arrays.asList(exclusion).contains(battery)) - { - if (battery == firstNode) - { - battery.setEnergy(null, totalPerBatteryRemainder); - } - else - { - battery.setEnergy(null, totalPerBattery); - } - } - } - } - } - - @Override - public Structure getNew() - { - return new BatteryStructure(); - } - - @Override - protected void refreshNode(TileBattery node) - { - node.setNetwork(this); - } -} diff --git a/archive/java/resonantinduction/electrical/battery/BlockBattery.java b/archive/java/resonantinduction/electrical/battery/BlockBattery.java deleted file mode 100644 index 63ea7010..00000000 --- a/archive/java/resonantinduction/electrical/battery/BlockBattery.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.battery; - -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.entity.EntityLivingBase; -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 resonantinduction.core.Reference; -import resonantinduction.core.prefab.block.BlockIOBase; -import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; -import universalelectricity.api.CompatibilityModule; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A block that detects power. - * - * @author Calclavia - * - */ -public class BlockBattery extends BlockIOBase implements ITileEntityProvider -{ - public BlockBattery(int id) - { - super("battery", id); - this.setTextureName(Reference.PREFIX + "machine"); - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, int id) - { - if (!world.isRemote) - { - if (id == blockID) - { - TileBattery battery = (TileBattery) world.getBlockTileEntity(x, y, z); - battery.updateStructure(); - } - } - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityliving, ItemStack itemstack) - { - if (!world.isRemote) - { - TileBattery battery = (TileBattery) world.getBlockTileEntity(x, y, z); - battery.updateStructure(); - } - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderType() - { - return ElectricalBlockRenderingHandler.INSTANCE.getRenderId(); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileBattery(); - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - int id = idPicked(world, x, y, z); - - if (id == 0) - { - return null; - } - - Item item = Item.itemsList[id]; - if (item == null) - { - return null; - } - - TileBattery battery = (TileBattery) world.getBlockTileEntity(x, y, z); - return CompatibilityModule.getItemWithCharge(new ItemStack(id, 1, getDamageValue(world, x, y, z)), battery.getEnergy(null)); - } -} diff --git a/archive/java/resonantinduction/electrical/battery/ItemBlockBattery.java b/archive/java/resonantinduction/electrical/battery/ItemBlockBattery.java deleted file mode 100644 index a8db9902..00000000 --- a/archive/java/resonantinduction/electrical/battery/ItemBlockBattery.java +++ /dev/null @@ -1,161 +0,0 @@ -package resonantinduction.electrical.battery; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import universalelectricity.api.CompatibilityModule; -import universalelectricity.api.UniversalClass; -import universalelectricity.api.UniversalElectricity; -import universalelectricity.api.energy.UnitDisplay; -import universalelectricity.api.energy.UnitDisplay.Unit; -import universalelectricity.api.item.IEnergyItem; -import universalelectricity.api.item.IVoltageItem; -import calclavia.lib.render.EnumColor; -import calclavia.lib.utility.LanguageUtility; - -@UniversalClass -public class ItemBlockBattery extends ItemBlock implements IEnergyItem, IVoltageItem -{ - public ItemBlockBattery(int id) - { - super(id); - this.setMaxStackSize(1); - this.setMaxDamage(100); - this.setNoRepair(); - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean par4) - { - String color = ""; - long joules = this.getEnergy(itemStack); - - if (joules <= this.getEnergyCapacity(itemStack) / 3) - { - color = "\u00a74"; - } - else if (joules > this.getEnergyCapacity(itemStack) * 2 / 3) - { - color = "\u00a72"; - } - else - { - color = "\u00a76"; - } - - list.add(LanguageUtility.getLocal("tooltip.battery.energy").replace("%0", color).replace("%1", EnumColor.GREY.toString()).replace("%v0", UnitDisplay.getDisplayShort(joules, Unit.JOULES)).replace("%v1", UnitDisplay.getDisplayShort(this.getEnergyCapacity(itemStack), Unit.JOULES))); - } - - @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) - { - boolean place = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); - - if (place) - { - TileBattery tileEntity = (TileBattery) world.getBlockTileEntity(x, y, z); - tileEntity.setEnergy(null, this.getEnergy(stack)); - } - - return place; - } - - /** - * Makes sure the item is uncharged when it is crafted and not charged. Change this if you do - * not want this to happen! - */ - @Override - public void onCreated(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer) - { - this.setEnergy(itemStack, 0); - } - - @Override - public long recharge(ItemStack itemStack, long energy, boolean doReceive) - { - long rejectedElectricity = Math.max((this.getEnergy(itemStack) + energy) - this.getEnergyCapacity(itemStack), 0); - long energyToReceive = Math.min(energy - rejectedElectricity, getTransferRate(itemStack)); - - if (doReceive) - { - this.setEnergy(itemStack, this.getEnergy(itemStack) + energyToReceive); - } - - return energyToReceive; - } - - @Override - public long discharge(ItemStack itemStack, long energy, boolean doTransfer) - { - long energyToExtract = Math.min(Math.min(this.getEnergy(itemStack), energy), getTransferRate(itemStack)); - - if (doTransfer) - { - this.setEnergy(itemStack, this.getEnergy(itemStack) - energyToExtract); - } - - return energyToExtract; - } - - @Override - public long getVoltage(ItemStack itemStack) - { - return UniversalElectricity.DEFAULT_VOLTAGE; - } - - @Override - public void setEnergy(ItemStack itemStack, long joules) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - long electricityStored = Math.max(Math.min(joules, this.getEnergyCapacity(itemStack)), 0); - itemStack.getTagCompound().setLong("electricity", electricityStored); - itemStack.setItemDamage((int) (100 - ((double) electricityStored / (double) getEnergyCapacity(itemStack)) * 100)); - } - - public long getTransfer(ItemStack itemStack) - { - return this.getEnergyCapacity(itemStack) - this.getEnergy(itemStack); - } - - /** Gets the energy stored in the item. Energy is stored using item NBT */ - @Override - public long getEnergy(ItemStack itemStack) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - long energyStored = itemStack.getTagCompound().getLong("electricity"); - itemStack.setItemDamage((int) (100 - ((double) energyStored / (double) getEnergyCapacity(itemStack)) * 100)); - return energyStored; - } - - @Override - public long getEnergyCapacity(ItemStack theItem) - { - return TileBattery.STORAGE; - } - - public long getTransferRate(ItemStack itemStack) - { - return this.getEnergyCapacity(itemStack) / 100; - } - - @Override - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - par3List.add(CompatibilityModule.getItemWithCharge(new ItemStack(this), 0)); - par3List.add(CompatibilityModule.getItemWithCharge(new ItemStack(this), this.getEnergyCapacity(new ItemStack(this)))); - } - -} diff --git a/archive/java/resonantinduction/electrical/battery/RenderBattery.java b/archive/java/resonantinduction/electrical/battery/RenderBattery.java deleted file mode 100644 index ac1ce329..00000000 --- a/archive/java/resonantinduction/electrical/battery/RenderBattery.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.battery; - -import static org.lwjgl.opengl.GL11.glPopMatrix; -import static org.lwjgl.opengl.GL11.glPushMatrix; -import static org.lwjgl.opengl.GL11.glScalef; -import static org.lwjgl.opengl.GL11.glTranslatef; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.AdvancedModelLoader; -import net.minecraftforge.client.model.IModelCustom; -import resonantinduction.core.Reference; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -@SideOnly(Side.CLIENT) -public class RenderBattery extends TileEntitySpecialRenderer -{ - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "battery.png"); - public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "battery.obj"); - - @Override - public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) - { - glPushMatrix(); - glTranslatef((float) x + 0.5F, (float) y + 0.1f, (float) z + 0.5F); - glScalef(0.46f, 0.46f, 0.46f); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - MODEL.renderAll(); - glPopMatrix(); - } -} diff --git a/archive/java/resonantinduction/electrical/battery/TileBattery.java b/archive/java/resonantinduction/electrical/battery/TileBattery.java deleted file mode 100644 index 98d108ff..00000000 --- a/archive/java/resonantinduction/electrical/battery/TileBattery.java +++ /dev/null @@ -1,189 +0,0 @@ -package resonantinduction.electrical.battery; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Set; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.ResonantInduction; -import universalelectricity.api.UniversalElectricity; -import universalelectricity.api.electricity.IVoltageInput; -import universalelectricity.api.electricity.IVoltageOutput; -import universalelectricity.api.energy.EnergyStorageHandler; -import universalelectricity.api.energy.IEnergyContainer; -import universalelectricity.api.energy.IEnergyInterface; -import universalelectricity.api.net.IConnector; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.network.IPacketReceiver; -import calclavia.lib.network.IPacketSender; -import calclavia.lib.prefab.tile.TileElectrical; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.PacketDispatcher; - -/** - * A modular battery. - * - * @author Calclavia - */ -public class TileBattery extends TileElectrical implements IConnector, IVoltageInput, IVoltageOutput, IPacketSender, IPacketReceiver, IEnergyInterface, IEnergyContainer -{ - public static final long STORAGE = 1000000000; - - /** The transfer rate **/ - public static final long DEFAULT_WATTAGE = (long) (STORAGE * 0.01); - - /** Voltage increases as series connection increases */ - public static final long DEFAULT_VOLTAGE = UniversalElectricity.DEFAULT_VOLTAGE; - - private BatteryStructure structure; - - public Set playersUsing = new HashSet(); - - public float clientEnergy; - public int clientCells; - public float clientMaxEnergy; - - public TileBattery() - { - this.energy = new EnergyStorageHandler(STORAGE); - this.saveIOMap = true; - } - - @Override - public void initiate() - { - this.updateStructure(); - } - - public void updateStructure() - { - if (!this.worldObj.isRemote) - { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity tile = new Vector3(this).modifyPositionFromSide(dir).getTileEntity(this.worldObj); - - if (tile instanceof TileBattery) - { - this.getNetwork().merge(((TileBattery) tile).getNetwork()); - } - } - - this.energy.setMaxTransfer(DEFAULT_WATTAGE * this.getNetwork().get().size()); - this.getNetwork().redistribute(); - } - } - - @Override - public void updateEntity() - { - super.updateEntity(); - - if (!this.worldObj.isRemote) - { - if (this.produce() > 0) - { - this.getNetwork().redistribute(); - } - } - } - - @Override - public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) - { - long returnValue = super.onReceiveEnergy(from, receive, doReceive); - this.getNetwork().redistribute(); - return returnValue; - } - - @Override - public long onExtractEnergy(ForgeDirection from, long extract, boolean doExtract) - { - long returnValue = super.onExtractEnergy(from, extract, doExtract); - this.getNetwork().redistribute(); - return returnValue; - } - - public void updateClient() - { - PacketDispatcher.sendPacketToAllPlayers(ResonantInduction.PACKET_TILE.getPacket(this, getPacketData(0).toArray())); - } - - @Override - public void onReceivePacket(ByteArrayDataInput data, EntityPlayer player, Object... extra) - { - } - - @Override - public ArrayList getPacketData(int type) - { - ArrayList data = new ArrayList(); - return data; - } - - @Override - public BatteryStructure getNetwork() - { - if (this.structure == null) - { - this.structure = new BatteryStructure(); - this.structure.add(this); - } - - return this.structure; - } - - @Override - public void setNetwork(BatteryStructure structure) - { - this.structure = structure; - } - - @Override - public Object[] getConnections() - { - Object[] connections = new Object[6]; - - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity tile = new Vector3(this).modifyPositionFromSide(dir).getTileEntity(this.worldObj); - - if (tile instanceof TileBattery) - { - connections[dir.ordinal()] = tile; - } - } - - return connections; - } - - @Override - public void invalidate() - { - this.getNetwork().redistribute(this); - this.getNetwork().split(this); - super.invalidate(); - } - - @Override - public long getVoltageOutput(ForgeDirection side) - { - return DEFAULT_VOLTAGE; - } - - @Override - public long getVoltageInput(ForgeDirection direction) - { - return DEFAULT_VOLTAGE; - } - - @Override - public void onWrongVoltage(ForgeDirection direction, long voltage) - { - - } -} diff --git a/archive/java/resonantinduction/electrical/generator/solar/BlockSolarPanel.java b/archive/java/resonantinduction/electrical/generator/solar/BlockSolarPanel.java deleted file mode 100644 index 69075bbe..00000000 --- a/archive/java/resonantinduction/electrical/generator/solar/BlockSolarPanel.java +++ /dev/null @@ -1,42 +0,0 @@ -package resonantinduction.electrical.generator.solar; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockSolarPanel extends BlockMachine -{ - public BlockSolarPanel() - { - super("solarPanel"); - this.setBlockBounds(0, 0, 0, 1, 0.5f, 1); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileSolarPanel(); - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderType() - { - return ElectricalBlockRenderingHandler.ID; - } -} diff --git a/archive/java/resonantinduction/electrical/generator/solar/ModelSolarPanel.java b/archive/java/resonantinduction/electrical/generator/solar/ModelSolarPanel.java deleted file mode 100644 index 9c78a6aa..00000000 --- a/archive/java/resonantinduction/electrical/generator/solar/ModelSolarPanel.java +++ /dev/null @@ -1,76 +0,0 @@ -package resonantinduction.electrical.generator.solar; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelSolarPanel extends ModelBase -{ - // fields - ModelRenderer base; - ModelRenderer neck; - ModelRenderer panel; - ModelRenderer brace; - ModelRenderer braceLeft; - ModelRenderer braceRight; - - public ModelSolarPanel() - { - textureWidth = 128; - textureHeight = 128; - - base = new ModelRenderer(this, 0, 0); - base.addBox(-3.5F, 0F, -3.5F, 7, 1, 7); - base.setRotationPoint(0F, 23F, 0F); - base.setTextureSize(128, 128); - base.mirror = true; - setRotation(base, 0F, 0F, 0F); - neck = new ModelRenderer(this, 57, 17); - neck.addBox(-3F, 0F, -2.5F, 6, 2, 5); - neck.setRotationPoint(0F, 21F, 0F); - neck.setTextureSize(128, 128); - neck.mirror = true; - setRotation(neck, 0F, 0F, 0F); - panel = new ModelRenderer(this, 0, 31); - panel.addBox(-7F, 0F, -7F, 14, 3, 14); - panel.setRotationPoint(0F, 15F, 0F); - panel.setTextureSize(128, 128); - panel.mirror = true; - setRotation(panel, 0F, 0F, 0F); - brace = new ModelRenderer(this, 9, 16); - brace.addBox(-8F, 0F, -3F, 16, 2, 6); - brace.setRotationPoint(0F, 19F, 0F); - brace.setTextureSize(128, 128); - brace.mirror = true; - setRotation(brace, 0F, 0F, 0F); - braceLeft = new ModelRenderer(this, 57, 0); - braceLeft.addBox(7F, 0F, -3F, 1, 3, 6); - braceLeft.setRotationPoint(0F, 16F, 0F); - braceLeft.setTextureSize(128, 128); - braceLeft.mirror = true; - setRotation(braceLeft, 0F, 0F, 0F); - braceRight = new ModelRenderer(this, 39, 0); - braceRight.addBox(-8F, 0F, -3F, 1, 3, 6); - braceRight.setRotationPoint(0F, 16F, 0F); - braceRight.setTextureSize(128, 128); - braceRight.mirror = true; - setRotation(braceRight, 0F, 0F, 0F); - } - - public void render(float f5) - { - base.render(f5); - neck.render(f5); - panel.render(f5); - brace.render(f5); - braceLeft.render(f5); - braceRight.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/electrical/generator/solar/RenderSolarPanel.java b/archive/java/resonantinduction/electrical/generator/solar/RenderSolarPanel.java deleted file mode 100644 index fc1a11ee..00000000 --- a/archive/java/resonantinduction/electrical/generator/solar/RenderSolarPanel.java +++ /dev/null @@ -1,30 +0,0 @@ -package resonantinduction.electrical.generator.solar; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderSolarPanel extends TileEntitySpecialRenderer -{ - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "solarPanel.png"); - public static final ModelSolarPanel MODEL = new ModelSolarPanel(); - - @Override - public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) - { - // Texture file - this.bindTexture(TEXTURE); - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - MODEL.render(0.0625F); - GL11.glPopMatrix(); - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/electrical/generator/solar/TileSolarPanel.java b/archive/java/resonantinduction/electrical/generator/solar/TileSolarPanel.java deleted file mode 100644 index cd3fb820..00000000 --- a/archive/java/resonantinduction/electrical/generator/solar/TileSolarPanel.java +++ /dev/null @@ -1,35 +0,0 @@ -package resonantinduction.electrical.generator.solar; - -import universalelectricity.api.energy.EnergyStorageHandler; -import calclavia.lib.prefab.tile.TileElectrical; - -public class TileSolarPanel extends TileElectrical -{ - public TileSolarPanel() - { - this.energy = new EnergyStorageHandler(200); - this.ioMap = 728; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - - if (!this.worldObj.isRemote) - { - if (this.worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && !this.worldObj.provider.hasNoSky) - { - if (this.worldObj.isDaytime()) - { - if (!(this.worldObj.isThundering() || this.worldObj.isRaining())) - { - this.energy.receiveEnergy(1, true); - this.produce(); - } - } - } - } - } - -} diff --git a/archive/java/resonantinduction/electrical/levitator/BlockFilter.java b/archive/java/resonantinduction/electrical/levitator/BlockFilter.java deleted file mode 100644 index 95a7e310..00000000 --- a/archive/java/resonantinduction/electrical/levitator/BlockFilter.java +++ /dev/null @@ -1,17 +0,0 @@ -package resonantinduction.electrical.levitator; - -import resonantinduction.core.prefab.block.BlockRotatableBase; - -/** - * A block that represents a filter for item transportation. - * - * @author Calclavia - * - */ -public class BlockFilter extends BlockRotatableBase -{ - public BlockFilter(int id) - { - super("filter", id); - } -} diff --git a/archive/java/resonantinduction/electrical/levitator/BlockLevitator.java b/archive/java/resonantinduction/electrical/levitator/BlockLevitator.java deleted file mode 100644 index 978e926a..00000000 --- a/archive/java/resonantinduction/electrical/levitator/BlockLevitator.java +++ /dev/null @@ -1,106 +0,0 @@ -package resonantinduction.electrical.levitator; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.Reference; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockLevitator extends BlockMachine -{ - public BlockLevitator() - { - super("levitator"); - this.setTextureName(Reference.PREFIX + "machine"); - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderType() - { - return ElectricalBlockRenderingHandler.INSTANCE.getRenderId(); - } - - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) - { - TileEMLevitator levitator = (TileEMLevitator) world.getBlockTileEntity(x, y, z); - - if (entityPlayer.getCurrentEquippedItem() != null) - { - if (entityPlayer.getCurrentEquippedItem().itemID == Item.dyePowder.itemID) - { - levitator.setDye(entityPlayer.getCurrentEquippedItem().getItemDamage()); - - if (!entityPlayer.capabilities.isCreativeMode) - { - entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, 1); - } - - return true; - } - } - - levitator.suck = !levitator.suck; - levitator.updatePath(); - - return false; - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (!entityPlayer.isSneaking()) - { - TileEMLevitator levitator = (TileEMLevitator) world.getBlockTileEntity(x, y, z); - levitator.incrementFacing(); - return true; - } - - return false; - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, int blockID) - { - TileEMLevitator tileContractor = (TileEMLevitator) world.getBlockTileEntity(x, y, z); - - if (!world.isRemote && !tileContractor.isLatched()) - { - for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity tileEntity = world.getBlockTileEntity(x + side.offsetX, y + side.offsetY, z + side.offsetZ); - - if (tileEntity instanceof IInventory) - { - tileContractor.setDirection(side.getOpposite()); - return; - } - } - } - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEMLevitator(); - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } -} diff --git a/archive/java/resonantinduction/electrical/levitator/ItemBlockContractor.java b/archive/java/resonantinduction/electrical/levitator/ItemBlockContractor.java deleted file mode 100644 index cb976b2b..00000000 --- a/archive/java/resonantinduction/electrical/levitator/ItemBlockContractor.java +++ /dev/null @@ -1,45 +0,0 @@ -package resonantinduction.electrical.levitator; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -public class ItemBlockContractor extends ItemBlock -{ - public ItemBlockContractor(int id) - { - super(id); - } - - @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) - { - boolean place = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); - - if (place) - { - TileEMLevitator tileContractor = (TileEMLevitator) world.getBlockTileEntity(x, y, z); - tileContractor.setDirection(ForgeDirection.getOrientation(side)); - - if (!tileContractor.isLatched()) - { - for (ForgeDirection side1 : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity tileEntity = world.getBlockTileEntity(x + side1.offsetX, y + side1.offsetY, z + side1.offsetZ); - - if (tileEntity instanceof IInventory) - { - tileContractor.setDirection(side1.getOpposite()); - break; - } - } - } - } - - return place; - } -} diff --git a/archive/java/resonantinduction/electrical/levitator/ModelEMContractor.java b/archive/java/resonantinduction/electrical/levitator/ModelEMContractor.java deleted file mode 100644 index 47df21c3..00000000 --- a/archive/java/resonantinduction/electrical/levitator/ModelEMContractor.java +++ /dev/null @@ -1,246 +0,0 @@ -package resonantinduction.electrical.levitator; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelEMContractor extends ModelBase -{ - public boolean doSpin; - - // fields - ModelRenderer frame1; - ModelRenderer frame2; - ModelRenderer frame3; - ModelRenderer frame4; - ModelRenderer frame5; - ModelRenderer frame6; - ModelRenderer frame7; - ModelRenderer frame8; - ModelRenderer left_frame_connector; - ModelRenderer right_frame_connector; - ModelRenderer teslapole; - ModelRenderer Coil1; - ModelRenderer coil2; - ModelRenderer coil3; - ModelRenderer coil4; - ModelRenderer pole1; - ModelRenderer pole2; - ModelRenderer pole3; - ModelRenderer pole4; - ModelRenderer poletop1; - ModelRenderer poletop2; - ModelRenderer poletop3; - ModelRenderer poletop4; - ModelRenderer base1; - ModelRenderer base2; - ModelRenderer base3; - - public ModelEMContractor(boolean spin) - { - doSpin = spin; - textureWidth = 128; - textureHeight = 128; - - frame1 = new ModelRenderer(this, 0, 24); - frame1.addBox(0F, 0F, 0F, 1, 8, 1); - frame1.setRotationPoint(-3F, 15F, -2F); - frame1.setTextureSize(128, 128); - frame1.mirror = true; - setRotation(frame1, 0F, 0F, 0F); - frame2 = new ModelRenderer(this, 0, 24); - frame2.addBox(0F, 0F, 0F, 1, 8, 1); - frame2.setRotationPoint(1F, 15F, 2F); - frame2.setTextureSize(128, 128); - frame2.mirror = true; - setRotation(frame2, 0F, 0F, 0F); - frame3 = new ModelRenderer(this, 0, 24); - frame3.addBox(0F, 0F, 0F, 1, 8, 1); - frame3.setRotationPoint(2F, 15F, -2F); - frame3.setTextureSize(128, 128); - frame3.mirror = true; - setRotation(frame3, 0F, 0F, 0F); - frame4 = new ModelRenderer(this, 0, 24); - frame4.addBox(0F, 0F, 0F, 1, 8, 1); - frame4.setRotationPoint(-3F, 15F, 1F); - frame4.setTextureSize(128, 128); - frame4.mirror = true; - setRotation(frame4, 0F, 0F, 0F); - frame5 = new ModelRenderer(this, 0, 24); - frame5.addBox(0F, 0F, 0F, 1, 8, 1); - frame5.setRotationPoint(2F, 15F, 1F); - frame5.setTextureSize(128, 128); - frame5.mirror = true; - setRotation(frame5, 0F, 0F, 0F); - frame6 = new ModelRenderer(this, 0, 24); - frame6.addBox(0F, 0F, 0F, 1, 8, 1); - frame6.setRotationPoint(1F, 15F, -3F); - frame6.setTextureSize(128, 128); - frame6.mirror = true; - setRotation(frame6, 0F, 0F, 0F); - frame7 = new ModelRenderer(this, 0, 24); - frame7.addBox(0F, 0F, 0F, 1, 8, 1); - frame7.setRotationPoint(-2F, 15F, 2F); - frame7.setTextureSize(128, 128); - frame7.mirror = true; - setRotation(frame7, 0F, 0F, 0F); - frame8 = new ModelRenderer(this, 0, 24); - frame8.addBox(0F, 0F, 0F, 1, 8, 1); - frame8.setRotationPoint(-2F, 15F, -3F); - frame8.setTextureSize(128, 128); - frame8.mirror = true; - setRotation(frame8, 0F, 0F, 0F); - left_frame_connector = new ModelRenderer(this, 0, 20); - left_frame_connector.addBox(0F, 0F, 0F, 1, 1, 2); - left_frame_connector.setRotationPoint(-3F, 15F, -1F); - left_frame_connector.setTextureSize(128, 128); - left_frame_connector.mirror = true; - setRotation(left_frame_connector, 0F, 0F, 0F); - right_frame_connector = new ModelRenderer(this, 0, 20); - right_frame_connector.addBox(0F, 0F, 0F, 1, 1, 2); - right_frame_connector.setRotationPoint(2F, 15F, -1F); - right_frame_connector.setTextureSize(128, 128); - right_frame_connector.mirror = true; - setRotation(right_frame_connector, 0F, 0F, 0F); - teslapole = new ModelRenderer(this, 0, 0); - teslapole.addBox(-1F, -1F, -1F, 2, 15, 2); - teslapole.setRotationPoint(0F, 9F, 0F); - teslapole.setTextureSize(128, 128); - teslapole.mirror = true; - setRotation(teslapole, 0F, 0F, 0F); - Coil1 = new ModelRenderer(this, 17, 0); - Coil1.addBox(-1.5F, -0.5F, -1.5F, 3, 1, 3); - Coil1.setRotationPoint(0F, 12.5F, 0F); - Coil1.setTextureSize(128, 128); - Coil1.mirror = true; - setRotation(Coil1, 0F, 0F, 0F); - coil2 = new ModelRenderer(this, 17, 0); - coil2.addBox(-1.5F, -0.5F, -1.5F, 3, 1, 3); - coil2.setRotationPoint(0F, 14F, 0F); - coil2.setTextureSize(128, 128); - coil2.mirror = true; - setRotation(coil2, 0F, 0F, 0F); - coil3 = new ModelRenderer(this, 17, 0); - coil3.addBox(-1.5F, -0.5F, -1.5F, 3, 1, 3); - coil3.setRotationPoint(0F, 9.5F, 0F); - coil3.setTextureSize(128, 128); - coil3.mirror = true; - setRotation(coil3, 0F, 0F, 0F); - coil4 = new ModelRenderer(this, 17, 0); - coil4.addBox(-1.5F, -0.5F, -1.5F, 3, 1, 3); - coil4.setRotationPoint(0F, 11F, 0F); - coil4.setTextureSize(128, 128); - coil4.mirror = true; - setRotation(coil4, 0F, 0F, 0F); - pole1 = new ModelRenderer(this, 5, 26); - pole1.addBox(-0.5F, -1F, -0.5F, 1, 6, 1); - pole1.setRotationPoint(0F, 18F, 6.5F); - pole1.setTextureSize(128, 128); - pole1.mirror = true; - setRotation(pole1, 0F, 0F, 0F); - pole2 = new ModelRenderer(this, 5, 26); - pole2.addBox(-0.5F, -1F, -0.5F, 1, 6, 1); - pole2.setRotationPoint(0F, 18F, -6.5F); - pole2.setTextureSize(128, 128); - pole2.mirror = true; - setRotation(pole2, 0F, 0F, 0F); - pole3 = new ModelRenderer(this, 5, 26); - pole3.addBox(-0.5F, -1F, -0.5F, 1, 6, 1); - pole3.setRotationPoint(-6.5F, 18F, 0F); - pole3.setTextureSize(128, 128); - pole3.mirror = true; - setRotation(pole3, 0F, 0F, 0F); - pole4 = new ModelRenderer(this, 5, 26); - pole4.addBox(-0.5F, -1F, -0.5F, 1, 6, 1); - pole4.setRotationPoint(6.5F, 18F, 0F); - pole4.setTextureSize(128, 128); - pole4.mirror = true; - setRotation(pole4, 0F, 0F, 0F); - poletop1 = new ModelRenderer(this, 31, 0); - poletop1.addBox(-1F, -1F, -1F, 2, 2, 2); - poletop1.setRotationPoint(0F, 16.5F, -6.5F); - poletop1.setTextureSize(128, 128); - poletop1.mirror = true; - setRotation(poletop1, 0F, 0F, 0F); - poletop2 = new ModelRenderer(this, 31, 0); - poletop2.addBox(-1F, -1F, -1F, 2, 2, 2); - poletop2.setRotationPoint(0F, 16.5F, 6.5F); - poletop2.setTextureSize(128, 128); - poletop2.mirror = true; - setRotation(poletop2, 0F, 0F, 0F); - poletop3 = new ModelRenderer(this, 31, 0); - poletop3.addBox(-1F, -1F, -1F, 2, 2, 2); - poletop3.setRotationPoint(6.5F, 16.5F, 0F); - poletop3.setTextureSize(128, 128); - poletop3.mirror = true; - setRotation(poletop3, 0F, 0F, 0F); - poletop4 = new ModelRenderer(this, 31, 0); - poletop4.addBox(-1F, -1F, -1F, 2, 2, 2); - poletop4.setRotationPoint(-6.5F, 16.5F, 0F); - poletop4.setTextureSize(128, 128); - poletop4.mirror = true; - setRotation(poletop4, 0F, 0F, 0F); - base1 = new ModelRenderer(this, 0, 55); - base1.addBox(0F, 0F, 0F, 16, 1, 8); - base1.setRotationPoint(-8F, 23F, -4F); - base1.setTextureSize(128, 128); - base1.mirror = true; - setRotation(base1, 0F, 0F, 0F); - base2 = new ModelRenderer(this, 0, 68); - base2.addBox(0F, 0F, 0F, 8, 1, 5); - base2.setRotationPoint(-4F, 23F, 3F); - base2.setTextureSize(128, 128); - base2.mirror = true; - setRotation(base2, 0F, 0F, 0F); - base3 = new ModelRenderer(this, 0, 79); - base3.addBox(0F, 0F, 0F, 8, 1, 5); - base3.setRotationPoint(-4F, 23F, -8F); - base3.setTextureSize(128, 128); - base3.mirror = true; - setRotation(base3, 0F, 0F, 0F); - } - - public void render(float f5) - { - if (doSpin) - { - Coil1.rotateAngleY = (float) Math.toRadians(Math.toDegrees(Coil1.rotateAngleY) + 3 < 360 ? Math.toDegrees(Coil1.rotateAngleY) + 3 : 0); - coil2.rotateAngleY = (float) Math.toRadians(Math.toDegrees(coil2.rotateAngleY) + 3 < 360 ? Math.toDegrees(coil2.rotateAngleY) + 3 : 0); - coil3.rotateAngleY = (float) Math.toRadians(Math.toDegrees(coil3.rotateAngleY) + 3 < 360 ? Math.toDegrees(coil3.rotateAngleY) + 3 : 0); - coil4.rotateAngleY = (float) Math.toRadians(Math.toDegrees(coil4.rotateAngleY) + 3 < 360 ? Math.toDegrees(coil4.rotateAngleY) + 3 : 0); - } - - frame1.render(f5); - frame2.render(f5); - frame3.render(f5); - frame4.render(f5); - frame5.render(f5); - frame6.render(f5); - frame7.render(f5); - frame8.render(f5); - left_frame_connector.render(f5); - right_frame_connector.render(f5); - teslapole.render(f5); - Coil1.render(f5); - coil2.render(f5); - coil3.render(f5); - coil4.render(f5); - pole1.render(f5); - pole2.render(f5); - pole3.render(f5); - pole4.render(f5); - poletop1.render(f5); - poletop2.render(f5); - poletop3.render(f5); - poletop4.render(f5); - base1.render(f5); - base2.render(f5); - base3.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/electrical/levitator/PathfinderEMContractor.java b/archive/java/resonantinduction/electrical/levitator/PathfinderEMContractor.java deleted file mode 100644 index 279d45d2..00000000 --- a/archive/java/resonantinduction/electrical/levitator/PathfinderEMContractor.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.levitator; - -import java.util.HashSet; -import java.util.Set; - -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.path.IPathCallBack; -import calclavia.lib.path.Pathfinder; -import calclavia.lib.path.PathfinderAStar; - -/** - * Uses the well known A* Pathfinding algorithm. - * - * @author Calclavia - * - */ -public class PathfinderEMContractor extends PathfinderAStar -{ - private World world; - - private double maxSearchDistance; - - public PathfinderEMContractor(final World world, final Vector3 goal) - { - super(new IPathCallBack() - { - @Override - public Set getConnectedNodes(Pathfinder finder, Vector3 currentNode) - { - Set neighbors = new HashSet(); - - for (int i = 0; i < 6; i++) - { - Vector3 neighbor = currentNode.clone().modifyPositionFromSide(ForgeDirection.getOrientation(i)); - - if (TileEMLevitator.canBePath(world, neighbor)) - { - neighbors.add(neighbor); - } - } - - return neighbors; - } - - @Override - public boolean onSearch(Pathfinder finder, Vector3 start, Vector3 node) - { - return !(start.distance(node) < (start.distance(goal) * 2)); - } - }, goal); - - this.world = world; - } - - @Override - public boolean findNodes(Vector3 start) - { - int blockCount = 0; - - for (int i = 0; i < 6; i++) - { - ForgeDirection direction = ForgeDirection.getOrientation(i); - Vector3 neighbor = this.goal.clone().translate(new Vector3(direction.offsetX, direction.offsetY, direction.offsetZ)); - - if (!TileEMLevitator.canBePath(this.world, neighbor)) - { - blockCount++; - } - } - - if (blockCount >= 6) - { - return false; - } - - return super.findNodes(start); - } -} diff --git a/archive/java/resonantinduction/electrical/levitator/RenderLevitator.java b/archive/java/resonantinduction/electrical/levitator/RenderLevitator.java deleted file mode 100644 index 6db963c5..00000000 --- a/archive/java/resonantinduction/electrical/levitator/RenderLevitator.java +++ /dev/null @@ -1,73 +0,0 @@ -package resonantinduction.electrical.levitator; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInduction; - -public class RenderLevitator extends TileEntitySpecialRenderer -{ - public static final ModelEMContractor MODEL = new ModelEMContractor(false); - public static final ModelEMContractor MODEL_SPIN = new ModelEMContractor(true); - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_DIRECTORY + "em_contractor.png"); - public static final ResourceLocation TEXTURE_PUSH = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_DIRECTORY + "em_contractor_push.png"); - - @Override - public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) - { - GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); - - switch (((TileEMLevitator) t).getDirection()) - { - case DOWN: - GL11.glRotatef(180, 0, 0, 1); - GL11.glTranslatef(0, -2, 0); - break; - case UP: - break; - case NORTH: - GL11.glTranslatef(1, 1, 0); - GL11.glRotatef(90, 0, 0, 1); - break; - case SOUTH: - GL11.glTranslatef(-1, 1, 0); - GL11.glRotatef(-90, 0, 0, 1); - break; - case WEST: - GL11.glTranslatef(0, 1, 1); - GL11.glRotatef(-90, 1, 0, 0); - break; - case EAST: - GL11.glTranslatef(0, 1, -1); - GL11.glRotatef(90, 1, 0, 0); - break; - } - - if (((TileEMLevitator) t).suck) - { - this.bindTexture(TEXTURE); - } - else - { - this.bindTexture(TEXTURE_PUSH); - } - - if (((TileEMLevitator) t).canFunction() && !ResonantInduction.proxy.isPaused()) - { - MODEL_SPIN.render(0.0625f); - } - else - { - MODEL.render(0.0625f); - } - - GL11.glPopMatrix(); - } -} diff --git a/archive/java/resonantinduction/electrical/levitator/ThreadEMPathfinding.java b/archive/java/resonantinduction/electrical/levitator/ThreadEMPathfinding.java deleted file mode 100644 index fa8ee388..00000000 --- a/archive/java/resonantinduction/electrical/levitator/ThreadEMPathfinding.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.levitator; - -import universalelectricity.api.vector.Vector3; - -/** - * @author Calclavia - * - */ -public class ThreadEMPathfinding extends Thread -{ - private boolean isCompleted = false; - private PathfinderEMContractor pathfinder; - private Vector3 start; - - public ThreadEMPathfinding(PathfinderEMContractor pathfinder, Vector3 start) - { - this.pathfinder = pathfinder; - this.start = start; - this.setPriority(Thread.MIN_PRIORITY); - } - - @Override - public void run() - { - this.pathfinder.findNodes(this.start); - this.isCompleted = true; - } - - public PathfinderEMContractor getPath() - { - if (this.isCompleted) - { - return this.pathfinder; - } - - return null; - } -} diff --git a/archive/java/resonantinduction/electrical/levitator/TileEMLevitator.java b/archive/java/resonantinduction/electrical/levitator/TileEMLevitator.java deleted file mode 100644 index 9b704a86..00000000 --- a/archive/java/resonantinduction/electrical/levitator/TileEMLevitator.java +++ /dev/null @@ -1,621 +0,0 @@ -package resonantinduction.electrical.levitator; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockFluid; -import net.minecraft.block.BlockLadder; -import net.minecraft.block.BlockSnow; -import net.minecraft.block.BlockVine; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.IFluidBlock; -import resonantinduction.core.ResonantInduction; -import resonantinduction.core.Settings; -import resonantinduction.core.handler.ILinkable; -import resonantinduction.electrical.Electrical; -import resonantinduction.electrical.tesla.TileTesla; -import universalelectricity.api.vector.Vector3; -import universalelectricity.api.vector.VectorWorld; -import calclavia.lib.network.IPacketReceiver; -import calclavia.lib.network.IPacketSender; -import calclavia.lib.prefab.tile.TileAdvanced; -import calclavia.lib.render.EnumColor; -import calclavia.lib.utility.InventoryUtility; - -import com.google.common.io.ByteArrayDataInput; - -/** - * - * @author Calclavia - * - */ -public class TileEMLevitator extends TileAdvanced implements IPacketReceiver, IPacketSender, ILinkable -{ - private int pushDelay; - - private AxisAlignedBB operationBounds; - private AxisAlignedBB suckBounds; - - /** - * true = suck, false = push - */ - public boolean suck = true; - - /** - * Pathfinding - */ - private ThreadEMPathfinding thread; - private PathfinderEMContractor pathfinder; - private Set pathfindingTrackers = new HashSet(); - private TileEMLevitator linked; - private int lastCalcTime = 0; - - /** Color of beam */ - private int dyeID = TileTesla.DEFAULT_COLOR; - private Vector3 tempLinkVector; - - @Override - public void initiate() - { - super.initiate(); - updateBounds(); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - - pushDelay = Math.max(0, pushDelay - 1); - - if (tempLinkVector != null) - { - if (tempLinkVector.getTileEntity(worldObj) instanceof TileEMLevitator) - { - setLink((TileEMLevitator) tempLinkVector.getTileEntity(worldObj), true); - } - - tempLinkVector = null; - } - - if (canFunction()) - { - TileEntity inventoryTile = getLatched(); - IInventory inventory = (IInventory) inventoryTile; - - if (!suck && pushDelay == 0) - { - ItemStack retrieved = InventoryUtility.takeTopItemFromInventory(inventory, getDirection().getOpposite().ordinal()); - - if (retrieved != null) - { - EntityItem item = getItemWithPosition(retrieved); - - if (!worldObj.isRemote) - { - worldObj.spawnEntityInWorld(item); - } - - pushDelay = Settings.LEVITATOR_PUSH_DELAY; - } - } - else if (suck) - { - if (suckBounds != null) - { - if (!worldObj.isRemote) - { - for (EntityItem item : (List) worldObj.getEntitiesWithinAABB(EntityItem.class, suckBounds)) - { - ItemStack remains = InventoryUtility.putStackInInventory(inventory, item.getEntityItem(), getDirection().getOpposite().ordinal(), false); - - if (remains == null) - { - item.setDead(); - } - else - { - item.setEntityItemStack(remains); - } - } - } - } - } - - if (thread != null) - { - PathfinderEMContractor newPath = thread.getPath(); - - if (newPath != null) - { - pathfinder = newPath; - thread = null; - } - } - - final int renderFrequency = ResonantInduction.proxy.isGraphicsFancy() ? 1 + worldObj.rand.nextInt(2) : 10 + worldObj.rand.nextInt(2); - final boolean renderBeam = ticks % renderFrequency == 0 && hasLink() && linked.suck != suck; - - if (hasLink()) - { - if (!suck) - { - if (renderBeam) - { - Electrical.proxy.renderElectricShock(worldObj, new Vector3(this).translate(0.5), new Vector3(this).translate(new Vector3(getDirection())).translate(0.5), EnumColor.DYES[dyeID].toColor(), false); - } - - // Push entity along path. - if (pathfinder != null) - { - List results = this.pathfinder.results; - for (int i = 0; i < results.size(); i++) - { - Vector3 result = results.get(i).clone(); - - if (TileEMLevitator.canBePath(worldObj, result)) - { - if (i - 1 >= 0) - { - Vector3 prevResult = results.get(i - 1).clone(); - - Vector3 difference = prevResult.clone().difference(result); - final ForgeDirection direction = difference.toForgeDirection(); - - if (renderBeam) - { - Electrical.proxy.renderElectricShock(worldObj, prevResult.clone().translate(0.5), result.clone().translate(0.5), EnumColor.DYES[dyeID].toColor(), false); - } - - AxisAlignedBB bounds = AxisAlignedBB.getAABBPool().getAABB(result.x, result.y, result.z, result.x + 1, result.y + 1, result.z + 1); - List entities = worldObj.getEntitiesWithinAABB(EntityItem.class, bounds); - - for (EntityItem entityItem : entities) - { - moveEntity(entityItem, direction, result); - } - } - - } - else - { - updatePath(); - break; - } - } - } - else - { - updatePath(); - } - } - else - { - if (renderBeam) - { - Electrical.proxy.renderElectricShock(worldObj, new Vector3(this).translate(0.5), new Vector3(this).translate(new Vector3(getDirection())).translate(0.5), EnumColor.DYES[dyeID].toColor(), false); - } - - pathfinder = null; - - Vector3 searchVec = new Vector3(this).modifyPositionFromSide(getDirection()); - AxisAlignedBB searchBounds = AxisAlignedBB.getAABBPool().getAABB(searchVec.x, searchVec.y, searchVec.z, searchVec.x + 1, searchVec.y + 1, searchVec.z + 1); - - if (searchBounds != null) - { - for (EntityItem entityItem : (List) worldObj.getEntitiesWithinAABB(EntityItem.class, searchBounds)) - { - if (renderBeam) - { - Electrical.proxy.renderElectricShock(worldObj, new Vector3(this).translate(0.5), new Vector3(entityItem), EnumColor.DYES[dyeID].toColor(), false); - } - - moveEntity(entityItem, getDirection(), new Vector3(this)); - } - } - } - } - else if (!hasLink()) - { - for (EntityItem entityItem : (List) worldObj.getEntitiesWithinAABB(EntityItem.class, operationBounds)) - { - moveEntity(entityItem, getDirection(), new Vector3(this)); - } - } - - if (linked != null && linked.isInvalid()) - { - linked = null; - } - - lastCalcTime--; - } - } - - public static boolean canBePath(World world, Vector3 position) - { - Block block = Block.blocksList[position.getBlockID(world)]; - return block == null || (block instanceof BlockSnow || block instanceof BlockVine || block instanceof BlockLadder || ((block instanceof BlockFluid || block instanceof IFluidBlock) && block.blockID != Block.lavaMoving.blockID && block.blockID != Block.lavaStill.blockID)); - } - - private boolean hasLink() - { - return linked != null && !linked.isInvalid() && linked.linked == this; - } - - private void moveEntity(EntityItem entityItem, ForgeDirection direction, Vector3 lockVector) - { - switch (direction) - { - case DOWN: - entityItem.setPosition(lockVector.x + 0.5, entityItem.posY, lockVector.z + 0.5); - - entityItem.motionX = 0; - entityItem.motionZ = 0; - - if (!suck) - { - entityItem.motionY = Math.max(-Settings.LEVITATOR_MAX_SPEED, entityItem.motionY - Settings.LEVITATOR_ACCELERATION); - } - else - { - entityItem.motionY = Math.min(Settings.LEVITATOR_MAX_SPEED, entityItem.motionY + .04 + Settings.LEVITATOR_ACCELERATION); - } - - break; - case UP: - - entityItem.setPosition(lockVector.x + 0.5, entityItem.posY, lockVector.z + 0.5); - - entityItem.motionX = 0; - entityItem.motionZ = 0; - - if (!suck) - { - entityItem.motionY = Math.min(Settings.LEVITATOR_MAX_SPEED, entityItem.motionY + .04 + Settings.LEVITATOR_ACCELERATION); - } - else - { - entityItem.motionY = Math.max(-Settings.LEVITATOR_MAX_SPEED, entityItem.motionY - Settings.LEVITATOR_ACCELERATION); - } - - break; - case NORTH: - - entityItem.setPosition(lockVector.x + 0.5, lockVector.y + 0.5, entityItem.posZ); - - entityItem.motionX = 0; - entityItem.motionY = 0; - - if (!suck) - { - entityItem.motionZ = Math.max(-Settings.LEVITATOR_MAX_SPEED, entityItem.motionZ - Settings.LEVITATOR_ACCELERATION); - } - else - { - entityItem.motionZ = Math.min(Settings.LEVITATOR_MAX_SPEED, entityItem.motionZ + Settings.LEVITATOR_ACCELERATION); - } - - break; - case SOUTH: - - entityItem.setPosition(lockVector.x + 0.5, lockVector.y + 0.5, entityItem.posZ); - - entityItem.motionX = 0; - entityItem.motionY = 0; - - if (!suck) - { - entityItem.motionZ = Math.min(Settings.LEVITATOR_MAX_SPEED, entityItem.motionZ + Settings.LEVITATOR_ACCELERATION); - } - else - { - entityItem.motionZ = Math.max(-Settings.LEVITATOR_MAX_SPEED, entityItem.motionZ - Settings.LEVITATOR_ACCELERATION); - } - - break; - case WEST: - - entityItem.setPosition(entityItem.posX, lockVector.y + 0.5, lockVector.z + 0.5); - - entityItem.motionY = 0; - entityItem.motionZ = 0; - - if (!suck) - { - entityItem.motionX = Math.max(-Settings.LEVITATOR_MAX_SPEED, entityItem.motionX - Settings.LEVITATOR_ACCELERATION); - } - else - { - entityItem.motionX = Math.min(Settings.LEVITATOR_MAX_SPEED, entityItem.motionX + Settings.LEVITATOR_ACCELERATION); - } - - break; - case EAST: - entityItem.setPosition(entityItem.posX, lockVector.y + 0.5, lockVector.z + 0.5); - - entityItem.motionY = 0; - entityItem.motionZ = 0; - - if (!suck) - { - entityItem.motionX = Math.min(Settings.LEVITATOR_MAX_SPEED, entityItem.motionX + Settings.LEVITATOR_ACCELERATION); - } - else - { - entityItem.motionX = Math.max(-Settings.LEVITATOR_MAX_SPEED, entityItem.motionX - Settings.LEVITATOR_ACCELERATION); - } - - break; - default: - break; - } - - entityItem.ticksExisted = 1; - entityItem.isAirBorne = true; - entityItem.delayBeforeCanPickup = 1; - entityItem.age = Math.max(entityItem.age - 1, 0); - } - - private EntityItem getItemWithPosition(ItemStack toSend) - { - EntityItem item = null; - - switch (getDirection()) - { - case DOWN: - item = new EntityItem(worldObj, xCoord + 0.5, yCoord - 0.2, zCoord + 0.5, toSend); - break; - case UP: - item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.2, zCoord + 0.5, toSend); - break; - case NORTH: - item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord - 0.2, toSend); - break; - case SOUTH: - item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 1.2, toSend); - break; - case WEST: - item = new EntityItem(worldObj, xCoord - 0.2, yCoord + 0.5, zCoord + 0.5, toSend); - break; - case EAST: - item = new EntityItem(worldObj, xCoord + 1.2, yCoord + 0.5, zCoord + 0.5, toSend); - break; - default: - break; - } - - item.motionX = 0; - item.motionY = 0; - item.motionZ = 0; - - return item; - } - - public void updateBounds() - { - switch (getDirection()) - { - case DOWN: - operationBounds = AxisAlignedBB.getBoundingBox(xCoord, Math.max(yCoord - Settings.LEVITATOR_MAX_REACH, 1), zCoord, xCoord + 1, yCoord, zCoord + 1); - suckBounds = AxisAlignedBB.getBoundingBox(xCoord, yCoord - 0.1, zCoord, xCoord + 1, yCoord, zCoord + 1); - break; - case UP: - operationBounds = AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, Math.min(yCoord + 1 + Settings.LEVITATOR_MAX_REACH, 255), zCoord + 1); - suckBounds = AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 1.1, zCoord + 1); - break; - case NORTH: - operationBounds = AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord - Settings.LEVITATOR_MAX_REACH, xCoord + 1, yCoord + 1, zCoord); - suckBounds = AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord - 0.1, xCoord + 1, yCoord + 1, zCoord); - break; - case SOUTH: - operationBounds = AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord + 1, xCoord + 1, yCoord + 1, zCoord + 1 + Settings.LEVITATOR_MAX_REACH); - suckBounds = AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord + 1, xCoord + 1, yCoord + 1, zCoord + 1.1); - break; - case WEST: - operationBounds = AxisAlignedBB.getBoundingBox(xCoord - Settings.LEVITATOR_MAX_REACH, yCoord, zCoord, xCoord, yCoord + 1, zCoord + 1); - suckBounds = AxisAlignedBB.getBoundingBox(xCoord - 0.1, yCoord, zCoord, xCoord, yCoord + 1, zCoord + 1); - break; - case EAST: - operationBounds = AxisAlignedBB.getBoundingBox(xCoord + 1, yCoord, zCoord, xCoord + 1 + Settings.LEVITATOR_MAX_REACH, yCoord + 1, zCoord + 1); - suckBounds = AxisAlignedBB.getBoundingBox(xCoord + 1, yCoord, zCoord, xCoord + 1.1, yCoord + 1, zCoord + 1); - break; - default: - break; - } - } - - public boolean isLatched() - { - return getLatched() != null; - } - - public TileEntity getLatched() - { - ForgeDirection side = getDirection().getOpposite(); - - TileEntity tile = worldObj.getBlockTileEntity(xCoord + side.offsetX, yCoord + side.offsetY, zCoord + side.offsetZ); - - if (tile instanceof IInventory) - { - return tile; - } - - return null; - } - - public void incrementFacing() - { - int newOrdinal = getDirection().ordinal() < 5 ? getDirection().ordinal() + 1 : 0; - setDirection(ForgeDirection.getOrientation(newOrdinal)); - } - - public ForgeDirection getDirection() - { - return ForgeDirection.getOrientation(this.getBlockMetadata()); - } - - public void setDirection(ForgeDirection side) - { - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, side.ordinal(), 3); - this.updateBounds(); - } - - @Override - public ArrayList getPacketData(int type) - { - ArrayList data = new ArrayList(); - data.add(suck); - data.add(dyeID); - - if (linked != null) - { - data.add(true); - - data.add(linked.xCoord); - data.add(linked.yCoord); - data.add(linked.zCoord); - } - else - { - data.add(false); - } - - return data; - } - - @Override - public Packet getDescriptionPacket() - { - return ResonantInduction.PACKET_TILE.getPacket(this, getPacketData(0).toArray()); - } - - @Override - public void onReceivePacket(ByteArrayDataInput data, EntityPlayer player, Object... extra) - { - suck = data.readBoolean(); - dyeID = data.readInt(); - - if (data.readBoolean()) - { - tempLinkVector = new Vector3(data.readInt(), data.readInt(), data.readInt()); - } - - worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - updateBounds(); - } - - public boolean canFunction() - { - return isLatched() && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - - this.suck = nbt.getBoolean("suck"); - this.dyeID = nbt.getInteger("dyeID"); - - if (nbt.hasKey("link")) - { - tempLinkVector = new Vector3(nbt.getCompoundTag("link")); - } - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - - nbt.setBoolean("suck", suck); - nbt.setInteger("dyeID", dyeID); - - if (linked != null) - { - nbt.setCompoundTag("link", new Vector3(linked).writeToNBT(new NBTTagCompound())); - } - } - - /** - * Link between two TileEntities, do pathfinding operation. - */ - public void setLink(TileEMLevitator tileEntity, boolean setOpponent) - { - if (linked != null && setOpponent) - { - linked.setLink(null, false); - } - - linked = tileEntity; - - if (setOpponent) - { - linked.setLink(this, false); - } - - updatePath(); - } - - public void updatePath() - { - if (thread == null && linked != null && lastCalcTime <= 0) - { - pathfinder = null; - - Vector3 start = new Vector3(this).modifyPositionFromSide(getDirection()); - Vector3 target = new Vector3(linked).modifyPositionFromSide(linked.getDirection()); - - if (start.distance(target) < Settings.MAX_CONTRACTOR_DISTANCE) - { - if (TileEMLevitator.canBePath(worldObj, start) && TileEMLevitator.canBePath(worldObj, target)) - { - thread = new ThreadEMPathfinding(new PathfinderEMContractor(worldObj, target), start); - thread.start(); - lastCalcTime = 40; - } - } - } - } - - public void setDye(int dye) - { - dyeID = dye; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - @Override - public boolean onLink(EntityPlayer player, VectorWorld vector) - { - if (vector != null) - { - if (vector.getTileEntity(this.worldObj) instanceof TileEMLevitator) - { - this.setLink((TileEMLevitator) vector.getTileEntity(this.worldObj), true); - - if (this.worldObj.isRemote) - { - player.addChatMessage("Linked " + this.getBlockType().getLocalizedName() + " with " + " [" + (int) vector.x + ", " + (int) vector.y + ", " + (int) vector.z + "]"); - } - - return true; - } - } - - return false; - } - -} diff --git a/archive/java/resonantinduction/electrical/multimeter/GuiMultimeter.java b/archive/java/resonantinduction/electrical/multimeter/GuiMultimeter.java deleted file mode 100644 index 0214492c..00000000 --- a/archive/java/resonantinduction/electrical/multimeter/GuiMultimeter.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.multimeter; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import resonantinduction.core.Reference; -import universalelectricity.api.energy.UnitDisplay.Unit; -import calclavia.lib.gui.GuiContainerBase; -import calclavia.lib.render.EnumColor; -import calclavia.lib.utility.LanguageUtility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Multimeter GUI - * - * @author Calclavia - * - */ -@SideOnly(Side.CLIENT) -public class GuiMultimeter extends GuiContainerBase -{ - PartMultimeter multimeter; - - private int containerWidth; - private int containerHeight; - private GuiTextField textFieldLimit; - - public GuiMultimeter(InventoryPlayer inventoryPlayer, PartMultimeter tileEntity) - { - super(new ContainerMultimeter(inventoryPlayer, tileEntity)); - this.multimeter = tileEntity; - this.ySize = 217; - this.baseTexture = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_multimeter.png"); - } - - @Override - public void initGui() - { - super.initGui(); - this.buttonList.add(new GuiButton(0, this.width / 2 + 20, this.height / 2 - 30, 50, 20, LanguageUtility.getLocal("gui.resonantinduction.multimeter.toggle"))); - this.textFieldLimit = new GuiTextField(fontRenderer, 35, 82, 65, 12); - this.textFieldLimit.setMaxStringLength(8); - this.textFieldLimit.setText("" + this.multimeter.getLimit()); - } - - @Override - protected void keyTyped(char par1, int par2) - { - super.keyTyped(par1, par2); - this.textFieldLimit.textboxKeyTyped(par1, par2); - - try - { - this.multimeter.getWriteStream().writeByte(1).writeLong(Long.parseLong(this.textFieldLimit.getText())); - } - catch (Exception e) - { - } - } - - @Override - protected void mouseClicked(int par1, int par2, int par3) - { - super.mouseClicked(par1, par2, par3); - this.textFieldLimit.mouseClicked(par1 - this.containerWidth, par2 - this.containerHeight, par3); - } - - @Override - protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) - { - super.drawGuiContainerForegroundLayer(mouseX, mouseY); - String s = LanguageUtility.getLocal("tile.resonantinduction:multimeter.name"); - this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 15, 4210752); - this.fontRenderer.drawString(EnumColor.DARK_GREEN + LanguageUtility.getLocal("gui.resonantinduction.multimeter.averageEnergy"), 35, 15, 4210752); - this.renderUniversalDisplay(35, 25, this.multimeter.getAverageDetectedEnergy(), mouseX, mouseY, Unit.JOULES); - this.fontRenderer.drawString(EnumColor.DARK_GREEN + LanguageUtility.getLocal("gui.resonantinduction.multimeter.energy"), 35, 35, 4210752); - this.renderUniversalDisplay(35, 45, this.multimeter.getDetectedEnergy(), mouseX, mouseY, Unit.JOULES); - this.fontRenderer.drawString(EnumColor.ORANGE + LanguageUtility.getLocal("gui.resonantinduction.multimeter.redstone"), 35, 58, 4210752); - this.fontRenderer.drawString(EnumColor.RED + LanguageUtility.getLocal("gui.resonantinduction.multimeter." + this.multimeter.getMode().display), 35, 68, 4210752); - this.fontRenderer.drawString(Unit.JOULES.name + "(s)", 35, 100, 4210752); - - this.textFieldLimit.drawTextBox(); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float f, int x, int y) - { - super.drawGuiContainerBackgroundLayer(f, x, y); - /* - * int length = Math.min((int) (this.multimeter.getDetectedEnergy() / - * this.multimeter.getPeak()) * 115, 115); - * this.drawTexturedModalRect(this.containerWidth + 14, this.containerHeight + 126 - length, - * 176, 115 - length, 6, length); - */ - } - - @Override - protected void actionPerformed(GuiButton button) - { - this.multimeter.toggleMode(); - } - -} diff --git a/archive/java/resonantinduction/electrical/multimeter/ItemMultimeter.java b/archive/java/resonantinduction/electrical/multimeter/ItemMultimeter.java deleted file mode 100644 index 4423bb51..00000000 --- a/archive/java/resonantinduction/electrical/multimeter/ItemMultimeter.java +++ /dev/null @@ -1,100 +0,0 @@ -package resonantinduction.electrical.multimeter; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.part.ItemMultipartBase; -import resonantinduction.electrical.wire.EnumWireMaterial; -import calclavia.lib.utility.LanguageUtility; -import codechicken.lib.vec.BlockCoord; -import codechicken.lib.vec.Vector3; -import codechicken.multipart.MultiPartRegistry; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TileMultipart; - -public class ItemMultimeter extends ItemMultipartBase -{ - private Icon[] icons = new Icon[EnumWireMaterial.values().length]; - - public ItemMultimeter(int id) - { - super("multimeter", id); - } - - @Override - public TMultiPart newPart(ItemStack itemStack, EntityPlayer player, World world, BlockCoord pos, int side, Vector3 hit) - { - if (world.getBlockTileEntity(pos.x, pos.y, pos.z) instanceof TileMultipart) - { - pos.offset(side ^ 1, -1); - } - - PartMultimeter part = (PartMultimeter) MultiPartRegistry.createPart("resonant_induction_multimeter", false); - - if (part != null) - { - part.preparePlacement(side, itemStack.getItemDamage()); - } - - return part; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) - { - par3List.add(LanguageUtility.getLocal("tooltip.multimeter.line1")); - par3List.add(LanguageUtility.getLocal("tooltip.multimeter.line2")); - - float detection = this.getDetection(itemStack); - - if (detection != -1) - { - par3List.add(LanguageUtility.getLocal("tooltip.multimeter.lastSave").replace("%v", detection + "")); - } - else - { - par3List.add(LanguageUtility.getLocal("tooltip.multimeter.noSave")); - } - } - - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World world, int x, int y, int z, int par7, float par8, float par9, float par10) - { - if (!par2EntityPlayer.isSneaking()) - { - if (!world.isRemote) - { - par2EntityPlayer.addChatMessage(LanguageUtility.getLocal("message.multimeter.onUse").replace("%v", "" + PartMultimeter.getDetectedEnergy(ForgeDirection.getOrientation(par7), world.getBlockTileEntity(x, y, z)))); - } - - return true; - } - - return super.onItemUse(par1ItemStack, par2EntityPlayer, world, x, y, z, par7, par8, par9, par10); - } - - public float getDetection(ItemStack itemStack) - { - if (itemStack.stackTagCompound == null || !itemStack.getTagCompound().hasKey("detection")) - { - return -1; - } - - return itemStack.stackTagCompound.getFloat("detection"); - } - - public void setDetection(ItemStack itemStack, float detection) - { - if (itemStack.stackTagCompound == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - itemStack.stackTagCompound.setFloat("detection", detection); - } -} diff --git a/archive/java/resonantinduction/electrical/multimeter/ItemReadoutTools.java b/archive/java/resonantinduction/electrical/multimeter/ItemReadoutTools.java deleted file mode 100644 index f262ceb4..00000000 --- a/archive/java/resonantinduction/electrical/multimeter/ItemReadoutTools.java +++ /dev/null @@ -1,199 +0,0 @@ -package resonantinduction.electrical.multimeter; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IconRegister; -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.ChatMessageComponent; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.core.Reference; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.tile.TileEntityEnergyMachine; -import resonantinduction.core.prefab.tile.TileGenerator; -import universalelectricity.api.electricity.IVoltageInput; -import universalelectricity.api.electricity.IVoltageOutput; -import universalelectricity.api.energy.IConductor; -import universalelectricity.api.energy.IEnergyContainer; -import universalelectricity.api.energy.IEnergyNetwork; -import universalelectricity.api.energy.UnitDisplay; -import universalelectricity.api.energy.UnitDisplay.Unit; -import buildcraft.api.power.IPowerReceptor; -import calclavia.lib.prefab.item.ItemBase; -import calclavia.lib.utility.FluidHelper; -import cofh.api.energy.IEnergyStorage; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.interfaces.IReadOut; -import dark.lib.interfaces.IReadOut.EnumTools; - -public class ItemReadoutTools extends ItemBase -{ - Icon pipeGuage, multiMeter; - - public ItemReadoutTools() - { - super(Settings.getNextItemID(), "DMTools", Settings.CONFIGURATION,Reference.PREFIX, CreativeTabs.tabTools); - this.setHasSubtypes(true); - this.setMaxStackSize(1); - - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister iconRegister) - { - this.pipeGuage = iconRegister.registerIcon(Reference.PREFIX + "readout.PipeGauge"); - this.multiMeter = iconRegister.registerIcon(Reference.PREFIX + "readout.multi-Meter"); - } - - @SideOnly(Side.CLIENT) - @Override - public Icon getIconFromDamage(int meta) - { - if (meta == 0) - { - return pipeGuage; - } - if (meta == 1) - { - return multiMeter; - } - return null; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) - { - int meta = itemStack.getItemDamage(); - if (meta == 0) - { - return "item." + "PipeGauge"; - } - else if (meta == 1) - { - return "item." + "MultiMeter"; - } - return "item." + this.getUnlocalizedName() + "." + meta; - } - - @Override - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - par3List.add(new ItemStack(this, 1, 0)); - par3List.add(new ItemStack(this, 1, 1)); - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) - { - if (!world.isRemote) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - EnumTools tool = EnumTools.get(itemStack.getItemDamage()); - - if (tool != null) - { - ForgeDirection hitSide = ForgeDirection.getOrientation(side); - if (tileEntity instanceof IReadOut) - { - String output = ((IReadOut) tileEntity).getMeterReading(player, hitSide, tool); - if (output != null && !output.isEmpty()) - { - if (output.length() > 100) - { - output = output.substring(0, 100); - } - output.trim(); - player.sendChatToPlayer(ChatMessageComponent.createFromText("ReadOut> " + output)); - return true; - } - } - if (tool == EnumTools.PIPE_GUAGE) - { - if (tileEntity instanceof IFluidHandler) - { - FluidTankInfo[] tanks = ((IFluidHandler) tileEntity).getTankInfo(ForgeDirection.getOrientation(side)); - if (tanks != null) - { - player.sendChatToPlayer(ChatMessageComponent.createFromText("FluidHandler> Side:" + hitSide.toString() + " Tanks:" + tanks.length)); - for (FluidStack stack : FluidHelper.getFluidList(tanks)) - { - player.sendChatToPlayer(ChatMessageComponent.createFromText("Fluid>" + stack.amount + "mb of " + stack.getFluid().getName())); - } - return true; - } - } - } - // TODO add shift click support to bring up a easier to read GUI or link to the - // block and add an on screen gui so the player can toy with a design and be updated - // TODO add toggle support to only get one energy system(UE,TE,BC,IC2) readings - // rather than all or first type read - if (tool == EnumTools.MULTI_METER) - { - if (tileEntity instanceof IVoltageInput && ((IVoltageInput) tileEntity).getVoltageInput(hitSide) > 0) - { - player.sendChatToPlayer(ChatMessageComponent.createFromText("V~In:" + ((IVoltageInput) tileEntity).getVoltageInput(hitSide))); - } - if (tileEntity instanceof IVoltageOutput && ((IVoltageOutput) tileEntity).getVoltageOutput(hitSide) > 0) - { - player.sendChatToPlayer(ChatMessageComponent.createFromText("V~Out:" + ((IVoltageOutput) tileEntity).getVoltageOutput(hitSide))); - } - if (tileEntity instanceof IConductor) - { - IEnergyNetwork network = ((IConductor) tileEntity).getNetwork(); - if (network != null) - { - player.sendChatToPlayer(ChatMessageComponent.createFromText("Network:" + network.toString())); - player.sendChatToPlayer(ChatMessageComponent.createFromText("E~In:" + UnitDisplay.getDisplay(network.getRequest(), Unit.JOULES, 2, false))); - player.sendChatToPlayer(ChatMessageComponent.createFromText("E~Out:" + UnitDisplay.getDisplay(network.getLastBuffer(), Unit.JOULES, 2, false))); - player.sendChatToPlayer(ChatMessageComponent.createFromText("R~Ohm:" + UnitDisplay.getDisplay(network.getResistance(), Unit.RESISTANCE, 2, false))); - } - } - else if (tileEntity instanceof IEnergyContainer) - { - if (((IEnergyContainer) tileEntity).getEnergyCapacity(hitSide) > 0) - { - player.sendChatToPlayer(ChatMessageComponent.createFromText("E~:" + UnitDisplay.getDisplay(((IEnergyContainer) tileEntity).getEnergy(hitSide), Unit.JOULES, 2, false) + "/" + UnitDisplay.getDisplay(((IEnergyContainer) tileEntity).getEnergyCapacity(hitSide), Unit.JOULES, 2, false))); - } - if (tileEntity instanceof TileEntityEnergyMachine) - { - if (tileEntity instanceof TileGenerator) - { - player.sendChatToPlayer(ChatMessageComponent.createFromText("E~Out:" + UnitDisplay.getDisplay(((TileEntityEnergyMachine) tileEntity).getJoulesPerTick(), Unit.JOULES, 2, true) + "/tick")); - } - else - { - player.sendChatToPlayer(ChatMessageComponent.createFromText("E~In:" + UnitDisplay.getDisplay(((TileEntityEnergyMachine) tileEntity).getJoulesPerTick(), Unit.JOULES, 2, true) + "/tick")); - - } - } - } - else if (tileEntity instanceof IEnergyStorage && ((IEnergyStorage) tileEntity).getMaxEnergyStored() > 0) - { - player.sendChatToPlayer(ChatMessageComponent.createFromText("RF~:" + UnitDisplay.getDisplay(((IEnergyStorage) tileEntity).getEnergyStored(), Unit.REDFLUX, 2, true) + "/" + UnitDisplay.getDisplay(((IEnergyStorage) tileEntity).getMaxEnergyStored(), Unit.REDFLUX, 2, true))); - } - else if (tileEntity instanceof IPowerReceptor && ((IPowerReceptor) tileEntity).getPowerReceiver(hitSide) != null && ((IPowerReceptor) tileEntity).getPowerReceiver(hitSide).getMaxEnergyStored() > 0) - { - // TODO recode for input and output - if (((IPowerReceptor) tileEntity).getPowerReceiver(hitSide) != null) - { - player.sendChatToPlayer(ChatMessageComponent.createFromText("Mj~:" + UnitDisplay.getDisplay(((IPowerReceptor) tileEntity).getPowerReceiver(hitSide).getEnergyStored(), Unit.MINECRAFT_JOULES, 2, true) + "/" + UnitDisplay.getDisplay(((IPowerReceptor) tileEntity).getPowerReceiver(hitSide).getMaxEnergyStored(), Unit.MINECRAFT_JOULES, 2, true))); - } - } - // TODO add IC2 support - } - } - - } - - return false; - } -} diff --git a/archive/java/resonantinduction/electrical/multimeter/PartMultimeter.java b/archive/java/resonantinduction/electrical/multimeter/PartMultimeter.java deleted file mode 100644 index 3dd135cc..00000000 --- a/archive/java/resonantinduction/electrical/multimeter/PartMultimeter.java +++ /dev/null @@ -1,380 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.multimeter; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.ResonantInduction; -import resonantinduction.electrical.Electrical; -import universalelectricity.api.CompatibilityModule; -import universalelectricity.api.energy.IConductor; -import universalelectricity.api.energy.IEnergyNetwork; -import calclavia.lib.network.IPacketReceiver; -import codechicken.lib.data.MCDataInput; -import codechicken.lib.data.MCDataOutput; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Rotation; -import codechicken.lib.vec.Transformation; -import codechicken.lib.vec.Vector3; -import codechicken.microblock.FaceMicroClass; -import codechicken.multipart.JCuboidPart; -import codechicken.multipart.JNormalOcclusion; -import codechicken.multipart.NormalOcclusionTest; -import codechicken.multipart.TFacePart; -import codechicken.multipart.TMultiPart; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.PacketDispatcher; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Block that detects power. - * - * @author Calclavia - * - */ -public class PartMultimeter extends JCuboidPart implements IPacketReceiver, TFacePart, JNormalOcclusion -{ - public static Cuboid6[][] bounds = new Cuboid6[6][2]; - - static - { - bounds[0][0] = new Cuboid6(1 / 8D, 0, 0, 7 / 8D, 1 / 8D, 1); - bounds[0][1] = new Cuboid6(0, 0, 1 / 8D, 1, 1 / 8D, 7 / 8D); - for (int s = 1; s < 6; s++) - { - Transformation t = Rotation.sideRotations[s].at(Vector3.center); - bounds[s][0] = bounds[0][0].copy().apply(t); - bounds[s][1] = bounds[0][1].copy().apply(t); - } - } - - public Set playersUsing = new HashSet(); - - public enum DetectMode - { - NONE("none"), LESS_THAN("lessThan"), LESS_THAN_EQUAL("lessThanOrEqual"), EQUAL("equal"), - GREATER_THAN("greaterThanOrEqual"), GREATER_THAN_EQUAL("greaterThan"); - - public String display; - - private DetectMode(String s) - { - display = s; - } - } - - private DetectMode detectMode = DetectMode.NONE; - private long peakDetection; - private long energyLimit; - private long detectedEnergy; - private long detectedAverageEnergy; - public boolean redstoneOn; - private byte side; - private int ticks; - - public void preparePlacement(int side, int itemDamage) - { - this.side = (byte) (side ^ 1); - } - - @Override - public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack item) - { - player.openGui(ResonantInduction.INSTANCE, this.side, world(), x(), y(), z()); - return true; - } - - @Override - public void update() - { - super.update(); - - this.ticks++; - - if (!world().isRemote) - { - if (ticks % 20 == 0) - { - long prevDetectedEnergy = detectedEnergy; - updateDetection(doGetDetectedEnergy()); - - boolean outputRedstone = false; - - switch (detectMode) - { - default: - break; - case EQUAL: - outputRedstone = detectedEnergy == energyLimit; - break; - case GREATER_THAN: - outputRedstone = detectedEnergy > energyLimit; - break; - case GREATER_THAN_EQUAL: - outputRedstone = detectedEnergy >= energyLimit; - break; - case LESS_THAN: - outputRedstone = detectedEnergy < energyLimit; - break; - case LESS_THAN_EQUAL: - outputRedstone = detectedEnergy <= energyLimit; - break; - } - - if (outputRedstone != redstoneOn) - { - redstoneOn = outputRedstone; - this.tile().notifyTileChange(); - } - - if (prevDetectedEnergy != detectedEnergy) - { - this.getWriteStream().writeByte(3).writeByte((byte) detectMode.ordinal()).writeLong(detectedEnergy).writeLong(detectedAverageEnergy).writeLong(energyLimit); - } - } - } - - if (!world().isRemote) - { - for (EntityPlayer player : playersUsing) - { - this.getWriteStream().writeByte(3).writeByte((byte) detectMode.ordinal()).writeLong(detectedEnergy).writeLong(detectedAverageEnergy).writeLong(energyLimit); - } - } - } - - @Override - public void readDesc(MCDataInput packet) - { - this.side = packet.readByte(); - detectMode = DetectMode.values()[packet.readByte()]; - detectedEnergy = packet.readLong(); - detectedAverageEnergy = packet.readLong(); - energyLimit = packet.readLong(); - } - - @Override - public void writeDesc(MCDataOutput packet) - { - packet.writeByte(this.side); - packet.writeByte((byte) detectMode.ordinal()); - packet.writeLong(detectedEnergy); - packet.writeLong(detectedAverageEnergy); - packet.writeLong(energyLimit); - } - - @Override - public void read(MCDataInput packet) - { - read(packet, packet.readUByte()); - } - - public void read(MCDataInput packet, int packetID) - { - if (packetID == 1) - { - energyLimit = packet.readLong(); - } - else if (packetID == 3) - { - this.detectMode = DetectMode.values()[packet.readByte()]; - this.detectedEnergy = packet.readLong(); - this.detectedAverageEnergy = packet.readLong(); - this.energyLimit = packet.readLong(); - } - } - - @Override - public void onReceivePacket(ByteArrayDataInput data, EntityPlayer player, Object... extra) - { - toggleMode(); - } - - public long doGetDetectedEnergy() - { - return getDetectedEnergy(getDirection().getOpposite(), getDetectedTile()); - } - - public TileEntity getDetectedTile() - { - ForgeDirection direction = getDirection(); - return world().getBlockTileEntity(x() + direction.offsetX, y() + direction.offsetY, z() + direction.offsetZ); - } - - public ForgeDirection getDirection() - { - return ForgeDirection.getOrientation(this.side); - } - - public static long getDetectedEnergy(ForgeDirection side, TileEntity tileEntity) - { - if (tileEntity instanceof IConductor) - { - IEnergyNetwork network = ((IConductor) tileEntity).getNetwork(); - return network.getLastBuffer(); - } - - return CompatibilityModule.getEnergy(tileEntity, side); - } - - public void updateDetection(long detected) - { - detectedEnergy = detected; - detectedAverageEnergy = (detectedAverageEnergy + detectedEnergy) / 2; - peakDetection = Math.max(peakDetection, detectedEnergy); - } - - public long getDetectedEnergy() - { - return detectedEnergy; - } - - public long getAverageDetectedEnergy() - { - return detectedAverageEnergy; - } - - public void toggleMode() - { - if (!this.world().isRemote) - { - detectMode = DetectMode.values()[(detectMode.ordinal() + 1) % DetectMode.values().length]; - } - else - { - PacketDispatcher.sendPacketToServer(ResonantInduction.PACKET_MULTIPART.getPacket(new universalelectricity.api.vector.Vector3(x(), y(), z()), getPartID())); - } - } - - public int getPartID() - { - for (int i = 0; i < this.tile().partList().size(); i++) - { - if (this.tile().partMap(i) == this) - { - return i; - } - } - - return 0; - } - - @Override - public void load(NBTTagCompound nbt) - { - super.load(nbt); - side = nbt.getByte("side"); - detectMode = DetectMode.values()[nbt.getByte("detectMode")]; - energyLimit = nbt.getLong("energyLimit"); - } - - @Override - public void save(NBTTagCompound nbt) - { - super.save(nbt); - nbt.setByte("side", this.side); - nbt.setByte("detectMode", (byte) detectMode.ordinal()); - nbt.setLong("energyLimit", energyLimit); - } - - public DetectMode getMode() - { - return detectMode; - } - - public float getLimit() - { - return energyLimit; - } - - public float getPeak() - { - return peakDetection; - } - - @Override - public String getType() - { - return "resonant_induction_multimeter"; - } - - @Override - public int getSlotMask() - { - return 1 << this.side; - } - - @Override - public Cuboid6 getBounds() - { - return FaceMicroClass.aBounds()[0x10 | this.side]; - } - - @Override - public Iterable getOcclusionBoxes() - { - return Arrays.asList(bounds[this.side]); - } - - @Override - public boolean occlusionTest(TMultiPart npart) - { - return NormalOcclusionTest.apply(this, npart); - } - - @Override - public int redstoneConductionMap() - { - return 0; - } - - @Override - public boolean solid(int arg0) - { - return true; - } - - protected ItemStack getItem() - { - return new ItemStack(Electrical.itemMultimeter); - } - - @Override - public Iterable getDrops() - { - List drops = new ArrayList(); - drops.add(getItem()); - return drops; - } - - @Override - public ItemStack pickItem(MovingObjectPosition hit) - { - return getItem(); - } - - @Override - @SideOnly(Side.CLIENT) - public void renderDynamic(Vector3 pos, float frame, int pass) - { - if (pass == 0) - { - RenderMultimeter.render(this, pos.x, pos.y, pos.z); - } - } - -} diff --git a/archive/java/resonantinduction/electrical/multimeter/RenderMultimeter.java b/archive/java/resonantinduction/electrical/multimeter/RenderMultimeter.java deleted file mode 100644 index 9d5aa627..00000000 --- a/archive/java/resonantinduction/electrical/multimeter/RenderMultimeter.java +++ /dev/null @@ -1,155 +0,0 @@ -package resonantinduction.electrical.multimeter; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import universalelectricity.api.energy.UnitDisplay; -import universalelectricity.api.energy.UnitDisplay.Unit; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Class used to render text onto the multimeter block. - * - * @author Calclavia - * - */ -@SideOnly(Side.CLIENT) -public class RenderMultimeter -{ - public static final ModelMultimeter MODEL = new ModelMultimeter(); - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_DIRECTORY + "multimeter.png"); - - @SuppressWarnings("incomplete-switch") - public static void render(PartMultimeter tileEntity, double x, double y, double z) - { - ForgeDirection direction = tileEntity.getDirection(); - - GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); - GL11.glRotatef(90, 0, 0, 1); - GL11.glTranslated(0, -1, 0); - - switch (direction) - { - case UP: - GL11.glRotatef(90, 0, 1, 0); - break; - case DOWN: - GL11.glRotatef(-90, 0, 1, 0); - break; - case NORTH: - GL11.glRotatef(180, 0, 1, 0); - GL11.glRotatef(180, 0, 0, 1); - GL11.glTranslatef(0, -2, 0); - break; - case SOUTH: - break; - case WEST: - GL11.glTranslatef(0, 1, 1); - GL11.glRotatef(-90, 1, 0, 0); - break; - case EAST: - GL11.glTranslatef(0, 1, -1); - GL11.glRotatef(90, 1, 0, 0); - break; - } - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - MODEL.render(0.0625f); - - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glPolygonOffset(-10, -10); - GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); - - float dx = 1F / 16; - float dz = 1F / 16; - float displayWidth = 1 - 2F / 16; - float displayHeight = 1 - 2F / 16; - GL11.glTranslatef((float) x, (float) y, (float) z); - - switch (direction) - { - case UP: - GL11.glTranslatef(1, 1, 0); - GL11.glRotatef(180, 1, 0, 0); - GL11.glRotatef(180, 0, 1, 0); - GL11.glTranslatef(0, -0.9f, -0.1f); - break; - case DOWN: - GL11.glRotatef(180, 0, 1, 0); - GL11.glTranslatef(-1, -0.9f, -1.1f); - break; - case SOUTH: - GL11.glTranslatef(1, 1, 1); - GL11.glRotatef(180, 0, 1, 0); - GL11.glRotatef(90, 1, 0, 0); - GL11.glTranslatef(0, -0.9f, -0.1f); - break; - case NORTH: - GL11.glTranslatef(0, 1, 0); - GL11.glRotatef(0, 0, 1, 0); - GL11.glRotatef(90, 1, 0, 0); - GL11.glTranslatef(0, -0.9f, -0.1f); - break; - case EAST: - GL11.glTranslatef(1, 1, 0); - GL11.glRotatef(-90, 0, 1, 0); - GL11.glRotatef(90, 1, 0, 0); - GL11.glTranslatef(0, -0.9f, -0.1f); - break; - case WEST: - GL11.glTranslatef(0, 1, 1); - GL11.glRotatef(90, 0, 1, 0); - GL11.glRotatef(90, 1, 0, 0); - GL11.glTranslatef(0, -0.9f, -0.1f); - break; - } - - GL11.glTranslatef(dx + displayWidth / 2, 1F, dz + displayHeight / 2); - GL11.glRotatef(-90, 1, 0, 0); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; - - String joules = UnitDisplay.getDisplayShort(tileEntity.getDetectedEnergy(), Unit.JOULES); - - int stringWidth = Math.max(fontRenderer.getStringWidth(joules), 0); - // maxWidth += 8; - int lineHeight = fontRenderer.FONT_HEIGHT + 2; - int requiredHeight = lineHeight * 1; - - /** - * Create an average scale. - */ - float scaleX = displayWidth / stringWidth; - float scaleY = displayHeight / requiredHeight; - float scale = (float) (Math.min(scaleX, scaleY) * 0.8); - GL11.glScalef(scale, -scale, scale); - GL11.glDepthMask(false); - - int realHeight = (int) Math.floor(displayHeight / scale); - int realWidth = (int) Math.floor(displayWidth / scale); - - int offsetY = (realHeight - requiredHeight) / 2; - int offsetX = (realWidth - stringWidth) / 2; - - GL11.glDisable(GL11.GL_LIGHTING); - fontRenderer.drawString(joules, offsetX - realWidth / 2, 1 + offsetY - realHeight / 2 + 0 * lineHeight, 1); - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDepthMask(true); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL); - GL11.glPopMatrix(); - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/electrical/render/ElectricalBlockRenderingHandler.java b/archive/java/resonantinduction/electrical/render/ElectricalBlockRenderingHandler.java deleted file mode 100644 index cb9a186e..00000000 --- a/archive/java/resonantinduction/electrical/render/ElectricalBlockRenderingHandler.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.render; - -import static org.lwjgl.opengl.GL11.glPopMatrix; -import static org.lwjgl.opengl.GL11.glPushMatrix; -import static org.lwjgl.opengl.GL11.glRotatef; -import static org.lwjgl.opengl.GL11.glScalef; -import static org.lwjgl.opengl.GL11.glTranslated; -import static org.lwjgl.opengl.GL11.glTranslatef; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.electrical.battery.BlockBattery; -import resonantinduction.electrical.battery.RenderBattery; -import resonantinduction.electrical.generator.solar.BlockSolarPanel; -import resonantinduction.electrical.generator.solar.RenderSolarPanel; -import resonantinduction.electrical.levitator.BlockLevitator; -import resonantinduction.electrical.levitator.RenderLevitator; -import resonantinduction.electrical.tesla.BlockTesla; -import resonantinduction.electrical.tesla.RenderTesla; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -@SideOnly(Side.CLIENT) -public class ElectricalBlockRenderingHandler implements ISimpleBlockRenderingHandler -{ - public static final ElectricalBlockRenderingHandler INSTANCE = new ElectricalBlockRenderingHandler(); - public static final int ID = RenderingRegistry.getNextAvailableRenderId(); - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) - { - if (block instanceof BlockTesla) - { - glPushMatrix(); - glTranslated(0.5, 1.5, 0.5); - glRotatef(180F, 0.0F, 0.0F, 1.0F); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderTesla.TEXTURE_BOTTOM); - RenderTesla.MODEL_BOTTOM.render(0.0625f); - glPopMatrix(); - } - else if (block instanceof BlockLevitator) - { - glPushMatrix(); - glTranslated(0.5, 1.5, 0.5); - glRotatef(180F, 0.0F, 0.0F, 1.0F); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderLevitator.TEXTURE); - RenderLevitator.MODEL.render(0.0625f); - glPopMatrix(); - } - else if (block instanceof BlockBattery) - { - glPushMatrix(); - glTranslatef(0.5f, 0.9f, 0.5f); - glScalef(0.5f, 0.5f, 0.5f); - glRotatef(180F, 0.0F, 0.0F, 1.0F); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderBattery.TEXTURE); - RenderBattery.MODEL.renderAll(); - glPopMatrix(); - } - else if (block instanceof BlockSolarPanel) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderSolarPanel.TEXTURE); - GL11.glTranslatef(0.0F, 1.1F, 0.0F); - GL11.glRotatef(180f, 0f, 0f, 1f); - RenderSolarPanel.MODEL.render(0.0625F); - } - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) - { - return false; - } - - @Override - public boolean shouldRender3DInInventory() - { - return true; - } - - @Override - public int getRenderId() - { - return ID; - } -} diff --git a/archive/java/resonantinduction/electrical/render/FXElectricBolt.java b/archive/java/resonantinduction/electrical/render/FXElectricBolt.java deleted file mode 100644 index 38f12be0..00000000 --- a/archive/java/resonantinduction/electrical/render/FXElectricBolt.java +++ /dev/null @@ -1,458 +0,0 @@ -package resonantinduction.electrical.render; - -import static org.lwjgl.opengl.GL11.GL_BLEND; -import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA; -import static org.lwjgl.opengl.GL11.GL_SMOOTH; -import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA; -import static org.lwjgl.opengl.GL11.glBlendFunc; -import static org.lwjgl.opengl.GL11.glEnable; -import static org.lwjgl.opengl.GL11.glShadeModel; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Random; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import universalelectricity.api.vector.Vector3; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Electric shock Fxs. - * - * @author Calclavia - * - */ -@SideOnly(Side.CLIENT) -public class FXElectricBolt extends EntityFX -{ - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_DIRECTORY + "fadedSphere.png"); - public static final ResourceLocation PARTICLE_RESOURCE = new ResourceLocation("textures/particle/particles.png"); - - /** The width of the electrical bolt. */ - private float boltWidth; - /** The maximum length of the bolt */ - public double boltLength; - /** Electric Bolt's start and end positions; */ - private BoltPoint start; - private BoltPoint end; - /** An array of the segments of the bolt. */ - private List segments = new ArrayList(); - private final Map parentIDMap = new HashMap(); - /** Determines how complex the bolt is. */ - public float complexity; - public int segmentCount; - private int maxSplitID; - private Random rand; - - public FXElectricBolt(World world, Vector3 startVec, Vector3 targetVec, boolean doSplits) - { - super(world, startVec.x, startVec.y, startVec.z); - - this.rand = new Random(); - this.start = new BoltPoint(startVec); - this.end = new BoltPoint(targetVec); - - if (this.end.y == Double.POSITIVE_INFINITY) - { - this.end.y = Minecraft.getMinecraft().thePlayer.posY + 30; - } - - /** By default, we do an electrical color */ - this.segmentCount = 1; - this.particleMaxAge = (3 + this.rand.nextInt(3) - 1); - this.complexity = 2f; - this.boltWidth = 0.05f; - this.boltLength = this.start.distance(this.end); - this.setUp(doSplits); - } - - public FXElectricBolt(World world, Vector3 startVec, Vector3 targetVec) - { - this(world, startVec, targetVec, true); - } - - /** - * Calculate all required segments of the entire bolt. - */ - private void setUp(boolean doSplits) - { - this.segments.add(new BoltSegment(this.start, this.end)); - this.recalculate(); - - if (doSplits) - { - double offsetRatio = this.boltLength * this.complexity; - this.split(2, offsetRatio / 10, 0.7f, 0.1f, 20 / 2); - this.split(2, offsetRatio / 15, 0.5f, 0.1f, 25 / 2); - this.split(2, offsetRatio / 25, 0.5f, 0.1f, 28 / 2); - this.split(2, offsetRatio / 38, 0.5f, 0.1f, 30 / 2); - this.split(2, offsetRatio / 55, 0, 0, 0); - this.split(2, offsetRatio / 70, 0, 0, 0); - this.recalculate(); - - Collections.sort(this.segments, new Comparator() - { - public int compare(BoltSegment bolt1, BoltSegment bolt2) - { - return Float.compare(bolt2.alpha, bolt1.alpha); - } - - @Override - public int compare(Object obj1, Object obj2) - { - return compare((BoltSegment) obj1, (BoltSegment) obj2); - } - }); - } - } - - public FXElectricBolt setColor(float r, float g, float b) - { - this.particleRed = r + (this.rand.nextFloat() * 0.1f) - 0.1f; - this.particleGreen = g + (this.rand.nextFloat() * 0.1f) - 0.1f; - this.particleBlue = b + (this.rand.nextFloat() * 0.1f) - 0.1f; - return this; - } - - /** - * Slits a large segment into multiple smaller ones. - * - * @param splitAmount - The amount of splits - * @param offset - The multiplier scale for the offset. - * @param splitChance - The chance of creating a split. - * @param splitLength - The length of each split. - * @param splitAngle - The angle of the split. - */ - public void split(int splitAmount, double offset, float splitChance, float splitLength, float splitAngle) - { - /** Temporarily store old segments in a new array */ - List oldSegments = this.segments; - this.segments = new ArrayList(); - /** Previous segment */ - BoltSegment prev = null; - - for (BoltSegment segment : oldSegments) - { - prev = segment.prev; - /** Length of each subsegment */ - Vector3 subSegment = segment.difference.clone().scale(1.0F / splitAmount); - - /** - * Creates an array of new bolt points. The first and last points of the bolts are the - * respected start and end points of the current segment. - */ - BoltPoint[] newPoints = new BoltPoint[splitAmount + 1]; - Vector3 startPoint = segment.start; - newPoints[0] = segment.start; - newPoints[splitAmount] = segment.end; - - /** - * Create bolt points. - */ - for (int i = 1; i < splitAmount; i++) - { - Vector3 newOffset = segment.difference.getPerpendicular().rotate(this.rand.nextFloat() * 360, segment.difference).scale((this.rand.nextFloat() - 0.5F) * offset); - Vector3 basePoint = startPoint.clone().translate(subSegment.clone().scale(i)); - - newPoints[i] = new BoltPoint(basePoint, newOffset); - } - - for (int i = 0; i < splitAmount; i++) - { - BoltSegment next = new BoltSegment(newPoints[i], newPoints[(i + 1)], segment.alpha, segment.id * splitAmount + i, segment.splitID); - next.prev = prev; - - if (prev != null) - { - prev.next = next; - } - - if ((i != 0) && (this.rand.nextFloat() < splitChance)) - { - Vector3 splitrot = next.difference.xCrossProduct().rotate(this.rand.nextFloat() * 360, next.difference); - Vector3 diff = next.difference.clone().rotate((this.rand.nextFloat() * 0.66F + 0.33F) * splitAngle, splitrot).scale(splitLength); - this.maxSplitID += 1; - this.parentIDMap.put(this.maxSplitID, next.splitID); - BoltSegment split = new BoltSegment(newPoints[i], new BoltPoint(newPoints[(i + 1)].base, newPoints[(i + 1)].offset.clone().translate(diff)), segment.alpha / 2f, next.id, this.maxSplitID); - split.prev = prev; - this.segments.add(split); - } - - prev = next; - this.segments.add(next); - } - - if (segment.next != null) - { - segment.next.prev = prev; - } - } - - this.segmentCount *= splitAmount; - - } - - private void recalculate() - { - HashMap lastActiveSegment = new HashMap(); - - Collections.sort(this.segments, new Comparator() - { - public int compare(BoltSegment o1, BoltSegment o2) - { - int comp = Integer.valueOf(o1.splitID).compareTo(Integer.valueOf(o2.splitID)); - if (comp == 0) - { - return Integer.valueOf(o1.id).compareTo(Integer.valueOf(o2.id)); - } - return comp; - } - - @Override - public int compare(Object obj, Object obj1) - { - return compare((BoltSegment) obj, (BoltSegment) obj1); - } - }); - - int lastSplitCalc = 0; - int lastActiveSeg = 0; - - for (BoltSegment segment : this.segments) - { - if (segment.splitID > lastSplitCalc) - { - lastActiveSegment.put(lastSplitCalc, lastActiveSeg); - lastSplitCalc = segment.splitID; - lastActiveSeg = lastActiveSegment.get(this.parentIDMap.get(segment.splitID)).intValue(); - } - - lastActiveSeg = segment.id; - } - - lastActiveSegment.put(lastSplitCalc, lastActiveSeg); - lastSplitCalc = 0; - lastActiveSeg = lastActiveSegment.get(0).intValue(); - BoltSegment segment; - - for (Iterator iterator = this.segments.iterator(); iterator.hasNext(); segment.recalculate()) - { - segment = iterator.next(); - - if (lastSplitCalc != segment.splitID) - { - lastSplitCalc = segment.splitID; - lastActiveSeg = lastActiveSegment.get(segment.splitID); - } - - if (segment.id > lastActiveSeg) - { - iterator.remove(); - } - } - } - - @Override - public void onUpdate() - { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - - if (this.particleAge++ >= this.particleMaxAge) - { - this.setDead(); - } - } - - @Override - public void renderParticle(Tessellator tessellator, float partialframe, float cosYaw, float cosPitch, float sinYaw, float sinSinPitch, float cosSinPitch) - { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - - tessellator.draw(); - GL11.glPushMatrix(); - - GL11.glDepthMask(false); - GL11.glEnable(3042); - - glShadeModel(GL_SMOOTH); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - /** - * Render the actual bolts. - */ - tessellator.startDrawingQuads(); - tessellator.setBrightness(15728880); - Vector3 playerVector = new Vector3(sinYaw * -cosPitch, -cosSinPitch / cosYaw, cosYaw * cosPitch); - - int renderlength = (int) ((this.particleAge + partialframe + (int) (this.boltLength * 3.0F)) / (int) (this.boltLength * 3.0F) * this.segmentCount); - - for (BoltSegment segment : this.segments) - { - if (segment != null && segment.id <= renderlength) - { - double renderWidth = this.boltWidth * ((new Vector3(player).distance(segment.start) / 5f + 1f) * (1 + segment.alpha) * 0.5f); - renderWidth = Math.min(this.boltWidth, Math.max(renderWidth, 0)); - - if (segment.difference.getMagnitude() > 0 && segment.difference.getMagnitude() != Double.NaN && segment.difference.getMagnitude() != Double.POSITIVE_INFINITY && renderWidth > 0 && renderWidth != Double.NaN && renderWidth != Double.POSITIVE_INFINITY) - { - Vector3 diffPrev = playerVector.crossProduct(segment.prevDiff).scale(renderWidth / segment.sinPrev); - Vector3 diffNext = playerVector.crossProduct(segment.nextDiff).scale(renderWidth / segment.sinNext); - Vector3 startVec = segment.start; - Vector3 endVec = segment.end; - float rx1 = (float) (startVec.x - interpPosX); - float ry1 = (float) (startVec.y - interpPosY); - float rz1 = (float) (startVec.z - interpPosZ); - float rx2 = (float) (endVec.x - interpPosX); - float ry2 = (float) (endVec.y - interpPosY); - float rz2 = (float) (endVec.z - interpPosZ); - - tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, (1.0F - (this.particleAge >= 0 ? ((float) this.particleAge / (float) this.particleMaxAge) : 0.0F) * 0.6f) * segment.alpha); - tessellator.addVertexWithUV(rx2 - diffNext.x, ry2 - diffNext.y, rz2 - diffNext.z, 0.5D, 0.0D); - tessellator.addVertexWithUV(rx1 - diffPrev.x, ry1 - diffPrev.y, rz1 - diffPrev.z, 0.5D, 0.0D); - tessellator.addVertexWithUV(rx1 + diffPrev.x, ry1 + diffPrev.y, rz1 + diffPrev.z, 0.5D, 1.0D); - tessellator.addVertexWithUV(rx2 + diffNext.x, ry2 + diffNext.y, rz2 + diffNext.z, 0.5D, 1.0D); - - /** - * Render the bolts balls. - */ - - if (segment.next == null) - { - Vector3 roundEnd = segment.end.clone().translate(segment.difference.clone().normalize().scale(renderWidth)); - float rx3 = (float) (roundEnd.x - interpPosX); - float ry3 = (float) (roundEnd.y - interpPosY); - float rz3 = (float) (roundEnd.z - interpPosZ); - tessellator.addVertexWithUV(rx3 - diffNext.x, ry3 - diffNext.y, rz3 - diffNext.z, 0.0D, 0.0D); - tessellator.addVertexWithUV(rx2 - diffNext.x, ry2 - diffNext.y, rz2 - diffNext.z, 0.5D, 0.0D); - tessellator.addVertexWithUV(rx2 + diffNext.x, ry2 + diffNext.y, rz2 + diffNext.z, 0.5D, 1.0D); - tessellator.addVertexWithUV(rx3 + diffNext.x, ry3 + diffNext.y, rz3 + diffNext.z, 0.0D, 1.0D); - } - - if (segment.prev == null) - { - Vector3 roundEnd = segment.start.clone().difference(segment.difference.clone().normalize().scale(renderWidth)); - float rx3 = (float) (roundEnd.x - interpPosX); - float ry3 = (float) (roundEnd.y - interpPosY); - float rz3 = (float) (roundEnd.z - interpPosZ); - tessellator.addVertexWithUV(rx1 - diffPrev.x, ry1 - diffPrev.y, rz1 - diffPrev.z, 0.5D, 0.0D); - tessellator.addVertexWithUV(rx3 - diffPrev.x, ry3 - diffPrev.y, rz3 - diffPrev.z, 0.0D, 0.0D); - tessellator.addVertexWithUV(rx3 + diffPrev.x, ry3 + diffPrev.y, rz3 + diffPrev.z, 0.0D, 1.0D); - tessellator.addVertexWithUV(rx1 + diffPrev.x, ry1 + diffPrev.y, rz1 + diffPrev.z, 0.5D, 1.0D); - } - } - } - } - - tessellator.draw(); - - GL11.glDisable(3042); - GL11.glDepthMask(true); - GL11.glPopMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(PARTICLE_RESOURCE); - - tessellator.startDrawingQuads(); - } - - private class BoltPoint extends Vector3 - { - public Vector3 base; - public Vector3 offset; - - public BoltPoint(Vector3 base, Vector3 offset) - { - super(base.clone().translate(offset)); - this.base = base; - this.offset = offset; - } - - public BoltPoint(Vector3 base) - { - this(base, new Vector3()); - } - } - - private class BoltSegment - { - public BoltPoint start; - public BoltPoint end; - public BoltSegment prev; - public BoltSegment next; - public float alpha; - public int id; - public int splitID; - - /** - * All differences are cached. - */ - public Vector3 difference; - public Vector3 prevDiff; - public Vector3 nextDiff; - public double sinPrev; - public double sinNext; - - public BoltSegment(BoltPoint start, BoltPoint end) - { - this(start, end, 1, 0, 0); - } - - public BoltSegment(BoltPoint start, BoltPoint end, float alpha, int id, int splitID) - { - this.start = start; - this.end = end; - this.alpha = alpha; - this.id = id; - this.splitID = splitID; - this.difference = this.end.clone().difference(this.start); - } - - public void recalculate() - { - if (this.prev != null) - { - Vector3 prevDiffNorm = this.prev.difference.clone().normalize(); - Vector3 diffNorm = this.difference.clone().normalize(); - this.prevDiff = diffNorm.clone().translate(prevDiffNorm).normalize(); - this.sinPrev = Math.sin(diffNorm.anglePreNorm(prevDiffNorm.clone().scale(-1)) / 2); - } - else - { - this.prevDiff = this.difference.clone().normalize(); - this.sinPrev = 1; - } - - if (this.next != null) - { - Vector3 nextDiffNorm = this.next.difference.clone().normalize(); - Vector3 diffNorm = this.difference.clone().normalize(); - this.nextDiff = diffNorm.clone().translate(nextDiffNorm).normalize(); - this.sinNext = Math.sin(diffNorm.anglePreNorm(nextDiffNorm.clone().scale(-1)) / 2); - } - else - { - this.nextDiff = this.difference.clone().normalize(); - this.sinNext = 1; - } - } - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/electrical/tesla/BlockTesla.java b/archive/java/resonantinduction/electrical/tesla/BlockTesla.java deleted file mode 100644 index 6813a1f8..00000000 --- a/archive/java/resonantinduction/electrical/tesla/BlockTesla.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.tesla; - -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import resonantinduction.core.Reference; -import resonantinduction.core.Utility; -import resonantinduction.core.prefab.block.BlockIOBase; -import resonantinduction.electrical.render.ElectricalBlockRenderingHandler; -import calclavia.lib.utility.LanguageUtility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -public class BlockTesla extends BlockIOBase implements ITileEntityProvider -{ - public BlockTesla(int id) - { - super("tesla", id); - this.setTextureName(Reference.PREFIX + "machine"); - } - - @Override - public void onBlockAdded(World world, int x, int y, int z) - { - super.onBlockAdded(world, x, y, z); - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - ((TileTesla) tileEntity).updatePositionStatus(); - } - - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - TileEntity t = world.getBlockTileEntity(x, y, z); - TileTesla tileEntity = ((TileTesla) t).getControllingTelsa(); - - if (entityPlayer.getCurrentEquippedItem() != null) - { - int dyeColor = Utility.isDye(entityPlayer.getCurrentEquippedItem()); - - if (dyeColor != -1) - { - tileEntity.setDye(dyeColor); - - if (!entityPlayer.capabilities.isCreativeMode) - { - entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, 1); - } - - return true; - } - else if (entityPlayer.getCurrentEquippedItem().itemID == Item.redstone.itemID) - { - boolean status = tileEntity.toggleEntityAttack(); - - if (!entityPlayer.capabilities.isCreativeMode) - { - entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, 1); - } - - if (!world.isRemote) - { - entityPlayer.addChatMessage(LanguageUtility.getLocal("message.tesla.toggleAttack").replace("%v", status + "")); - } - - return true; - } - } - else - { - boolean receiveMode = tileEntity.toggleReceive(); - - if (world.isRemote) - { - entityPlayer.addChatMessage(LanguageUtility.getLocal("message.tesla.mode").replace("%v", receiveMode + "")); - } - - return true; - - } - - return false; - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, int id) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - ((TileTesla) tileEntity).updatePositionStatus(); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileTesla(); - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderType() - { - return ElectricalBlockRenderingHandler.INSTANCE.getRenderId(); - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - -} diff --git a/archive/java/resonantinduction/electrical/tesla/ModelTeslaBottom.java b/archive/java/resonantinduction/electrical/tesla/ModelTeslaBottom.java deleted file mode 100644 index 21acabcc..00000000 --- a/archive/java/resonantinduction/electrical/tesla/ModelTeslaBottom.java +++ /dev/null @@ -1,206 +0,0 @@ -package resonantinduction.electrical.tesla; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelTeslaBottom extends ModelBase -{ - // fields - ModelRenderer Base; - ModelRenderer BackBottomSide; - ModelRenderer FrontBottomSide; - ModelRenderer SlantedFrontPanel; - ModelRenderer SlantedPanelBase; - ModelRenderer TopBase; - ModelRenderer FrontTopPole; - ModelRenderer SideTopPole; - ModelRenderer LeftAntennae; - ModelRenderer RightAntennae; - ModelRenderer BackAntennae; - ModelRenderer FrontAntennae; - ModelRenderer TopBasePanel; - ModelRenderer ChargePack; - ModelRenderer WireLeftBottomPole; - ModelRenderer WireLeftTopPole; - ModelRenderer WireRightBottomPole; - ModelRenderer WireRightTopPole; - ModelRenderer BackRightConnector; - ModelRenderer BackLeftConnector; - ModelRenderer FrontLeftConnector; - ModelRenderer FrontRightConnector; - - public ModelTeslaBottom() - { - textureWidth = 128; - textureHeight = 128; - - Base = new ModelRenderer(this, 0, 0); - Base.addBox(0F, 0F, 0F, 9, 10, 9); - Base.setRotationPoint(-4.5F, 14F, -4.5F); - Base.setTextureSize(128, 128); - Base.mirror = true; - setRotation(Base, 0F, 0F, 0F); - BackBottomSide = new ModelRenderer(this, 38, 0); - BackBottomSide.addBox(0F, 0F, 0F, 11, 7, 2); - BackBottomSide.setRotationPoint(-5.5F, 17F, 1F); - BackBottomSide.setTextureSize(128, 128); - BackBottomSide.mirror = true; - setRotation(BackBottomSide, 0F, 0F, 0F); - FrontBottomSide = new ModelRenderer(this, 38, 0); - FrontBottomSide.addBox(0F, 0F, 0F, 11, 7, 2); - FrontBottomSide.setRotationPoint(-5.5F, 17F, -3F); - FrontBottomSide.setTextureSize(128, 128); - FrontBottomSide.mirror = true; - setRotation(FrontBottomSide, 0F, 0F, 0F); - SlantedFrontPanel = new ModelRenderer(this, 38, 10); - SlantedFrontPanel.addBox(0F, 0F, 0F, 4, 6, 2); - SlantedFrontPanel.setRotationPoint(-2F, 17F, -4F); - SlantedFrontPanel.setTextureSize(128, 128); - SlantedFrontPanel.mirror = true; - setRotation(SlantedFrontPanel, -0.4234231F, 0F, 0F); - SlantedPanelBase = new ModelRenderer(this, 51, 10); - SlantedPanelBase.addBox(0F, 0F, 0F, 6, 3, 2); - SlantedPanelBase.setRotationPoint(-3F, 21F, -6.5F); - SlantedPanelBase.setTextureSize(128, 128); - SlantedPanelBase.mirror = true; - setRotation(SlantedPanelBase, 0F, 0F, 0F); - TopBase = new ModelRenderer(this, 0, 20); - TopBase.addBox(0F, 0F, 0F, 6, 5, 6); - TopBase.setRotationPoint(-3F, 9F, -3F); - TopBase.setTextureSize(128, 128); - TopBase.mirror = true; - setRotation(TopBase, 0F, 0F, 0F); - FrontTopPole = new ModelRenderer(this, 0, 32); - FrontTopPole.addBox(0F, 0F, 0F, 2, 2, 8); - FrontTopPole.setRotationPoint(-1F, 10F, -4F); - FrontTopPole.setTextureSize(128, 128); - FrontTopPole.mirror = true; - setRotation(FrontTopPole, 0F, 0F, 0F); - SideTopPole = new ModelRenderer(this, 0, 43); - SideTopPole.addBox(0F, 0F, 0F, 8, 2, 2); - SideTopPole.setRotationPoint(-4F, 10F, -1F); - SideTopPole.setTextureSize(128, 128); - SideTopPole.mirror = true; - setRotation(SideTopPole, 0F, 0F, 0F); - LeftAntennae = new ModelRenderer(this, 25, 20); - LeftAntennae.addBox(0F, 0F, 0F, 1, 3, 1); - LeftAntennae.setRotationPoint(-4.5F, 8.8F, -0.5F); - LeftAntennae.setTextureSize(128, 128); - LeftAntennae.mirror = true; - setRotation(LeftAntennae, 0F, 0F, 0F); - RightAntennae = new ModelRenderer(this, 30, 20); - RightAntennae.addBox(0F, 0F, 0F, 1, 3, 1); - RightAntennae.setRotationPoint(3.5F, 8.8F, -0.5F); - RightAntennae.setTextureSize(128, 128); - RightAntennae.mirror = true; - setRotation(RightAntennae, 0F, 0F, 0F); - BackAntennae = new ModelRenderer(this, 25, 25); - BackAntennae.addBox(0F, 0F, 0F, 1, 3, 1); - BackAntennae.setRotationPoint(-0.5F, 8.8F, 3.5F); - BackAntennae.setTextureSize(128, 128); - BackAntennae.mirror = true; - setRotation(BackAntennae, 0F, 0F, 0F); - FrontAntennae = new ModelRenderer(this, 30, 25); - FrontAntennae.addBox(0F, 0F, 0F, 1, 3, 1); - FrontAntennae.setRotationPoint(-0.5F, 8.8F, -4.5F); - FrontAntennae.setTextureSize(128, 128); - FrontAntennae.mirror = true; - setRotation(FrontAntennae, 0F, 0F, 0F); - TopBasePanel = new ModelRenderer(this, 36, 20); - TopBasePanel.addBox(0F, 0F, 0F, 7, 1, 7); - TopBasePanel.setRotationPoint(-3.5F, 13F, -3.5F); - TopBasePanel.setTextureSize(128, 128); - TopBasePanel.mirror = true; - setRotation(TopBasePanel, 0F, 0F, 0F); - ChargePack = new ModelRenderer(this, 37, 29); - ChargePack.addBox(0F, 0F, 0F, 6, 7, 3); - ChargePack.setRotationPoint(-3F, 17F, 3.5F); - ChargePack.setTextureSize(128, 128); - ChargePack.mirror = true; - setRotation(ChargePack, 0F, 0F, 0F); - WireLeftBottomPole = new ModelRenderer(this, 21, 32); - WireLeftBottomPole.addBox(0F, 0F, 0F, 1, 10, 1); - WireLeftBottomPole.setRotationPoint(-2F, 11.86667F, 6F); - WireLeftBottomPole.setTextureSize(128, 128); - WireLeftBottomPole.mirror = true; - setRotation(WireLeftBottomPole, 0F, 0F, 0F); - WireLeftTopPole = new ModelRenderer(this, 26, 32); - WireLeftTopPole.addBox(0F, 0F, 0F, 1, 1, 4); - WireLeftTopPole.setRotationPoint(-2F, 10.86667F, 3F); - WireLeftTopPole.setTextureSize(128, 128); - WireLeftTopPole.mirror = true; - setRotation(WireLeftTopPole, 0F, 0F, 0F); - WireRightBottomPole = new ModelRenderer(this, 21, 32); - WireRightBottomPole.addBox(0F, 0F, 0F, 1, 10, 1); - WireRightBottomPole.setRotationPoint(1F, 11.86667F, 6F); - WireRightBottomPole.setTextureSize(128, 128); - WireRightBottomPole.mirror = true; - setRotation(WireRightBottomPole, 0F, 0F, 0F); - WireRightTopPole = new ModelRenderer(this, 26, 38); - WireRightTopPole.addBox(0F, 0F, 0F, 1, 1, 4); - WireRightTopPole.setRotationPoint(1F, 10.86667F, 3F); - WireRightTopPole.setTextureSize(128, 128); - WireRightTopPole.mirror = true; - setRotation(WireRightTopPole, 0F, 0F, 0F); - BackRightConnector = new ModelRenderer(this, 65, 0); - BackRightConnector.addBox(0F, 0F, 0F, 1, 1, 1); - BackRightConnector.setRotationPoint(1F, 8F, 1.066667F); - BackRightConnector.setTextureSize(128, 128); - BackRightConnector.mirror = true; - setRotation(BackRightConnector, 0F, 0F, 0F); - BackLeftConnector = new ModelRenderer(this, 65, 0); - BackLeftConnector.addBox(0F, 0F, 0F, 1, 1, 1); - BackLeftConnector.setRotationPoint(-2F, 8F, 1F); - BackLeftConnector.setTextureSize(128, 128); - BackLeftConnector.mirror = true; - setRotation(BackLeftConnector, 0F, 0F, 0F); - FrontLeftConnector = new ModelRenderer(this, 65, 0); - FrontLeftConnector.addBox(0F, 0F, 0F, 1, 1, 1); - FrontLeftConnector.setRotationPoint(-2F, 8F, -2F); - FrontLeftConnector.setTextureSize(128, 128); - FrontLeftConnector.mirror = true; - setRotation(FrontLeftConnector, 0F, 0F, 0F); - FrontRightConnector = new ModelRenderer(this, 65, 0); - FrontRightConnector.addBox(0F, 0F, 0F, 1, 1, 1); - FrontRightConnector.setRotationPoint(1F, 8F, -2F); - FrontRightConnector.setTextureSize(128, 128); - FrontRightConnector.mirror = true; - setRotation(FrontRightConnector, 0F, 0F, 0F); - } - - public void render(float f5) - { - Base.render(f5); - BackBottomSide.render(f5); - FrontBottomSide.render(f5); - SlantedFrontPanel.render(f5); - SlantedPanelBase.render(f5); - TopBase.render(f5); - FrontTopPole.render(f5); - SideTopPole.render(f5); - LeftAntennae.render(f5); - RightAntennae.render(f5); - BackAntennae.render(f5); - FrontAntennae.render(f5); - TopBasePanel.render(f5); - ChargePack.render(f5); - WireLeftBottomPole.render(f5); - WireLeftTopPole.render(f5); - WireRightBottomPole.render(f5); - WireRightTopPole.render(f5); - BackRightConnector.render(f5); - BackLeftConnector.render(f5); - FrontLeftConnector.render(f5); - FrontRightConnector.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/electrical/tesla/ModelTeslaMiddle.java b/archive/java/resonantinduction/electrical/tesla/ModelTeslaMiddle.java deleted file mode 100644 index 490915c6..00000000 --- a/archive/java/resonantinduction/electrical/tesla/ModelTeslaMiddle.java +++ /dev/null @@ -1,215 +0,0 @@ -package resonantinduction.electrical.tesla; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelTeslaMiddle extends ModelBase -{ - // fields - ModelRenderer Base; - ModelRenderer Collumn1; - ModelRenderer Collumn2; - ModelRenderer CrossCollumn1; - ModelRenderer Collumn3; - ModelRenderer Ball; - ModelRenderer Plate; - ModelRenderer TopBase; - ModelRenderer FrontPole; - ModelRenderer SidePole; - ModelRenderer FrontAntennae; - ModelRenderer BackAntennae; - ModelRenderer LeftAntennae; - ModelRenderer RightAntennae; - ModelRenderer CrossCollumn2; - ModelRenderer CrossCollumn3; - ModelRenderer Collumn4; - ModelRenderer CrossCollumn4; - ModelRenderer BallStand; - ModelRenderer FrontTopLeftPole; - ModelRenderer FrontTopRightPole; - ModelRenderer SideTopFirstPole; - ModelRenderer SodeTopLastPole; - - public ModelTeslaMiddle() - { - textureWidth = 128; - textureHeight = 128; - - Base = new ModelRenderer(this, 0, 0); - Base.addBox(0F, 0F, 0F, 6, 6, 6); - Base.setRotationPoint(-3F, 18F, -3F); - Base.setTextureSize(128, 128); - Base.mirror = true; - setRotation(Base, 0F, 0F, 0F); - Collumn1 = new ModelRenderer(this, 0, 20); - Collumn1.addBox(0F, 0F, 0F, 1, 4, 1); - Collumn1.setRotationPoint(-3F, 14F, -3F); - Collumn1.setTextureSize(128, 128); - Collumn1.mirror = true; - setRotation(Collumn1, 0F, 0F, 0F); - Collumn2 = new ModelRenderer(this, 0, 20); - Collumn2.addBox(0F, 0F, 0F, 1, 4, 1); - Collumn2.setRotationPoint(2F, 14F, -3F); - Collumn2.setTextureSize(128, 128); - Collumn2.mirror = true; - setRotation(Collumn2, 0F, 0F, 0F); - CrossCollumn1 = new ModelRenderer(this, 5, 20); - CrossCollumn1.addBox(0F, 0F, 0F, 4, 1, 1); - CrossCollumn1.setRotationPoint(-2F, 15.5F, -3F); - CrossCollumn1.setTextureSize(128, 128); - CrossCollumn1.mirror = true; - setRotation(CrossCollumn1, 0F, 0F, 0F); - Collumn3 = new ModelRenderer(this, 0, 20); - Collumn3.addBox(0F, 0F, 0F, 1, 4, 1); - Collumn3.setRotationPoint(2F, 14F, 2F); - Collumn3.setTextureSize(128, 128); - Collumn3.mirror = true; - setRotation(Collumn3, 0F, 0F, 0F); - Ball = new ModelRenderer(this, 0, 15); - Ball.addBox(-1F, -1F, -1F, 2, 2, 2); - Ball.setRotationPoint(0F, 16F, 0F); - Ball.setTextureSize(128, 128); - Ball.mirror = true; - setRotation(Ball, 0F, 0F, 0F); - Plate = new ModelRenderer(this, 25, 0); - Plate.addBox(0F, 0F, 0F, 7, 1, 7); - Plate.setRotationPoint(-3.5F, 13F, -3.5F); - Plate.setTextureSize(128, 128); - Plate.mirror = true; - setRotation(Plate, 0F, 0F, 0F); - TopBase = new ModelRenderer(this, 25, 9); - TopBase.addBox(0F, 0F, 0F, 4, 5, 4); - TopBase.setRotationPoint(-2F, 8F, -2F); - TopBase.setTextureSize(128, 128); - TopBase.mirror = true; - setRotation(TopBase, 0F, 0F, 0F); - FrontPole = new ModelRenderer(this, 0, 26); - FrontPole.addBox(0F, 0F, 0F, 2, 2, 8); - FrontPole.setRotationPoint(-1F, 20F, -4F); - FrontPole.setTextureSize(128, 128); - FrontPole.mirror = true; - setRotation(FrontPole, 0F, 0F, 0F); - SidePole = new ModelRenderer(this, 0, 37); - SidePole.addBox(0F, 0F, 0F, 8, 2, 2); - SidePole.setRotationPoint(-4F, 20F, -1F); - SidePole.setTextureSize(128, 128); - SidePole.mirror = true; - setRotation(SidePole, 0F, 0F, 0F); - FrontAntennae = new ModelRenderer(this, 25, 19); - FrontAntennae.addBox(0F, 0F, 0F, 1, 3, 1); - FrontAntennae.setRotationPoint(-0.5F, 18.8F, -4.466667F); - FrontAntennae.setTextureSize(128, 128); - FrontAntennae.mirror = true; - setRotation(FrontAntennae, 0F, 0F, 0F); - BackAntennae = new ModelRenderer(this, 25, 19); - BackAntennae.addBox(0F, 0F, 0F, 1, 3, 1); - BackAntennae.setRotationPoint(-0.5F, 18.8F, 3.533333F); - BackAntennae.setTextureSize(128, 128); - BackAntennae.mirror = true; - setRotation(BackAntennae, 0F, 0F, 0F); - LeftAntennae = new ModelRenderer(this, 25, 19); - LeftAntennae.addBox(0F, 0F, 0F, 1, 3, 1); - LeftAntennae.setRotationPoint(-4.5F, 18.8F, -0.5F); - LeftAntennae.setTextureSize(128, 128); - LeftAntennae.mirror = true; - setRotation(LeftAntennae, 0F, 0F, 0F); - RightAntennae = new ModelRenderer(this, 25, 19); - RightAntennae.addBox(0F, 0F, 0F, 1, 3, 1); - RightAntennae.setRotationPoint(3.5F, 18.8F, -0.5F); - RightAntennae.setTextureSize(128, 128); - RightAntennae.mirror = true; - setRotation(RightAntennae, 0F, 0F, 0F); - CrossCollumn2 = new ModelRenderer(this, 30, 19); - CrossCollumn2.addBox(0F, 0F, 0F, 1, 1, 4); - CrossCollumn2.setRotationPoint(2F, 15.5F, -2F); - CrossCollumn2.setTextureSize(128, 128); - CrossCollumn2.mirror = true; - setRotation(CrossCollumn2, 0F, 0F, 0F); - CrossCollumn3 = new ModelRenderer(this, 5, 20); - CrossCollumn3.addBox(0F, 0F, 0F, 4, 1, 1); - CrossCollumn3.setRotationPoint(-2F, 15.5F, 2F); - CrossCollumn3.setTextureSize(128, 128); - CrossCollumn3.mirror = true; - setRotation(CrossCollumn3, 0F, 0F, 0F); - Collumn4 = new ModelRenderer(this, 0, 20); - Collumn4.addBox(0F, 0F, 0F, 1, 4, 1); - Collumn4.setRotationPoint(-3F, 14F, 2F); - Collumn4.setTextureSize(128, 128); - Collumn4.mirror = true; - setRotation(Collumn4, 0F, 0F, 0F); - CrossCollumn4 = new ModelRenderer(this, 30, 19); - CrossCollumn4.addBox(0F, 0F, 0F, 1, 1, 4); - CrossCollumn4.setRotationPoint(-3F, 15.5F, -2F); - CrossCollumn4.setTextureSize(128, 128); - CrossCollumn4.mirror = true; - setRotation(CrossCollumn4, 0F, 0F, 0F); - BallStand = new ModelRenderer(this, 9, 16); - BallStand.addBox(0F, 0F, 0F, 1, 1, 1); - BallStand.setRotationPoint(-0.5F, 17F, -0.5F); - BallStand.setTextureSize(128, 128); - BallStand.mirror = true; - setRotation(BallStand, 0F, 0F, 0F); - FrontTopLeftPole = new ModelRenderer(this, 42, 9); - FrontTopLeftPole.addBox(0F, 0F, 0F, 1, 4, 5); - FrontTopLeftPole.setRotationPoint(-1.5F, 9F, -2.5F); - FrontTopLeftPole.setTextureSize(128, 128); - FrontTopLeftPole.mirror = true; - setRotation(FrontTopLeftPole, 0F, 0F, 0F); - FrontTopRightPole = new ModelRenderer(this, 42, 9); - FrontTopRightPole.addBox(0F, 0F, 0F, 1, 4, 5); - FrontTopRightPole.setRotationPoint(0.5F, 9F, -2.5F); - FrontTopRightPole.setTextureSize(128, 128); - FrontTopRightPole.mirror = true; - setRotation(FrontTopRightPole, 0F, 0F, 0F); - SideTopFirstPole = new ModelRenderer(this, 42, 19); - SideTopFirstPole.addBox(0F, 0F, 0F, 5, 4, 1); - SideTopFirstPole.setRotationPoint(-2.5F, 9F, -1.5F); - SideTopFirstPole.setTextureSize(128, 128); - SideTopFirstPole.mirror = true; - setRotation(SideTopFirstPole, 0F, 0F, 0F); - SodeTopLastPole = new ModelRenderer(this, 42, 19); - SodeTopLastPole.addBox(0F, 0F, 0F, 5, 4, 1); - SodeTopLastPole.setRotationPoint(-2.5F, 9F, 0.5F); - SodeTopLastPole.setTextureSize(128, 128); - SodeTopLastPole.mirror = true; - setRotation(SodeTopLastPole, 0F, 0F, 0F); - } - - public void render(float f5) - { - Base.render(f5); - Collumn1.render(f5); - Collumn2.render(f5); - CrossCollumn1.render(f5); - Collumn3.render(f5); - Ball.render(f5); - Plate.render(f5); - TopBase.render(f5); - FrontPole.render(f5); - SidePole.render(f5); - FrontAntennae.render(f5); - BackAntennae.render(f5); - LeftAntennae.render(f5); - RightAntennae.render(f5); - CrossCollumn2.render(f5); - CrossCollumn3.render(f5); - Collumn4.render(f5); - CrossCollumn4.render(f5); - BallStand.render(f5); - FrontTopLeftPole.render(f5); - FrontTopRightPole.render(f5); - SideTopFirstPole.render(f5); - SodeTopLastPole.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/electrical/tesla/ModelTeslaTop.java b/archive/java/resonantinduction/electrical/tesla/ModelTeslaTop.java deleted file mode 100644 index 20bb1bcf..00000000 --- a/archive/java/resonantinduction/electrical/tesla/ModelTeslaTop.java +++ /dev/null @@ -1,204 +0,0 @@ -package resonantinduction.electrical.tesla; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelTeslaTop extends ModelBase -{ - // fields - ModelRenderer Base; - ModelRenderer Collumn1; - ModelRenderer Collumn2; - ModelRenderer Collumn3; - ModelRenderer Collumn4; - ModelRenderer CrossCollumn1; - ModelRenderer CrossCollumn2; - ModelRenderer CrossCollumn3; - ModelRenderer CrossCollumn4; - ModelRenderer CrossCollumn5; - ModelRenderer CrossCollumn6; - ModelRenderer CrossCollumn7; - ModelRenderer CrossCollumn8; - ModelRenderer HolderLeft; - ModelRenderer FrontCoil; - ModelRenderer RightCoil; - ModelRenderer BackCoil; - ModelRenderer LeftCoil; - ModelRenderer LFSCoil; - ModelRenderer RFSCoil; - ModelRenderer RBSCoil; - ModelRenderer LBSCoil; - - public ModelTeslaTop() - { - textureWidth = 128; - textureHeight = 128; - - Base = new ModelRenderer(this, 0, 0); - Base.addBox(0F, 0F, 0F, 4, 4, 4); - Base.setRotationPoint(-2F, 20F, -2F); - Base.setTextureSize(128, 128); - Base.mirror = true; - setRotation(Base, 0F, 0F, 0F); - Collumn1 = new ModelRenderer(this, 0, 9); - Collumn1.addBox(0F, 0F, 0F, 1, 6, 1); - Collumn1.setRotationPoint(1F, 14F, 1F); - Collumn1.setTextureSize(128, 128); - Collumn1.mirror = true; - setRotation(Collumn1, 0F, 0F, 0F); - Collumn2 = new ModelRenderer(this, 0, 9); - Collumn2.addBox(0F, 0F, 0F, 1, 6, 1); - Collumn2.setRotationPoint(1F, 14F, -2F); - Collumn2.setTextureSize(128, 128); - Collumn2.mirror = true; - setRotation(Collumn2, 0F, 0F, 0F); - Collumn3 = new ModelRenderer(this, 0, 9); - Collumn3.addBox(0F, 0F, 0F, 1, 6, 1); - Collumn3.setRotationPoint(-2F, 14F, -2F); - Collumn3.setTextureSize(128, 128); - Collumn3.mirror = true; - setRotation(Collumn3, 0F, 0F, 0F); - Collumn4 = new ModelRenderer(this, 0, 9); - Collumn4.addBox(0F, 0F, 0F, 1, 6, 1); - Collumn4.setRotationPoint(-2F, 14F, 1F); - Collumn4.setTextureSize(128, 128); - Collumn4.mirror = true; - setRotation(Collumn4, 0F, 0F, 0F); - CrossCollumn1 = new ModelRenderer(this, 17, 0); - CrossCollumn1.addBox(0F, 0F, 0F, 1, 1, 2); - CrossCollumn1.setRotationPoint(-2F, 16.5F, -1F); - CrossCollumn1.setTextureSize(128, 128); - CrossCollumn1.mirror = true; - setRotation(CrossCollumn1, 0F, 0F, 0F); - CrossCollumn2 = new ModelRenderer(this, 17, 0); - CrossCollumn2.addBox(0F, 0F, 0F, 2, 1, 1); - CrossCollumn2.setRotationPoint(-1F, 15.5F, -2F); - CrossCollumn2.setTextureSize(128, 128); - CrossCollumn2.mirror = true; - setRotation(CrossCollumn2, 0F, 0F, 0F); - CrossCollumn3 = new ModelRenderer(this, 17, 0); - CrossCollumn3.addBox(0F, 0F, 0F, 1, 1, 2); - CrossCollumn3.setRotationPoint(-2F, 14.5F, -1F); - CrossCollumn3.setTextureSize(128, 128); - CrossCollumn3.mirror = true; - setRotation(CrossCollumn3, 0F, 0F, 0F); - CrossCollumn4 = new ModelRenderer(this, 17, 0); - CrossCollumn4.addBox(0F, 0F, 0F, 1, 1, 2); - CrossCollumn4.setRotationPoint(1F, 14.5F, -1F); - CrossCollumn4.setTextureSize(128, 128); - CrossCollumn4.mirror = true; - setRotation(CrossCollumn4, 0F, 0F, 0F); - CrossCollumn5 = new ModelRenderer(this, 17, 0); - CrossCollumn5.addBox(0F, 0F, 0F, 1, 1, 2); - CrossCollumn5.setRotationPoint(1F, 16.5F, -1F); - CrossCollumn5.setTextureSize(128, 128); - CrossCollumn5.mirror = true; - setRotation(CrossCollumn5, 0F, 0F, 0F); - CrossCollumn6 = new ModelRenderer(this, 17, 0); - CrossCollumn6.addBox(0F, 0F, 0F, 2, 1, 1); - CrossCollumn6.setRotationPoint(-1F, 15.5F, 1F); - CrossCollumn6.setTextureSize(128, 128); - CrossCollumn6.mirror = true; - setRotation(CrossCollumn6, 0F, 0F, 0F); - CrossCollumn7 = new ModelRenderer(this, 17, 0); - CrossCollumn7.addBox(0F, 0F, 0F, 2, 1, 1); - CrossCollumn7.setRotationPoint(-1F, 17.5F, -2F); - CrossCollumn7.setTextureSize(128, 128); - CrossCollumn7.mirror = true; - setRotation(CrossCollumn7, 0F, 0F, 0F); - CrossCollumn8 = new ModelRenderer(this, 17, 0); - CrossCollumn8.addBox(0F, 0F, 0F, 2, 1, 1); - CrossCollumn8.setRotationPoint(-1F, 17.5F, 1F); - CrossCollumn8.setTextureSize(128, 128); - CrossCollumn8.mirror = true; - setRotation(CrossCollumn8, 0F, 0F, 0F); - HolderLeft = new ModelRenderer(this, 5, 9); - HolderLeft.addBox(0F, 0F, 0F, 2, 5, 2); - HolderLeft.setRotationPoint(-1F, 10.5F, -1F); - HolderLeft.setTextureSize(128, 128); - HolderLeft.mirror = true; - setRotation(HolderLeft, 0F, 0F, 0F); - FrontCoil = new ModelRenderer(this, 26, 0); - FrontCoil.addBox(0F, 0F, 0F, 6, 2, 1); - FrontCoil.setRotationPoint(-3F, 11F, -4F); - FrontCoil.setTextureSize(128, 128); - FrontCoil.mirror = true; - setRotation(FrontCoil, 0F, 0F, 0F); - RightCoil = new ModelRenderer(this, 26, 4); - RightCoil.addBox(0F, 0F, 0F, 1, 2, 6); - RightCoil.setRotationPoint(3F, 11.02222F, -3F); - RightCoil.setTextureSize(128, 128); - RightCoil.mirror = true; - setRotation(RightCoil, 0F, 0F, 0F); - BackCoil = new ModelRenderer(this, 26, 0); - BackCoil.addBox(0F, 0F, 0F, 6, 2, 1); - BackCoil.setRotationPoint(-3F, 11F, 3F); - BackCoil.setTextureSize(128, 128); - BackCoil.mirror = true; - setRotation(BackCoil, 0F, 0F, 0F); - LeftCoil = new ModelRenderer(this, 26, 4); - LeftCoil.addBox(0F, 0F, 0F, 1, 2, 6); - LeftCoil.setRotationPoint(-4F, 11.02222F, -3F); - LeftCoil.setTextureSize(128, 128); - LeftCoil.mirror = true; - setRotation(LeftCoil, 0F, 0F, 0F); - LFSCoil = new ModelRenderer(this, 0, 20); - LFSCoil.addBox(0F, 0F, 0F, 1, 2, 1); - LFSCoil.setRotationPoint(-3F, 11F, -3F); - LFSCoil.setTextureSize(128, 128); - LFSCoil.mirror = true; - setRotation(LFSCoil, 0F, 0F, 0F); - RFSCoil = new ModelRenderer(this, 0, 20); - RFSCoil.addBox(0F, 0F, 0F, 1, 2, 1); - RFSCoil.setRotationPoint(2F, 11F, -3F); - RFSCoil.setTextureSize(128, 128); - RFSCoil.mirror = true; - setRotation(RFSCoil, 0F, 0F, 0F); - RBSCoil = new ModelRenderer(this, 0, 20); - RBSCoil.addBox(0F, 0F, 0F, 1, 2, 1); - RBSCoil.setRotationPoint(2F, 11F, 2F); - RBSCoil.setTextureSize(128, 128); - RBSCoil.mirror = true; - setRotation(RBSCoil, 0F, 0F, 0F); - LBSCoil = new ModelRenderer(this, 0, 20); - LBSCoil.addBox(0F, 0F, 0F, 1, 2, 1); - LBSCoil.setRotationPoint(-3F, 11F, 2F); - LBSCoil.setTextureSize(128, 128); - LBSCoil.mirror = true; - setRotation(LBSCoil, 0F, 0F, 0F); - } - - public void render(float f5) - { - Base.render(f5); - Collumn1.render(f5); - Collumn2.render(f5); - Collumn3.render(f5); - Collumn4.render(f5); - CrossCollumn1.render(f5); - CrossCollumn2.render(f5); - CrossCollumn3.render(f5); - CrossCollumn4.render(f5); - CrossCollumn5.render(f5); - CrossCollumn6.render(f5); - CrossCollumn7.render(f5); - CrossCollumn8.render(f5); - HolderLeft.render(f5); - FrontCoil.render(f5); - RightCoil.render(f5); - BackCoil.render(f5); - LeftCoil.render(f5); - LFSCoil.render(f5); - RFSCoil.render(f5); - RBSCoil.render(f5); - LBSCoil.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/electrical/tesla/RenderTesla.java b/archive/java/resonantinduction/electrical/tesla/RenderTesla.java deleted file mode 100644 index af1c1ee3..00000000 --- a/archive/java/resonantinduction/electrical/tesla/RenderTesla.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.tesla; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -@SideOnly(Side.CLIENT) -public class RenderTesla extends TileEntitySpecialRenderer -{ - public static final ResourceLocation TEXTURE_BOTTOM = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_DIRECTORY + "tesla_bottom.png"); - public static final ResourceLocation TEXTURE_MIDDLE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_DIRECTORY + "tesla_middle.png"); - public static final ResourceLocation TEXTURE_TOP = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_DIRECTORY + "tesla_top.png"); - public static final ModelTeslaBottom MODEL_BOTTOM = new ModelTeslaBottom(); - public static final ModelTeslaMiddle MODEL_MIDDLE = new ModelTeslaMiddle(); - public static final ModelTeslaTop MODEL_TOP = new ModelTeslaTop(); - - @Override - public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) - { - GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - - switch (t.getBlockMetadata()) - { - default: - this.bindTexture(TEXTURE_BOTTOM); - MODEL_BOTTOM.render(0.0625f); - break; - case 1: - this.bindTexture(TEXTURE_MIDDLE); - MODEL_MIDDLE.render(0.0625f); - break; - case 2: - this.bindTexture(TEXTURE_TOP); - MODEL_TOP.render(0.0625f); - break; - } - - GL11.glPopMatrix(); - } - -} diff --git a/archive/java/resonantinduction/electrical/tesla/TeslaGrid.java b/archive/java/resonantinduction/electrical/tesla/TeslaGrid.java deleted file mode 100644 index 87de2a91..00000000 --- a/archive/java/resonantinduction/electrical/tesla/TeslaGrid.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.tesla; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; - -/** - * @author Calclavia - * - */ -public class TeslaGrid -{ - private static final TeslaGrid INSTANCE_CLIENT = new TeslaGrid(); - private static final TeslaGrid INSTANCE_SERVER = new TeslaGrid(); - - private final Set tileEntities = new HashSet(); - - public void register(ITesla iTesla) - { - Iterator it = this.tileEntities.iterator(); - - while (it.hasNext()) - { - ITesla tesla = it.next(); - - if (tesla instanceof TileEntity) - { - if (!((TileEntity) tesla).isInvalid()) - { - continue; - } - } - - it.remove(); - - } - - this.tileEntities.add(iTesla); - } - - public void unregister(ITesla iTesla) - { - this.tileEntities.remove(iTesla); - } - - public Set get() - { - return this.tileEntities; - } - - public static TeslaGrid instance() - { - if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) - { - return INSTANCE_SERVER; - } - - return INSTANCE_CLIENT; - } -} diff --git a/archive/java/resonantinduction/electrical/tesla/TileTesla.java b/archive/java/resonantinduction/electrical/tesla/TileTesla.java deleted file mode 100644 index a226ebc2..00000000 --- a/archive/java/resonantinduction/electrical/tesla/TileTesla.java +++ /dev/null @@ -1,655 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.tesla; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInduction; -import resonantinduction.core.Settings; -import resonantinduction.core.handler.ILinkable; -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.network.IPacketReceiver; -import calclavia.lib.network.IPacketSender; -import calclavia.lib.prefab.tile.TileElectrical; -import calclavia.lib.render.EnumColor; -import calclavia.lib.utility.LanguageUtility; -import codechicken.lib.colour.ColourRGBA; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.PacketDispatcher; - -/** - * The Tesla TileEntity. - * - * - Redstone (Prevent Output Toggle) - Right click (Prevent Input Toggle) - * - * @author Calclavia - * - */ -public class TileTesla extends TileElectrical implements ITesla, IPacketSender, IPacketReceiver, ILinkable -{ - public final static int DEFAULT_COLOR = 12; - public final long TRANSFER_CAP = 10000; - private int dyeID = DEFAULT_COLOR; - - private boolean canReceive = true; - private boolean attackEntities = true; - - /** Client side to do sparks */ - private boolean doTransfer = true; - - /** Prevents transfer loops */ - private final Set outputBlacklist = new HashSet(); - private final Set connectedTeslas = new HashSet(); - - /** - * Caching - */ - private TileTesla topCache = null; - private TileTesla controlCache = null; - - /** - * Quantum Tesla - */ - public Vector3 linked; - public int linkDim; - - /** - * Client - */ - private int zapCounter = 0; - private boolean isLinkedClient; - private boolean isTransfering; - - public TileTesla() - { - this.energy = new EnergyStorageHandler(TRANSFER_CAP); - this.saveIOMap = true; - } - - @Override - public void initiate() - { - super.initiate(); - TeslaGrid.instance().register(this); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - - boolean doPacketUpdate = this.energy.getEnergy() > 0; - - /** - * Only transfer if it is the bottom controlling Tesla tower. - */ - if (this.isController()) - { - // this.produce(); - - if (this.ticks % (4 + this.worldObj.rand.nextInt(2)) == 0 && ((this.worldObj.isRemote && isTransfering) || (this.energy.getEnergy() > 0 && !this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord)))) - { - final TileTesla topTesla = this.getTopTelsa(); - final Vector3 topTeslaVector = new Vector3(topTesla); - - /** - * Quantum transportation. - */ - if (this.linked != null || this.isLinkedClient) - { - if (!this.worldObj.isRemote) - { - World dimWorld = MinecraftServer.getServer().worldServerForDimension(this.linkDim); - - if (dimWorld != null) - { - TileEntity transferTile = this.linked.getTileEntity(dimWorld); - - if (transferTile instanceof TileTesla && !transferTile.isInvalid()) - { - this.transfer(((TileTesla) transferTile), Math.min(this.energy.getEmptySpace(), TRANSFER_CAP)); - - if (this.zapCounter % 5 == 0 && Settings.SOUND_FXS) - { - this.worldObj.playSoundEffect(this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, Reference.PREFIX + "electricshock", (float) this.energy.getEnergy() / (float) TRANSFER_CAP, 1.3f - 0.5f * (this.dyeID / 16f)); - } - } - } - } - else - { - Electrical.proxy.renderElectricShock(this.worldObj, topTeslaVector.clone().translate(0.5), topTeslaVector.clone().translate(new Vector3(0.5, Double.POSITIVE_INFINITY, 0.5)), false); - } - } - else - { - List transferTeslaCoils = new ArrayList(); - - for (ITesla tesla : TeslaGrid.instance().get()) - { - if (new Vector3((TileEntity) tesla).distance(new Vector3(this)) < this.getRange()) - { - /** - * Make sure Tesla is not part of this tower. - */ - if (!this.connectedTeslas.contains(tesla) && tesla.canTeslaTransfer(this)) - { - if (tesla instanceof TileTesla) - { - if (((TileTesla) tesla).getHeight() <= 1) - { - continue; - } - - tesla = ((TileTesla) tesla).getControllingTelsa(); - } - - transferTeslaCoils.add(tesla); - } - } - } - - /** - * Sort by distance. - */ - Collections.sort(transferTeslaCoils, new Comparator() - { - public int compare(ITesla o1, ITesla o2) - { - double distance1 = new Vector3(topTesla).distance(new Vector3((TileEntity) o1)); - double distance2 = new Vector3(topTesla).distance(new Vector3((TileEntity) o2)); - - if (distance1 < distance2) - { - return 1; - } - else if (distance1 > distance2) - { - return -1; - } - - return 0; - } - - @Override - public int compare(Object obj, Object obj1) - { - return compare((ITesla) obj, (ITesla) obj1); - } - }); - - if (transferTeslaCoils.size() > 0) - { - long transferEnergy = this.energy.getEnergy() / transferTeslaCoils.size(); - int count = 0; - boolean sentPacket = false; - for (ITesla tesla : transferTeslaCoils) - { - if (this.zapCounter % 5 == 0 && Settings.SOUND_FXS) - { - this.worldObj.playSoundEffect(this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, Reference.PREFIX + "electricshock", (float) this.energy.getEnergy() / (float) TRANSFER_CAP, 1.3f - 0.5f * (this.dyeID / 16f)); - } - - Vector3 targetVector = new Vector3((TileEntity) tesla); - - if (tesla instanceof TileTesla) - { - ((TileTesla) tesla).getControllingTelsa().outputBlacklist.add(this); - targetVector = new Vector3(((TileTesla) tesla).getTopTelsa()); - } - - double distance = topTeslaVector.distance(targetVector); - // TODO: Fix color. - Electrical.proxy.renderElectricShock(this.worldObj, new Vector3(topTesla).translate(new Vector3(0.5)), targetVector.translate(new Vector3(0.5)), EnumColor.DYES[this.dyeID].toColor()); - - this.transfer(tesla, Math.min(transferEnergy, TRANSFER_CAP)); - - if (!sentPacket && transferEnergy > 0) - { - this.sendPacket(3); - } - - if (this.attackEntities && this.zapCounter % 5 == 0) - { - MovingObjectPosition mop = topTeslaVector.clone().translate(0.5).rayTraceEntities(this.worldObj, targetVector.clone().translate(0.5)); - - if (mop != null && mop.entityHit != null) - { - if (mop.entityHit instanceof EntityLivingBase) - { - mop.entityHit.attackEntityFrom(CustomDamageSource.electrocution, 4); - Electrical.proxy.renderElectricShock(this.worldObj, new Vector3(topTesla).clone().translate(0.5), new Vector3(mop.entityHit)); - } - } - } - - if (count++ > 1) - { - break; - } - } - } - } - - this.zapCounter++; - this.outputBlacklist.clear(); - - this.doTransfer = false; - } - - if (!this.worldObj.isRemote && this.energy.didEnergyStateChange()) - { - this.sendPacket(2); - } - } - - this.clearCache(); - } - - private void transfer(ITesla tesla, long transferEnergy) - { - if (transferEnergy > 0) - { - tesla.teslaTransfer((long) (transferEnergy * (1 - (this.worldObj.rand.nextFloat() * 0.1f))), true); - this.teslaTransfer(-transferEnergy, true); - } - } - - @Override - public boolean canTeslaTransfer(TileEntity tileEntity) - { - return this.canReceive && !this.outputBlacklist.contains(tileEntity); - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return super.canConnect(direction) && this.isController(); - } - - public void sendPacket(int type) - { - PacketDispatcher.sendPacketToAllInDimension(ResonantInduction.PACKET_TILE.getPacket(this, this.getPacketData(type).toArray()), this.worldObj.provider.dimensionId); - } - - @Override - public Packet getDescriptionPacket() - { - return ResonantInduction.PACKET_TILE.getPacket(this, this.getPacketData(1).toArray()); - } - - /** - * 1 - Description Packet - * 2 - Energy Update - * 3 - Tesla Beam - */ - @Override - public ArrayList getPacketData(int type) - { - ArrayList data = new ArrayList(); - data.add((byte) type); - - switch (type) - { - case 1: - { - data.add(this.dyeID); - data.add(this.canReceive); - data.add(this.attackEntities); - data.add(this.linked != null); - break; - } - case 2: - { - data.add(this.energy.getEnergy() > 0); - break; - } - } - - return data; - } - - @Override - public void onReceivePacket(ByteArrayDataInput data, EntityPlayer player, Object... extra) - { - try - { - switch (data.readByte()) - { - case 1: - this.dyeID = data.readInt(); - this.canReceive = data.readBoolean(); - this.attackEntities = data.readBoolean(); - this.isLinkedClient = data.readBoolean(); - break; - case 2: - this.isTransfering = data.readBoolean(); - break; - case 3: - this.doTransfer = true; - } - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - private boolean isController() - { - return this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) == 0; - } - - private void clearCache() - { - this.topCache = null; - this.controlCache = null; - } - - @Override - public long teslaTransfer(long transferEnergy, boolean doTransfer) - { - if (isController() || this.getControllingTelsa() == this) - { - if (doTransfer) - { - this.energy.receiveEnergy(transferEnergy, true); - - if (this.energy.didEnergyStateChange()) - { - this.sendPacket(2); - } - } - - return transferEnergy; - } - else - { - if (this.energy.getEnergy() > 0) - { - transferEnergy += this.energy.getEnergy(); - this.energy.setEnergy(0); - } - - return this.getControllingTelsa().teslaTransfer(transferEnergy, doTransfer); - } - } - - public int getRange() - { - return Math.min(4 * (this.getHeight() - 1), 50); - } - - public void updatePositionStatus() - { - boolean isTop = new Vector3(this).translate(new Vector3(0, 1, 0)).getTileEntity(this.worldObj) instanceof TileTesla; - boolean isBottom = new Vector3(this).translate(new Vector3(0, -1, 0)).getTileEntity(this.worldObj) instanceof TileTesla; - - if (isTop && isBottom) - { - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, 1, 3); - } - else if (isBottom) - { - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, 2, 3); - } - else - { - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, 0, 3); - } - } - - /** - * Called only on bottom. - * - * @return The highest Tesla coil in this tower. - */ - public TileTesla getTopTelsa() - { - if (this.topCache != null) - { - return this.topCache; - } - - this.connectedTeslas.clear(); - Vector3 checkPosition = new Vector3(this); - TileTesla returnTile = this; - - while (true) - { - TileEntity t = checkPosition.getTileEntity(this.worldObj); - - if (t instanceof TileTesla) - { - this.connectedTeslas.add((TileTesla) t); - returnTile = (TileTesla) t; - } - else - { - break; - } - - checkPosition.y++; - } - - this.topCache = returnTile; - return returnTile; - } - - /** - * For non-controlling Tesla to use. - * - * @return - */ - public TileTesla getControllingTelsa() - { - if (this.controlCache != null) - { - return this.controlCache; - } - - Vector3 checkPosition = new Vector3(this); - TileTesla returnTile = this; - - while (true) - { - TileEntity t = checkPosition.getTileEntity(this.worldObj); - - if (t instanceof TileTesla) - { - returnTile = (TileTesla) t; - } - else - { - break; - } - - checkPosition.y--; - } - - this.controlCache = returnTile; - return returnTile; - } - - /** - * Called only on bottom. - * - * @return The highest Tesla coil in this tower. - */ - public int getHeight() - { - this.connectedTeslas.clear(); - int y = 0; - - while (true) - { - TileEntity t = new Vector3(this).translate(new Vector3(0, y, 0)).getTileEntity(this.worldObj); - - if (t instanceof TileTesla) - { - this.connectedTeslas.add((TileTesla) t); - y++; - } - else - { - break; - } - - } - - return y; - } - - @Override - public void invalidate() - { - TeslaGrid.instance().unregister(this); - super.invalidate(); - } - - public void setDye(int id) - { - this.dyeID = id; - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - public boolean toggleReceive() - { - return this.canReceive = !this.canReceive; - } - - public boolean toggleEntityAttack() - { - boolean returnBool = this.attackEntities = !this.attackEntities; - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - return returnBool; - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.dyeID = nbt.getInteger("dyeID"); - this.canReceive = nbt.getBoolean("canReceive"); - this.attackEntities = nbt.getBoolean("attackEntities"); - - if (nbt.hasKey("link_x") && nbt.hasKey("link_y") && nbt.hasKey("link_z")) - { - this.linked = new Vector3(nbt.getInteger("link_x"), nbt.getInteger("link_y"), nbt.getInteger("link_z")); - this.linkDim = nbt.getInteger("linkDim"); - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("dyeID", this.dyeID); - nbt.setBoolean("canReceive", this.canReceive); - nbt.setBoolean("attackEntities", this.attackEntities); - - if (this.linked != null) - { - nbt.setInteger("link_x", (int) this.linked.x); - nbt.setInteger("link_y", (int) this.linked.y); - nbt.setInteger("link_z", (int) this.linked.z); - nbt.setInteger("linkDim", this.linkDim); - } - } - - public void setLink(Vector3 vector3, int dimID, boolean setOpponent) - { - if (!this.worldObj.isRemote) - { - World otherWorld = MinecraftServer.getServer().worldServerForDimension(this.linkDim); - - if (setOpponent && this.linked != null && otherWorld != null) - { - TileEntity tileEntity = this.linked.getTileEntity(otherWorld); - - if (tileEntity instanceof TileTesla) - { - ((TileTesla) tileEntity).setLink(null, this.linkDim, false); - } - } - - this.linked = vector3; - this.linkDim = dimID; - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - - World newOtherWorld = MinecraftServer.getServer().worldServerForDimension(this.linkDim); - - if (setOpponent && newOtherWorld != null && this.linked != null) - { - TileEntity tileEntity = this.linked.getTileEntity(newOtherWorld); - - if (tileEntity instanceof TileTesla) - { - ((TileTesla) tileEntity).setLink(new Vector3(this), this.worldObj.provider.dimensionId, false); - } - } - } - } - - @Override - public boolean onLink(EntityPlayer player, VectorWorld vector) - { - if (linked == null) - { - if (vector != null) - { - if (!worldObj.isRemote) - { - World otherWorld = vector.world; - - if (vector.getTileEntity(otherWorld) instanceof TileTesla) - { - this.setLink(new Vector3(((TileTesla) vector.getTileEntity(otherWorld)).getTopTelsa()), vector.world.provider.dimensionId, true); - player.addChatMessage(LanguageUtility.getLocal("message.tesla.pair").replace("%v0", this.getBlockType().getLocalizedName()).replace("%v1", vector.x + "").replace("%v2", vector.y + "").replace("%v3", vector.z + "")); - worldObj.playSoundEffect(this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, "ambient.weather.thunder", 5, 1); - return true; - } - } - } - } - else - { - this.setLink(null, worldObj.provider.dimensionId, true); - - if (!worldObj.isRemote) - { - player.addChatMessage("Unlinked Tesla."); - } - } - - return false; - } -} diff --git a/archive/java/resonantinduction/electrical/transformer/ItemTransformer.java b/archive/java/resonantinduction/electrical/transformer/ItemTransformer.java deleted file mode 100644 index a1cffce0..00000000 --- a/archive/java/resonantinduction/electrical/transformer/ItemTransformer.java +++ /dev/null @@ -1,35 +0,0 @@ -package resonantinduction.electrical.transformer; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import resonantinduction.core.prefab.part.ItemMultipartBase; -import resonantinduction.electrical.wire.EnumWireMaterial; -import codechicken.lib.vec.BlockCoord; -import codechicken.lib.vec.Vector3; -import codechicken.multipart.MultiPartRegistry; -import codechicken.multipart.TMultiPart; - -public class ItemTransformer extends ItemMultipartBase -{ - private Icon[] icons = new Icon[EnumWireMaterial.values().length]; - - public ItemTransformer(int id) - { - super("transformer", id); - } - - @Override - public TMultiPart newPart(ItemStack itemStack, EntityPlayer player, World world, BlockCoord pos, int side, Vector3 hit) - { - PartTransformer part = (PartTransformer) MultiPartRegistry.createPart("resonant_induction_transformer", false); - - if (part != null) - { - part.preparePlacement(side, itemStack.getItemDamage()); - } - - return part; - } -} diff --git a/archive/java/resonantinduction/electrical/transformer/ModelTransformer.java b/archive/java/resonantinduction/electrical/transformer/ModelTransformer.java deleted file mode 100644 index 4c227cfe..00000000 --- a/archive/java/resonantinduction/electrical/transformer/ModelTransformer.java +++ /dev/null @@ -1,150 +0,0 @@ -package resonantinduction.electrical.transformer; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelTransformer extends ModelBase -{ - // fields - ModelRenderer a; - ModelRenderer b; - ModelRenderer c; - ModelRenderer d; - ModelRenderer out2; - ModelRenderer out1; - ModelRenderer out3; - ModelRenderer out4; - ModelRenderer i; - ModelRenderer j; - ModelRenderer in1; - ModelRenderer in2; - ModelRenderer in3; - ModelRenderer in4; - - public ModelTransformer() - { - textureWidth = 70; - textureHeight = 45; - - a = new ModelRenderer(this, 0, 0); - a.addBox(-8F, 0F, -8F, 16, 2, 16); - a.setRotationPoint(0F, 22F, 0F); - a.setTextureSize(70, 45); - a.mirror = true; - setRotation(a, 0F, 0F, 0F); - b = new ModelRenderer(this, 0, 19); - b.addBox(0F, 0F, -2F, 3, 11, 4); - b.setRotationPoint(5F, 11F, 0F); - b.setTextureSize(70, 45); - b.mirror = true; - setRotation(b, 0F, 0F, 0F); - c = new ModelRenderer(this, 0, 19); - c.addBox(0F, 0F, -2F, 3, 11, 4); - c.setRotationPoint(-8F, 11F, 0F); - c.setTextureSize(70, 45); - c.mirror = true; - setRotation(c, 0F, 0F, 0F); - d = new ModelRenderer(this, 15, 19); - d.addBox(0F, 0F, -2F, 16, 1, 4); - d.setRotationPoint(-8F, 10F, 0F); - d.setTextureSize(70, 45); - d.mirror = true; - setRotation(d, 0F, 0F, 0F); - out2 = new ModelRenderer(this, 0, 35); - out2.addBox(0F, 0F, -3F, 5, 0, 6); - out2.setRotationPoint(-9F, 16F, 0F); - out2.setTextureSize(70, 45); - out2.mirror = true; - setRotation(out2, 0F, 0F, 0F); - out1 = new ModelRenderer(this, 0, 35); - out1.addBox(0F, 0F, -3F, 5, 0, 6); - out1.setRotationPoint(-9F, 15F, 0F); - out1.setTextureSize(70, 45); - out1.mirror = true; - setRotation(out1, 0F, 0F, 0F); - out3 = new ModelRenderer(this, 0, 35); - out3.addBox(0F, 0F, -3F, 5, 0, 6); - out3.setRotationPoint(-9F, 17F, 0F); - out3.setTextureSize(70, 45); - out3.mirror = true; - setRotation(out3, 0F, 0F, 0F); - out4 = new ModelRenderer(this, 0, 35); - out4.addBox(0F, 0F, -3F, 5, 0, 6); - out4.setRotationPoint(-9F, 18F, 0F); - out4.setTextureSize(70, 45); - out4.mirror = true; - setRotation(out4, 0F, 0F, 0F); - i = new ModelRenderer(this, 34, 35); - i.addBox(0F, 0F, -1F, 2, 5, 2); - i.setRotationPoint(-10F, 14F, 0F); - i.setTextureSize(70, 45); - i.mirror = true; - setRotation(i, 0F, 0F, 0F); - j = new ModelRenderer(this, 24, 35); - j.addBox(0F, 0F, -1F, 2, 5, 2); - j.setRotationPoint(8F, 14F, 0F); - j.setTextureSize(70, 45); - j.mirror = true; - setRotation(j, 0F, 0F, 0F); - in1 = new ModelRenderer(this, 0, 35); - in1.addBox(0F, 0F, -3F, 5, 0, 6); - in1.setRotationPoint(4F, 15F, 0F); - in1.setTextureSize(70, 45); - in1.mirror = true; - setRotation(in1, 0F, 0F, 0F); - in2 = new ModelRenderer(this, 0, 35); - in2.addBox(0F, 0F, -3F, 5, 0, 6); - in2.setRotationPoint(4F, 16F, 0F); - in2.setTextureSize(70, 45); - in2.mirror = true; - setRotation(in2, 0F, 0F, 0F); - in3 = new ModelRenderer(this, 0, 35); - in3.addBox(0F, 0F, -3F, 5, 0, 6); - in3.setRotationPoint(4F, 17F, 0F); - in3.setTextureSize(70, 45); - in3.mirror = true; - setRotation(in3, 0F, 0F, 0F); - in4 = new ModelRenderer(this, 0, 35); - in4.addBox(0F, 0F, -3F, 5, 0, 6); - in4.setRotationPoint(4F, 18F, 0F); - in4.setTextureSize(70, 45); - in4.mirror = true; - setRotation(in4, 0F, 0F, 0F); - } - - public void render(float f5) - { - a.render(f5); - b.render(f5); - c.render(f5); - d.render(f5); - out2.render(f5); - out1.render(f5); - out3.render(f5); - out4.render(f5); - i.render(f5); - j.render(f5); - in1.render(f5); - in2.render(f5); - in3.render(f5); - in4.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/electrical/transformer/PartTransformer.java b/archive/java/resonantinduction/electrical/transformer/PartTransformer.java deleted file mode 100644 index 9b887bcd..00000000 --- a/archive/java/resonantinduction/electrical/transformer/PartTransformer.java +++ /dev/null @@ -1,377 +0,0 @@ -package resonantinduction.electrical.transformer; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.electrical.Electrical; -import universalelectricity.api.electricity.IElectricalNetwork; -import universalelectricity.api.electricity.IVoltageInput; -import universalelectricity.api.electricity.IVoltageOutput; -import universalelectricity.api.energy.IConductor; -import universalelectricity.api.energy.IEnergyInterface; -import universalelectricity.api.vector.VectorHelper; -import codechicken.lib.data.MCDataInput; -import codechicken.lib.data.MCDataOutput; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Rotation; -import codechicken.lib.vec.Transformation; -import codechicken.lib.vec.Vector3; -import codechicken.microblock.FaceMicroClass; -import codechicken.multipart.JCuboidPart; -import codechicken.multipart.JNormalOcclusion; -import codechicken.multipart.TFacePart; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PartTransformer extends JCuboidPart implements JNormalOcclusion, TFacePart, IVoltageOutput, IEnergyInterface -{ - public static Cuboid6[][] oBoxes = new Cuboid6[6][2]; - - static - { - oBoxes[0][0] = new Cuboid6(1 / 8D, 0, 0, 7 / 8D, 1 / 8D, 1); - oBoxes[0][1] = new Cuboid6(0, 0, 1 / 8D, 1, 1 / 8D, 7 / 8D); - for (int s = 1; s < 6; s++) - { - Transformation t = Rotation.sideRotations[s].at(Vector3.center); - oBoxes[s][0] = oBoxes[0][0].copy().apply(t); - oBoxes[s][1] = oBoxes[0][1].copy().apply(t); - } - } - /** Side of the block this is placed on */ - public ForgeDirection placementSide; - /** Direction this block faces */ - public byte face = 0; - /** Step the voltage up */ - private boolean stepUp; - /** Amount to mulitply the step by (up x2. down /2) */ - public int multiplier = 2; - - public void preparePlacement(int side, int itemDamage) - { - this.placementSide = ForgeDirection.getOrientation((byte) (side ^ 1)); - } - - @Override - public void readDesc(MCDataInput packet) - { - this.placementSide = ForgeDirection.getOrientation(packet.readByte()); - this.face = packet.readByte(); - } - - @Override - public void writeDesc(MCDataOutput packet) - { - packet.writeByte(this.placementSide.ordinal()); - packet.writeByte(this.face); - } - - public boolean stepUp() - { - return this.stepUp; - } - - @Override - public int getSlotMask() - { - return 1 << this.placementSide.ordinal(); - } - - @Override - public Cuboid6 getBounds() - { - return FaceMicroClass.aBounds()[0x10 | this.placementSide.ordinal()]; - } - - @Override - public int redstoneConductionMap() - { - return 0; - } - - @Override - public boolean solid(int arg0) - { - return true; - } - - @Override - public Iterable getOcclusionBoxes() - { - return Arrays.asList(oBoxes[this.placementSide.ordinal()]); - } - - protected ItemStack getItem() - { - return new ItemStack(Electrical.itemTransformer); - } - - @Override - public Iterable getDrops() - { - List drops = new ArrayList(); - drops.add(getItem()); - return drops; - } - - @Override - public ItemStack pickItem(MovingObjectPosition hit) - { - return getItem(); - } - - @Override - @SideOnly(Side.CLIENT) - public void renderDynamic(Vector3 pos, float frame, int pass) - { - if (pass == 0) - { - RenderTransformer.render(this, pos.x, pos.y, pos.z); - } - } - - @Override - public void load(NBTTagCompound nbt) - { - super.load(nbt); - this.placementSide = ForgeDirection.getOrientation(nbt.getByte("side")); - this.stepUp = nbt.getBoolean("stepUp"); - } - - @Override - public void save(NBTTagCompound nbt) - { - super.save(nbt); - nbt.setByte("side", (byte) this.placementSide.ordinal()); - nbt.setBoolean("stepUp", this.stepUp); - } - - @Override - public String getType() - { - return "resonant_induction_transformer"; - } - - protected ForgeDirection getFacing() - { - if (this.placementSide != ForgeDirection.UP && this.placementSide != ForgeDirection.DOWN) - { - switch (this.face) - { - case 0: - return ForgeDirection.UP; - case 1: - switch (this.placementSide) - { - case NORTH: - return ForgeDirection.EAST; - case SOUTH: - return ForgeDirection.WEST; - case EAST: - return ForgeDirection.SOUTH; - case WEST: - return ForgeDirection.NORTH; - } - case 2: - return ForgeDirection.DOWN; - case 3: - switch (this.placementSide) - { - case NORTH: - return ForgeDirection.WEST; - case SOUTH: - return ForgeDirection.EAST; - case EAST: - return ForgeDirection.NORTH; - case WEST: - return ForgeDirection.SOUTH; - } - } - } - else - { - switch (this.face) - { - case 0: - return ForgeDirection.NORTH; - case 1: - return ForgeDirection.EAST; - case 2: - return ForgeDirection.SOUTH; - case 3: - return ForgeDirection.WEST; - } - } - return ForgeDirection.NORTH; - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return direction == getFacing() || direction == getFacing().getOpposite(); - } - - @Override - public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) - { - if (from == this.getFacing().getOpposite()) - { - TileEntity entity = VectorHelper.getTileEntityFromSide(this.world(), new universalelectricity.api.vector.Vector3(this.x(), this.y(), this.z()), this.getFacing()); - if (entity instanceof IEnergyInterface) - { - if (entity instanceof IVoltageInput) - { - long voltage = this.getVoltageOutput(from.getOpposite()); - if (voltage != ((IVoltageInput) entity).getVoltageInput(from)) - { - ((IVoltageInput) entity).onWrongVoltage(from, voltage); - } - } - return ((IEnergyInterface) entity).onReceiveEnergy(from, receive, doReceive); - } - - } - return 0; - } - - @Override - public long onExtractEnergy(ForgeDirection from, long extract, boolean doExtract) - { - return 0; - } - - @Override - public long getVoltageOutput(ForgeDirection side) - { - if (side == this.getFacing()) - { - TileEntity entity = VectorHelper.getTileEntityFromSide(this.world(), new universalelectricity.api.vector.Vector3(this.x(), this.y(), this.z()), this.getFacing().getOpposite()); - if (entity instanceof IConductor && ((IConductor) entity).getNetwork() instanceof IElectricalNetwork) - { - long voltage = ((IElectricalNetwork) ((IConductor) entity).getNetwork()).getVoltage(); - if (this.stepUp()) - { - return voltage * this.multiplier; - } - else if (voltage > 0) - { - return voltage / this.multiplier; - } - } - else if (entity instanceof IVoltageOutput) - { - return ((IVoltageOutput) entity).getVoltageOutput(side); - } - } - return 0; - } - - @Override - public boolean activate(EntityPlayer player, MovingObjectPosition hit, ItemStack item) - { - - if (this.isUsableWrench(player, player.inventory.getCurrentItem(), x(), y(), z())) - { - if (this.world().isRemote) - { - return true; - } - this.damageWrench(player, player.inventory.getCurrentItem(), x(), y(), z()); - if (this.face < 3) - this.face++; - else - this.face = 0; - this.sendDescUpdate(); - - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - tile().notifyNeighborChange(dir.ordinal()); - } - return true; - } - return false; - } - - public boolean isUsableWrench(EntityPlayer entityPlayer, ItemStack itemStack, int x, int y, int z) - { - if (entityPlayer != null && itemStack != null) - { - Class wrenchClass = itemStack.getItem().getClass(); - - /** UE and Buildcraft */ - try - { - Method methodCanWrench = wrenchClass.getMethod("canWrench", EntityPlayer.class, Integer.TYPE, Integer.TYPE, Integer.TYPE); - return (Boolean) methodCanWrench.invoke(itemStack.getItem(), entityPlayer, x, y, z); - } - catch (NoClassDefFoundError e) - { - } - catch (Exception e) - { - } - - /** Industrialcraft */ - try - { - if (wrenchClass == Class.forName("ic2.core.item.tool.ItemToolWrench") || wrenchClass == Class.forName("ic2.core.item.tool.ItemToolWrenchElectric")) - { - return itemStack.getItemDamage() < itemStack.getMaxDamage(); - } - } - catch (Exception e) - { - } - } - - return false; - } - - /** - * This function damages a wrench. Works with Buildcraft and Industrialcraft wrenches. - * - * @return True if damage was successfull. - */ - public boolean damageWrench(EntityPlayer entityPlayer, ItemStack itemStack, int x, int y, int z) - { - if (this.isUsableWrench(entityPlayer, itemStack, x, y, z)) - { - Class wrenchClass = itemStack.getItem().getClass(); - - /** UE and Buildcraft */ - try - { - Method methodWrenchUsed = wrenchClass.getMethod("wrenchUsed", EntityPlayer.class, Integer.TYPE, Integer.TYPE, Integer.TYPE); - methodWrenchUsed.invoke(itemStack.getItem(), entityPlayer, x, y, z); - return true; - } - catch (Exception e) - { - } - - /** Industrialcraft */ - try - { - if (wrenchClass == Class.forName("ic2.core.item.tool.ItemToolWrench") || wrenchClass == Class.forName("ic2.core.item.tool.ItemToolWrenchElectric")) - { - Method methodWrenchDamage = wrenchClass.getMethod("damage", ItemStack.class, Integer.TYPE, EntityPlayer.class); - methodWrenchDamage.invoke(itemStack.getItem(), itemStack, 1, entityPlayer); - return true; - } - } - catch (Exception e) - { - } - } - - return false; - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/electrical/transformer/RenderTransformer.java b/archive/java/resonantinduction/electrical/transformer/RenderTransformer.java deleted file mode 100644 index 3d388486..00000000 --- a/archive/java/resonantinduction/electrical/transformer/RenderTransformer.java +++ /dev/null @@ -1,159 +0,0 @@ -package resonantinduction.electrical.transformer; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.render.CalclaviaRenderHelper; -import calclavia.lib.utility.LanguageUtility; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderTransformer -{ - public static final ModelTransformer MODEL = new ModelTransformer(); - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_DIRECTORY + "transformer.png"); - - public static void render(PartTransformer part, double x, double y, double z) - { - String status = LanguageUtility.getLocal((part.stepUp() ? "tooltip.transformer.stepUp" : "tooltip.transformer.stepDown")); - - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - MovingObjectPosition movingPosition = player.rayTrace(5, 1f); - - if (movingPosition != null) - { - if (new Vector3(part.x(), part.y(), part.z()).equals(new Vector3(movingPosition))) - { - CalclaviaRenderHelper.renderFloatingText(status, (float) (x + 0.5), (float) (y - 1), (float) (z + 0.5)); - } - } - - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - - switch (part.placementSide) - { - case DOWN: - - switch (part.face) - { - case 0: - GL11.glRotatef(90, 0, 1, 0); - break; - case 1: - GL11.glRotatef(180, 0, 1, 0); - break; - case 2: - GL11.glRotatef(-90, 0, 1, 0); - break; - case 3: - break; - } - break; - case UP: - GL11.glRotatef(180, 0, 0, 1); - GL11.glTranslatef(0, -2, 0); - switch (part.face) - { - case 0: - GL11.glRotatef(90, 0, 1, 0); - break; - case 1: - GL11.glRotatef(180, 0, 1, 0); - break; - case 2: - GL11.glRotatef(-90, 0, 1, 0); - break; - case 3: - break; - } - break; - case NORTH: - GL11.glRotatef(90, 1, 0, 0); - GL11.glTranslatef(0, -1, -1); - switch (part.face) - { - case 0: - GL11.glRotatef(90, 0, 1, 0); - break; - case 1: - GL11.glRotatef(180, 0, 1, 0); - break; - case 2: - GL11.glRotatef(-90, 0, 1, 0); - break; - case 3: - break; - } - break; - case SOUTH: - GL11.glRotatef(-90, 1, 0, 0); - GL11.glTranslatef(0, -1, 1); - switch (part.face) - { - case 0: - GL11.glRotatef(-90, 0, 1, 0); - break; - case 1: - break; - case 2: - GL11.glRotatef(90, 0, 1, 0); - break; - case 3: - GL11.glRotatef(180, 0, 1, 0); - break; - - } - break; - case WEST: - GL11.glRotatef(90, 0, 0, 1); - GL11.glTranslatef(1, -1, 0); - switch (part.face) - { - case 0: - break; - case 1: - GL11.glRotatef(90, 0, 1, 0); - break; - case 2: - GL11.glRotatef(180, 0, 1, 0); - break; - case 3: - GL11.glRotatef(-90, 0, 1, 0); - break; - } - break; - case EAST: - GL11.glRotatef(-90, 0, 0, 1); - GL11.glTranslatef(-1, -1, 0); - switch (part.face) - { - case 0: - GL11.glRotatef(180, 0, 1, 0); - break; - case 1: - GL11.glRotatef(-90, 0, 1, 0); - break; - case 2: - break; - case 3: - GL11.glRotatef(90, 0, 1, 0); - break; - } - break; - } - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - MODEL.render(0.0625F); - GL11.glPopMatrix(); - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/electrical/wire/EnumWireMaterial.java b/archive/java/resonantinduction/electrical/wire/EnumWireMaterial.java deleted file mode 100644 index 6bfc57f4..00000000 --- a/archive/java/resonantinduction/electrical/wire/EnumWireMaterial.java +++ /dev/null @@ -1,85 +0,0 @@ -package resonantinduction.electrical.wire; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import codechicken.lib.colour.ColourRGBA; - -/** - * An enumerator for different wire materials. The metadata of the wire determines the type of the - * wire. - * - * @author Calclavia - * - */ - -public enum EnumWireMaterial -{ - /** Copper: General. */ - COPPER("Copper", 1.68f, 5, 150, 184, 115, 51), - /** Tin: Low shock, cheap */ - TIN("Tin", 11f, 1, 100, 132, 132, 130), - /** Iron: High Capacity */ - IRON("Iron", 10f, 3, 400, 97, 102, 105), - /** Aluminum: High Shock */ - ALUMINUM("Aluminum", 2.82f, 10, 320, 215, 205, 181), - /** Aluminum: Low Resistance */ - SILVER("Silver", 1.59f, 5, 200, 192, 192, 192), - /** Superconductor: Over-powered */ - SUPERCONDUCTOR("Superconductor", 0, 10, 600, 255, 255, 1); - - public final float resistance; - public final int damage; - public final long maxAmps; - public final ColourRGBA color; - private ItemStack wire; - private final String name; - - private EnumWireMaterial(String name, float resistance, int electrocutionDamage, long maxAmps, int r, int g, int b) - { - this.name = name; - /** Multiply the realistic resistance by a factor for game balance. */ - this.resistance = resistance; - this.damage = electrocutionDamage; - this.maxAmps = maxAmps; - this.color = new ColourRGBA(r, g, b, 255); - } - - public String getName() - { - return name; - } - - public ItemStack getWire() - { - return getWire(1); - } - - public ItemStack getWire(int amount) - { - ItemStack returnStack = wire.copy(); - returnStack.stackSize = amount; - - return returnStack; - } - - public void setWire(ItemStack item) - { - if (wire == null) - { - wire = item; - OreDictionary.registerOre(getName().toLowerCase() + "Wire", wire); - } - } - - public void setWire(Item item) - { - setWire(new ItemStack(item, 1, ordinal())); - } - - public void setWire(Block block) - { - setWire(new ItemStack(block, 1, ordinal())); - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/electrical/wire/ItemWire.java b/archive/java/resonantinduction/electrical/wire/ItemWire.java deleted file mode 100644 index 1b0ffa77..00000000 --- a/archive/java/resonantinduction/electrical/wire/ItemWire.java +++ /dev/null @@ -1,149 +0,0 @@ -package resonantinduction.electrical.wire; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.common.ForgeDirection; - -import org.lwjgl.input.Keyboard; - -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; -import resonantinduction.core.Utility; -import resonantinduction.electrical.wire.flat.PartFlatWire; -import resonantinduction.electrical.wire.flat.RenderFlatWire; -import resonantinduction.electrical.wire.framed.PartFramedWire; -import resonantinduction.electrical.wire.framed.RenderPartWire; -import universalelectricity.api.energy.UnitDisplay; -import universalelectricity.api.energy.UnitDisplay.Unit; -import calclavia.lib.render.EnumColor; -import calclavia.lib.utility.LanguageUtility; -import codechicken.lib.vec.BlockCoord; -import codechicken.lib.vec.Vector3; -import codechicken.multipart.ControlKeyModifer; -import codechicken.multipart.JItemMultiPart; -import codechicken.multipart.MultiPartRegistry; -import codechicken.multipart.TMultiPart; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -//TODO: AUTO COLOR WIRES! -public class ItemWire extends JItemMultiPart -{ - private Icon[] icons = new Icon[EnumWireMaterial.values().length]; - - public ItemWire(int id) - { - super(Settings.CONFIGURATION.get(Configuration.CATEGORY_ITEM, "wire", id).getInt(id)); - this.setUnlocalizedName(Reference.PREFIX + "wire"); - this.setCreativeTab(ResonantInductionTabs.CORE); - this.setHasSubtypes(true); - this.setMaxDamage(0); - } - - @Override - public TMultiPart newPart(ItemStack itemStack, EntityPlayer player, World world, BlockCoord pos, int side, Vector3 hit) - { - BlockCoord onPos = pos.copy().offset(side ^ 1); - - if (ControlKeyModifer.isControlDown(player)) - { - PartFramedWire wire = (PartFramedWire) MultiPartRegistry.createPart("resonant_induction_wire", false); - - if (wire != null) - { - wire.preparePlacement(itemStack.getItemDamage()); - } - - return wire; - } - else - { - if (!Utility.canPlaceWireOnSide(world, onPos.x, onPos.y, onPos.z, ForgeDirection.getOrientation(side), false)) - { - return null; - } - - PartFlatWire wire = (PartFlatWire) MultiPartRegistry.createPart("resonant_induction_flat_wire", false); - - if (wire != null) - { - wire.preparePlacement(side, itemStack.getItemDamage()); - } - - return wire; - } - } - - @Override - public int getMetadata(int damage) - { - return damage; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) - { - return super.getUnlocalizedName(itemStack) + "." + EnumWireMaterial.values()[itemStack.getItemDamage()].getName().toLowerCase(); - } - - @Override - @SuppressWarnings("unchecked") - public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) - { - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) - { - list.add(LanguageUtility.getLocal("tooltip.noShift").replace("%0", EnumColor.AQUA.toString()).replace("%1", EnumColor.GREY.toString())); - } - else - { - list.add(EnumColor.AQUA + LanguageUtility.getLocal("tooltip.wire.resistance").replace("%v", "" + EnumColor.ORANGE + UnitDisplay.getDisplay(EnumWireMaterial.values()[itemstack.getItemDamage()].resistance, Unit.RESISTANCE))); - list.add(EnumColor.AQUA + LanguageUtility.getLocal("tooltip.wire.current").replace("%v", "" + EnumColor.ORANGE + UnitDisplay.getDisplay(EnumWireMaterial.values()[itemstack.getItemDamage()].maxAmps, Unit.AMPERE))); - list.add(EnumColor.AQUA + LanguageUtility.getLocal("tooltip.wire.damage").replace("%v", "" + EnumColor.ORANGE + EnumWireMaterial.values()[itemstack.getItemDamage()].damage)); - list.addAll(LanguageUtility.splitStringPerWord(LanguageUtility.getLocal("tooltip.wire.helpText"), 5)); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getSpriteNumber() - { - return 0; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister register) - { - for (EnumWireMaterial material : EnumWireMaterial.values()) - { - icons[material.ordinal()] = register.registerIcon(Reference.PREFIX + "wire." + EnumWireMaterial.values()[material.ordinal()].getName().toLowerCase()); - } - - RenderFlatWire.flatWireTexture = register.registerIcon(Reference.PREFIX + "models/flatWire"); - RenderPartWire.wireIcon = register.registerIcon(Reference.PREFIX + "models/wire"); - RenderPartWire.insulationIcon = register.registerIcon(Reference.PREFIX + "models/insulation" + (Settings.LO_FI_INSULATION ? "tiny" : "")); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int meta) - { - return icons[meta]; - } - - @Override - public void getSubItems(int itemID, CreativeTabs tab, List listToAddTo) - { - for (EnumWireMaterial mat : EnumWireMaterial.values()) - { - listToAddTo.add(new ItemStack(itemID, 1, mat.ordinal())); - } - } -} diff --git a/archive/java/resonantinduction/electrical/wire/PartAdvancedWire.java b/archive/java/resonantinduction/electrical/wire/PartAdvancedWire.java deleted file mode 100644 index 00f0a35e..00000000 --- a/archive/java/resonantinduction/electrical/wire/PartAdvancedWire.java +++ /dev/null @@ -1,354 +0,0 @@ -package resonantinduction.electrical.wire; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockColored; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemShears; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.Utility; -import universalelectricity.api.CompatibilityModule; -import universalelectricity.api.energy.IConductor; -import calclavia.lib.CustomDamageSource; -import codechicken.lib.data.MCDataInput; -import codechicken.lib.data.MCDataOutput; -import codechicken.multipart.IRedstonePart; -import codechicken.multipart.TMultiPart; - -/** - * @author Calclavia - * - */ -public abstract class PartAdvancedWire extends PartConductor -{ - public static final int DEFAULT_COLOR = 15; - public int color = DEFAULT_COLOR; - - public EnumWireMaterial material = EnumWireMaterial.COPPER; - public boolean isInsulated = false; - - /** - * INTERNAL USE. - * Can this conductor connect with an external object? - */ - @Override - public boolean canConnectTo(Object obj) - { - if (obj != null && (obj.getClass().isAssignableFrom(this.getClass()) || this.getClass().isAssignableFrom(obj.getClass()))) - { - PartAdvancedWire wire = (PartAdvancedWire) obj; - - if (this.getMaterial() == wire.getMaterial()) - { - if (this.isInsulated() && wire.isInsulated()) - { - return this.getColor() == wire.getColor() || (this.getColor() == DEFAULT_COLOR || wire.getColor() == DEFAULT_COLOR); - } - - return true; - } - } - else if (!(obj instanceof IConductor)) - { - return CompatibilityModule.isHandler(obj); - } - - return false; - } - - protected boolean canConnectTo(Object obj, ForgeDirection dir) - { - if (obj != null && (obj.getClass().isAssignableFrom(this.getClass()) || this.getClass().isAssignableFrom(obj.getClass()))) - { - PartAdvancedWire wire = (PartAdvancedWire) obj; - - if (this.getMaterial() == wire.getMaterial()) - { - if (this.isInsulated() && wire.isInsulated()) - { - return this.getColor() == wire.getColor() || (this.getColor() == DEFAULT_COLOR || wire.getColor() == DEFAULT_COLOR); - } - - return true; - } - } - else if (!(obj instanceof IConductor)) - { - return CompatibilityModule.canConnect(obj, dir.getOpposite()); - } - - return false; - } - - @Override - public void onEntityCollision(Entity entity) - { - if (!this.isInsulated() && this.getNetwork().getLastBuffer() > 0) - { - entity.attackEntityFrom(CustomDamageSource.electrocution, this.getNetwork().getLastBuffer()); - } - } - - @Override - public float getResistance() - { - return this.getMaterial().resistance; - } - - @Override - public long getCurrentCapacity() - { - return this.getMaterial().maxAmps; - } - - /** - * Material Methods - */ - public EnumWireMaterial getMaterial() - { - return this.material; - } - - public void setMaterial(EnumWireMaterial material) - { - this.material = material; - } - - public void setMaterial(int id) - { - this.setMaterial(EnumWireMaterial.values()[id]); - } - - public int getMaterialID() - { - return this.material.ordinal(); - } - - /** - * Insulation Methods - */ - public void setInsulated(boolean insulated) - { - this.isInsulated = insulated; - this.color = DEFAULT_COLOR; - - if (!this.world().isRemote) - { - tile().notifyPartChange(this); - this.sendInsulationUpdate(); - } - } - - public void setInsulated(int dyeColour) - { - this.isInsulated = true; - this.color = dyeColour; - - if (!this.world().isRemote) - { - tile().notifyPartChange(this); - this.sendInsulationUpdate(); - this.sendColorUpdate(); - } - } - - public boolean isInsulated() - { - return this.isInsulated; - } - - public void sendInsulationUpdate() - { - tile().getWriteStream(this).writeByte(1).writeBoolean(this.isInsulated); - } - - /** - * Wire Coloring Methods - */ - public int getColor() - { - return this.isInsulated ? this.color : -1; - } - - public void setColor(int dye) - { - if (this.isInsulated) - { - this.color = dye; - - if (!this.world().isRemote) - { - tile().notifyPartChange(this); - this.sendColorUpdate(); - } - } - } - - public void sendColorUpdate() - { - tile().getWriteStream(this).writeByte(2).writeInt(this.color); - } - - /** - * Changes the wire's color. - */ - @Override - public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack itemStack) - { - if (itemStack != null) - { - int dyeColor = Utility.isDye(itemStack); - - if (dyeColor != -1 && this.isInsulated()) - { - if (!player.capabilities.isCreativeMode) - { - player.inventory.decrStackSize(player.inventory.currentItem, 1); - } - - this.setColor(dyeColor); - return true; - } - else if (itemStack.itemID == Block.cloth.blockID) - { - if (this.isInsulated()) - { - if (!world().isRemote && player.capabilities.isCreativeMode) - { - tile().dropItems(Collections.singletonList(new ItemStack(Block.cloth, 1, BlockColored.getBlockFromDye(color)))); - } - - this.setInsulated(false); - return true; - } - else - { - if (!player.capabilities.isCreativeMode) - { - player.inventory.decrStackSize(player.inventory.currentItem, 1); - } - - this.setInsulated(BlockColored.getDyeFromBlock(itemStack.getItemDamage())); - return true; - } - } - else if (itemStack.getItem() instanceof ItemShears && isInsulated()) - { - if (!world().isRemote && !player.capabilities.isCreativeMode) - { - tile().dropItems(Collections.singletonList(new ItemStack(Block.cloth, 1, BlockColored.getBlockFromDye(color)))); - } - - this.setInsulated(false); - return true; - } - } - - return false; - } - - protected ItemStack getItem() - { - return EnumWireMaterial.values()[getMaterialID()].getWire(); - } - - @Override - public Iterable getDrops() - { - List drops = new ArrayList(); - drops.add(getItem()); - - if (this.isInsulated) - { - drops.add(new ItemStack(Block.cloth, 1, BlockColored.getBlockFromDye(color))); - } - - return drops; - } - - @Override - public ItemStack pickItem(MovingObjectPosition hit) - { - return getItem(); - } - - @Override - public void readDesc(MCDataInput packet) - { - this.setMaterial(packet.readByte()); - this.color = packet.readByte(); - this.isInsulated = packet.readBoolean(); - } - - @Override - public void writeDesc(MCDataOutput packet) - { - packet.writeByte((byte) this.getMaterialID()); - packet.writeByte((byte) this.color); - packet.writeBoolean(this.isInsulated); - } - - public void read(MCDataInput packet, int packetID) - { - switch (packetID) - { - case 1: - this.isInsulated = packet.readBoolean(); - this.tile().markRender(); - break; - case 2: - this.color = packet.readInt(); - this.tile().markRender(); - break; - } - } - - @Override - public void save(NBTTagCompound nbt) - { - super.save(nbt); - nbt.setInteger("typeID", getMaterialID()); - nbt.setBoolean("isInsulated", isInsulated); - nbt.setInteger("dyeID", color); - } - - @Override - public void load(NBTTagCompound nbt) - { - super.load(nbt); - setMaterial(nbt.getInteger("typeID")); - this.isInsulated = nbt.getBoolean("isInsulated"); - this.color = nbt.getInteger("dyeID"); - } - - protected boolean checkRedstone(int side) - { - if (this.world().isBlockIndirectlyGettingPowered(x(), y(), z())) - { - return true; - } - else - { - for (TMultiPart tp : tile().jPartList()) - { - if (tp instanceof IRedstonePart) - { - IRedstonePart rp = (IRedstonePart) tp; - if ((Math.max(rp.strongPowerLevel(side), rp.weakPowerLevel(side)) << 4) > 0) - { - return true; - } - } - } - } - - return false; - } -} diff --git a/archive/java/resonantinduction/electrical/wire/PartConductor.java b/archive/java/resonantinduction/electrical/wire/PartConductor.java deleted file mode 100644 index 678ca311..00000000 --- a/archive/java/resonantinduction/electrical/wire/PartConductor.java +++ /dev/null @@ -1,186 +0,0 @@ -package resonantinduction.electrical.wire; - -import ic2.api.energy.event.EnergyTileLoadEvent; -import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergyTile; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.common.MinecraftForge; -import resonantinduction.core.prefab.part.PartAdvanced; -import universalelectricity.api.CompatibilityModule; -import universalelectricity.api.UniversalClass; -import universalelectricity.api.energy.EnergyNetworkLoader; -import universalelectricity.api.energy.IConductor; -import universalelectricity.api.energy.IEnergyNetwork; -import universalelectricity.api.vector.Vector3; -import universalelectricity.api.vector.VectorHelper; -import codechicken.multipart.TMultiPart; - -@UniversalClass -public abstract class PartConductor extends PartAdvanced implements IConductor -{ - private IEnergyNetwork network; - - protected Object[] connections = new Object[6]; - - /** - * Universal Electricity conductor functions. - */ - @Override - public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) - { - return this.getNetwork().produce(this, from.getOpposite(), receive, doReceive); - } - - @Override - public long onExtractEnergy(ForgeDirection from, long request, boolean doExtract) - { - return 0; - } - - @Override - public IEnergyNetwork getNetwork() - { - if (this.network == null) - { - this.setNetwork(EnergyNetworkLoader.getNewNetwork(this)); - } - - return this.network; - } - - @Override - public void setNetwork(IEnergyNetwork network) - { - this.network = network; - } - - @Override - public boolean doesTick() - { - return false; - } - - @Override - public Object[] getConnections() - { - return this.connections; - } - - /** - * EXTERNAL USE Can this wire be connected by another block? - */ - @Override - public boolean canConnect(ForgeDirection direction) - { - Vector3 connectPos = new Vector3(tile()).modifyPositionFromSide(direction); - TileEntity connectTile = connectPos.getTileEntity(world()); - - if (connectTile instanceof IConductor) - { - return false; - } - - return CompatibilityModule.isHandler(connectTile); - } - - public abstract boolean canConnectTo(Object obj); - - /** - * Recalculates all the network connections - */ - protected void recalculateConnections() - { - this.connections = new Object[6]; - /** - * Calculate all external connections with this conductor. - */ - for (byte i = 0; i < 6; i++) - { - ForgeDirection side = ForgeDirection.getOrientation(i); - - if (this.canConnect(side)) - { - TileEntity tileEntity = VectorHelper.getTileEntityFromSide(world(), new Vector3(tile()), side); - connections[i] = tileEntity; - } - } - } - - /** - * IC2 Functions - */ - @Override - public void onWorldJoin() - { - if (tile() instanceof IEnergyTile && !world().isRemote) - { - // Check if there's another part that's an IEnergyTile - boolean foundAnotherPart = false; - - for (int i = 0; i < tile().partList().size(); i++) - { - TMultiPart part = tile().partMap(i); - - if (part instanceof IEnergyTile) - { - foundAnotherPart = true; - break; - } - } - - if (!foundAnotherPart) - { - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent((IEnergyTile) tile())); - } - } - } - - @Override - public void preRemove() - { - if (!world().isRemote) - { - this.getNetwork().split(this); - - if (tile() instanceof IEnergyTile) - { - // Check if there's another part that's an IEnergyTile - boolean foundAnotherPart = false; - - for (int i = 0; i < tile().partList().size(); i++) - { - TMultiPart part = tile().partMap(i); - - if (part instanceof IEnergyTile) - { - foundAnotherPart = true; - break; - } - } - - if (!foundAnotherPart) - { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile) tile())); - } - } - } - - super.preRemove(); - } - - @Override - public void save(NBTTagCompound nbt) - { - super.save(nbt); - nbt.setLong("savedBuffer", this.getNetwork().getBufferOf(this)); - } - - @Override - public void load(NBTTagCompound nbt) - { - super.load(nbt); - this.getNetwork().setBufferFor(this, nbt.getLong("savedBuffer")); - } -} diff --git a/archive/java/resonantinduction/electrical/wire/flat/PartFlatWire.java b/archive/java/resonantinduction/electrical/wire/flat/PartFlatWire.java deleted file mode 100644 index dcfb0df8..00000000 --- a/archive/java/resonantinduction/electrical/wire/flat/PartFlatWire.java +++ /dev/null @@ -1,960 +0,0 @@ -package resonantinduction.electrical.wire.flat; - -import java.util.Arrays; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Utility; -import resonantinduction.electrical.wire.EnumWireMaterial; -import resonantinduction.electrical.wire.PartAdvancedWire; -import calclavia.lib.render.EnumColor; -import codechicken.lib.colour.Colour; -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.data.MCDataInput; -import codechicken.lib.data.MCDataOutput; -import codechicken.lib.lighting.LazyLightMatrix; -import codechicken.lib.raytracer.IndexedCuboid6; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.TextureUtils; -import codechicken.lib.vec.BlockCoord; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Rotation; -import codechicken.lib.vec.Vector3; -import codechicken.multipart.JNormalOcclusion; -import codechicken.multipart.MultiPartRegistry; -import codechicken.multipart.NormalOcclusionTest; -import codechicken.multipart.PartMap; -import codechicken.multipart.TFacePart; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TileMultipart; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * This is the base class for all wire types. It can be used for any sub type, as it contains the - * base calculations necessary to create a working wire. This calculates all possible connections to - * sides, around corners, and inside corners, while checking for microblock obstructions. - * - * @author Modified by Calclavia, MrTJP - */ -public class PartFlatWire extends PartAdvancedWire implements TFacePart, JNormalOcclusion -{ - public static Cuboid6[][] selectionBounds = new Cuboid6[3][6]; - public static Cuboid6[][] occlusionBounds = new Cuboid6[3][6]; - - static - { - for (int t = 0; t < 3; t++) - { - // Subtract the box a little because we'd like things like posts to get first hit - Cuboid6 selection = new Cuboid6(0, 0, 0, 1, (t + 2) / 16D, 1).expand(-0.005); - Cuboid6 occlusion = new Cuboid6(2 / 8D, 0, 2 / 8D, 6 / 8D, (t + 2) / 16D, 6 / 8D); - for (int s = 0; s < 6; s++) - { - selectionBounds[t][s] = selection.copy().apply(Rotation.sideRotations[s].at(Vector3.center)); - occlusionBounds[t][s] = occlusion.copy().apply(Rotation.sideRotations[s].at(Vector3.center)); - } - } - } - - public byte side; - - /** - * A map of the corners. - * - * - * Currently split into 4 nybbles (from lowest) 0 = Corner connections (this wire should connect - * around a corner to something external) 1 = Straight connections (this wire should connect to - * something external) 2 = Internal connections (this wire should connect to something internal) - * 3 = Internal open connections (this wire is not blocked by a cover/edge part and *could* - * connect through side) bit 16 = connection to the centerpart 5 = Render corner connections. - * Like corner connections but set to low if the other wire part is smaller than this (they - * render to us not us to them) - */ - public int connMap; - - public PartFlatWire() - { - - } - - public PartFlatWire(int typeID) - { - this(EnumWireMaterial.values()[typeID]); - } - - public PartFlatWire(EnumWireMaterial type) - { - material = type; - } - - public void preparePlacement(int side, int meta) - { - this.side = (byte) (side ^ 1); - this.setMaterial(meta); - } - - /** PACKET and NBT Methods */ - @Override - public void load(NBTTagCompound tag) - { - super.load(tag); - this.side = tag.getByte("side"); - this.connMap = tag.getInteger("connMap"); - } - - @Override - public void save(NBTTagCompound tag) - { - super.save(tag); - tag.setByte("side", this.side); - tag.setInteger("connMap", this.connMap); - } - - @Override - public void readDesc(MCDataInput packet) - { - super.readDesc(packet); - this.side = packet.readByte(); - this.connMap = packet.readInt(); - } - - @Override - public void writeDesc(MCDataOutput packet) - { - super.writeDesc(packet); - packet.writeByte(this.side); - packet.writeInt(this.connMap); - } - - @Override - public void read(MCDataInput packet) - { - read(packet, packet.readUByte()); - } - - @Override - public void read(MCDataInput packet, int packetID) - { - if (packetID == 0) - { - this.connMap = packet.readInt(); - tile().markRender(); - } - else - { - super.read(packet, packetID); - } - } - - public void sendConnUpdate() - { - tile().getWriteStream(this).writeByte(0).writeInt(this.connMap); - } - - /* WORLD EVENTS */ - @Override - public void onRemoved() - { - super.onRemoved(); - - if (!world().isRemote) - { - for (int r = 0; r < 4; r++) - { - if (maskConnects(r)) - { - if ((connMap & 1 << r) != 0) - { - notifyCornerChange(r); - } - else if ((connMap & 0x10 << r) != 0) - { - notifyStraightChange(r); - } - } - } - } - } - - @Override - public void onChunkLoad() - { - if ((connMap & 0x80000000) != 0) // compat with converters, recalc connections - { - if (dropIfCantStay()) - { - return; - } - - connMap = 0; - - updateInternalConnections(); - - if (updateOpenConnections()) - { - updateExternalConnections(); - } - - tile().markDirty(); - } - - this.recalculateConnections(); - - super.onChunkLoad(); - } - - @Override - public void onAdded() - { - super.onAdded(); - - if (!world().isRemote) - { - updateOpenConnections(); - boolean changed = updateInternalConnections(); - // don't use || because it's fail fast - changed |= updateExternalConnections(); - - if (changed) - { - sendConnUpdate(); - } - - this.recalculateConnections(); - } - } - - @Override - public void onPartChanged(TMultiPart part) - { - if (!world().isRemote) - { - boolean changed = updateInternalConnections(); - - if (updateOpenConnections()) - { - changed |= updateExternalConnections(); - } - - if (changed) - { - sendConnUpdate(); - } - - this.recalculateConnections(); - } - - super.onPartChanged(part); - } - - @Override - public void onNeighborChanged() - { - if (!world().isRemote) - { - if (dropIfCantStay()) - { - return; - } - - if (updateExternalConnections()) - { - sendConnUpdate(); - } - - this.recalculateConnections(); - } - super.onNeighborChanged(); - } - - @Override - public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack item) - { - if (!world().isRemote) - { - System.out.println(this.getNetwork()); - } - - if (item != null) - { - if (item.getItem().itemID == Block.lever.blockID) - { - TileMultipart tile = tile(); - World w = world(); - - if (!w.isRemote) - { - PartFlatSwitchWire wire = (PartFlatSwitchWire) MultiPartRegistry.createPart("resonant_induction_flat_switch_wire", false); - wire.copyFrom(this); - - if (tile.canReplacePart(this, wire)) - { - tile.remPart(this); - TileMultipart.addPart(w, new BlockCoord(tile), wire); - - if (!player.capabilities.isCreativeMode) - { - player.inventory.decrStackSize(player.inventory.currentItem, 1); - } - } - } - return true; - } - } - - return super.activate(player, part, item); - } - - @Override - public void recalculateConnections() - { - this.updateOpenConnections(); - - boolean[] calculatedSides = new boolean[6]; - - /** Check external connections. */ - for (byte r = 0; r < 4; r++) - { - if (maskOpen(r)) - { - int absDir = Rotation.rotateSide(this.side, r); - - // Check direct connection. - if (this.setExternalConnection(r, absDir)) - { - calculatedSides[absDir] = true; - } - - // Check Corner Connection - BlockCoord cornerPos = new BlockCoord(tile()); - cornerPos.offset(absDir); - - if (canConnectThroughCorner(cornerPos, absDir ^ 1, this.side)) - { - cornerPos.offset(this.side); - TileMultipart tpCorner = Utility.getMultipartTile(world(), cornerPos); - - if (tpCorner != null) - { - TMultiPart tp = tpCorner.partMap(absDir ^ 1); - - if (this.canConnectTo(tp, ForgeDirection.getOrientation(absDir))) - { - this.connections[absDir] = tp; - - if (tp instanceof PartFlatWire) - { - // We found a wire, merge networks! - this.getNetwork().merge(((PartFlatWire) tp).getNetwork()); - } - - calculatedSides[absDir] = true; - continue; - } - } - } - - if (!calculatedSides[absDir]) - { - this.disconnect(absDir); - } - } - } - - /** Check internal connections. */ - for (byte r = 0; r < 4; r++) - { - int absDir = Rotation.rotateSide(this.side, r); - - /** Look for an internal straight connection. */ - if (tile().partMap(PartMap.edgeBetween(absDir, this.side)) == null) - { - TMultiPart tp = tile().partMap(absDir); - - if (this.canConnectTo(tp)) - { - // We found a wire! Merge networks! - this.connections[absDir] = tp; - this.getNetwork().merge(((PartFlatWire) tp).getNetwork()); - continue; - } - } - - if (!calculatedSides[absDir]) - { - this.disconnect(absDir); - } - } - - // Connect to the face of the block the wire is placed on. - this.setExternalConnection(-1, this.side); - - this.getNetwork().reconstruct(); - } - - public boolean setExternalConnection(int r, int absSide) - { - BlockCoord pos = new BlockCoord(tile()).offset(absSide); - - /** Look for an external wire connection. */ - TileMultipart t = Utility.getMultipartTile(world(), pos); - - if (t != null && r != -1) - { - TMultiPart tp = t.partMap(this.side); - - if (this.canConnectTo(tp, ForgeDirection.getOrientation(absSide))) - { - // Check the wire we are connecting to and see if THAT block can accept this one. - int otherR = (r + 2) % 4; - - if (tp instanceof PartFlatWire && ((PartFlatWire) tp).canConnectTo(this, ForgeDirection.getOrientation(absSide).getOpposite()) && ((PartFlatWire) tp).maskOpen(otherR)) - { - // We found a wire! Merge connection. - this.connections[absSide] = tp; - this.getNetwork().merge(((PartFlatWire) tp).getNetwork()); - return true; - } - } - - this.disconnect(absSide); - } - - /** Look for an external energy handler. */ - TileEntity tileEntity = world().getBlockTileEntity(pos.x, pos.y, pos.z); - - if (this.canConnectTo(tileEntity, ForgeDirection.getOrientation(absSide))) - { - this.connections[absSide] = tileEntity; - return true; - } - - this.disconnect(absSide); - - return false; - } - - private synchronized void disconnect(int i) - { - if (!this.world().isRemote) - { - if (this.connections[i] != null) - { - if (this.connections[i] instanceof PartFlatWire) - { - PartFlatWire wire = (PartFlatWire) this.connections[i]; - this.connections[i] = null; - this.getNetwork().split(this, wire); - } - else - { - this.connections[i] = null; - } - } - } - } - - @Override - public Object[] getConnections() - { - return this.connections; - } - - public boolean canStay() - { - BlockCoord pos = new BlockCoord(tile()).offset(side); - return Utility.canPlaceWireOnSide(world(), pos.x, pos.y, pos.z, ForgeDirection.getOrientation(side ^ 1), false); - } - - public boolean dropIfCantStay() - { - if (!canStay()) - { - drop(); - return true; - } - return false; - } - - public void drop() - { - TileMultipart.dropItem(getItem(), world(), Vector3.fromTileEntityCenter(tile())); - tile().remPart(this); - } - - /** - * Recalculates connections to blocks outside this space - * - * @return true if a new connection was added or one was removed - */ - protected boolean updateExternalConnections() - { - int newConn = 0; - - for (int r = 0; r < 4; r++) - { - if (!maskOpen(r)) - { - continue; - } - - if (connectStraight(r)) - { - newConn |= 0x10 << r; - } - else - { - int cnrMode = connectCorner(r); - - if (cnrMode != 0) - { - newConn |= 1 << r; - - if (cnrMode == 2) - { - newConn |= 0x100000 << r;// render flag - } - } - } - } - - if (newConn != (connMap & 0xF000FF)) - { - int diff = connMap ^ newConn; - connMap = connMap & ~0xF000FF | newConn; - - // Notify corner disconnections - for (int r = 0; r < 4; r++) - { - if ((diff & 1 << r) != 0) - { - notifyCornerChange(r); - } - } - - return true; - } - - return false; - } - - /** - * Recalculates connections to other parts within this space - * - * @return true if a new connection was added or one was removed - */ - protected boolean updateInternalConnections() - { - int newConn = 0; - for (int r = 0; r < 4; r++) - { - if (connectInternal(r)) - { - newConn |= 0x100 << r; - } - } - - if (connectCenter()) - { - newConn |= 0x10000; - } - - if (newConn != (connMap & 0x10F00)) - { - connMap = connMap & ~0x10F00 | newConn; - return true; - } - return false; - } - - /** - * Recalculates connections that can be made to other parts outside of this space - * - * @return true if external connections should be recalculated - */ - protected boolean updateOpenConnections() - { - int newConn = 0; - for (int r = 0; r < 4; r++) - if (connectionOpen(r)) - newConn |= 0x1000 << r; - - if (newConn != (connMap & 0xF000)) - { - connMap = connMap & ~0xF000 | newConn; - return true; - } - return false; - } - - public boolean connectionOpen(int r) - { - int absDir = Rotation.rotateSide(side, r); - TMultiPart facePart = tile().partMap(absDir); - if (facePart != null && (!(facePart instanceof PartFlatWire) || !canConnectTo(facePart, ForgeDirection.getOrientation(absDir)))) - return false; - - if (tile().partMap(PartMap.edgeBetween(side, absDir)) != null) - return false; - - return true; - } - - /** - * Return a corner connection state. 0 = No connection 1 = Physical connection 2 = Render - * connection - */ - public int connectCorner(int r) - { - int absDir = Rotation.rotateSide(side, r); - - BlockCoord pos = new BlockCoord(tile()); - pos.offset(absDir); - - if (!canConnectThroughCorner(pos, absDir ^ 1, side)) - return 0; - - pos.offset(side); - TileMultipart t = Utility.getMultipartTile(world(), pos); - if (t != null) - { - TMultiPart tp = t.partMap(absDir ^ 1); - - if (canConnectTo(tp, ForgeDirection.getOrientation(absDir))) - { - if (tp instanceof PartFlatWire) - { - boolean b = ((PartFlatWire) tp).connectCorner(this, Rotation.rotationTo(absDir ^ 1, side ^ 1)); - - if (b) - { - // let them connect to us - if (!renderThisCorner((PartFlatWire) tp)) - { - return 1; - } - - return 2; - } - } - - return 2; - } - } - return 0; - } - - public boolean canConnectThroughCorner(BlockCoord pos, int side1, int side2) - { - if (world().isAirBlock(pos.x, pos.y, pos.z)) - { - return true; - } - - TileMultipart t = Utility.getMultipartTile(world(), pos); - if (t != null) - { - return t.partMap(side1) == null && t.partMap(side2) == null && t.partMap(PartMap.edgeBetween(side1, side2)) == null; - } - - return false; - } - - public boolean connectStraight(int r) - { - int absDir = Rotation.rotateSide(side, r); - - BlockCoord pos = new BlockCoord(tile()).offset(absDir); - - TileMultipart t = Utility.getMultipartTile(world(), pos); - if (t != null) - { - TMultiPart tp = t.partMap(side); - - if (this.canConnectTo(tp, ForgeDirection.getOrientation(absDir))) - { - if (tp instanceof PartFlatWire) - { - return ((PartFlatWire) tp).connectStraight(this, (r + 2) % 4); - } - - return true; - } - } - else - { - TileEntity tileEntity = world().getBlockTileEntity(pos.x, pos.y, pos.z); - return this.canConnectTo(tileEntity, ForgeDirection.getOrientation(absDir)); - } - - return false; - } - - public boolean connectInternal(int r) - { - int absDir = Rotation.rotateSide(side, r); - - if (tile().partMap(PartMap.edgeBetween(absDir, side)) != null) - return false; - - TMultiPart tp = tile().partMap(absDir); - - if (this.canConnectTo(tp, ForgeDirection.getOrientation(absDir))) - { - return ((PartFlatWire) tp).connectInternal(this, Rotation.rotationTo(absDir, side)); - } - - return connectInternalOverride(tp, r); - } - - public boolean connectInternalOverride(TMultiPart p, int r) - { - return false; - } - - public boolean connectCenter() - { - TMultiPart tp = tile().partMap(6); - - if (this.canConnectTo(tp)) - { - if (tp instanceof PartFlatWire) - { - return ((PartFlatWire) tp).connectInternal(this, side); - } - - return true; - } - - return false; - } - - public boolean renderThisCorner(PartFlatWire part) - { - if (!(part instanceof PartFlatWire)) - return false; - - PartFlatWire wire = part; - if (wire.getThickness() == getThickness()) - return side < wire.side; - - return wire.getThickness() > getThickness(); - } - - public boolean connectCorner(PartFlatWire wire, int r) - { - int absDir = Rotation.rotateSide(side, r); - - if (this.canConnectTo(wire, ForgeDirection.getOrientation(absDir)) && maskOpen(r)) - { - int oldConn = connMap; - connMap |= 0x1 << r; - if (renderThisCorner(wire))// render connection - connMap |= 0x100000 << r; - - if (oldConn != connMap) - sendConnUpdate(); - return true; - } - return false; - } - - public boolean connectStraight(PartFlatWire wire, int r) - { - int absDir = Rotation.rotateSide(side, r); - - if (this.canConnectTo(wire, ForgeDirection.getOrientation(absDir)) && maskOpen(r)) - { - int oldConn = connMap; - connMap |= 0x10 << r; - if (oldConn != connMap) - sendConnUpdate(); - return true; - } - return false; - } - - public boolean connectInternal(PartFlatWire wire, int r) - { - int absDir = Rotation.rotateSide(side, r); - - if (this.canConnectTo(wire, ForgeDirection.getOrientation(absDir))) - { - int oldConn = connMap; - connMap |= 0x100 << r; - if (oldConn != connMap) - sendConnUpdate(); - return true; - } - return false; - } - - public boolean canConnectCorner(int r) - { - return true; - } - - public void notifyCornerChange(int r) - { - int absDir = Rotation.rotateSide(side, r); - - BlockCoord pos = new BlockCoord(tile()).offset(absDir).offset(side); - world().notifyBlockOfNeighborChange(pos.x, pos.y, pos.z, tile().getBlockType().blockID); - } - - public void notifyStraightChange(int r) - { - int absDir = Rotation.rotateSide(side, r); - - BlockCoord pos = new BlockCoord(tile()).offset(absDir); - world().notifyBlockOfNeighborChange(pos.x, pos.y, pos.z, tile().getBlockType().blockID); - } - - public boolean maskConnects(int r) - { - return (connMap & 0x111 << r) != 0; - } - - public boolean maskOpen(int r) - { - return (connMap & 0x1000 << r) != 0; - } - - /** START TILEMULTIPART INTERACTIONS **/ - @Override - public float getStrength(MovingObjectPosition hit, EntityPlayer player) - { - return 4; - } - - @Override - public int getSlotMask() - { - return 1 << this.side; - } - - @Override - public Iterable getSubParts() - { - return Arrays.asList(new IndexedCuboid6(0, selectionBounds[getThickness()][side])); - } - - @Override - public boolean occlusionTest(TMultiPart npart) - { - return NormalOcclusionTest.apply(this, npart); - } - - @Override - public Iterable getOcclusionBoxes() - { - return Arrays.asList(occlusionBounds[getThickness()][side]); - } - - public int getThickness() - { - return this.isInsulated ? 2 : 1; - } - - @Override - public int redstoneConductionMap() - { - return 0; - } - - @Override - public boolean solid(int arg0) - { - return false; - } - - @Override - public String getType() - { - return "resonant_induction_flat_wire"; - } - - /** RENDERING */ - @SideOnly(Side.CLIENT) - public Icon getIcon() - { - return RenderFlatWire.flatWireTexture; - } - - public Colour getColour() - { - return this.isInsulated ? new ColourRGBA(EnumColor.DYES[this.color].toColor().getRGB()) : this.getMaterial().color; - } - - public boolean useStaticRenderer() - { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public void renderStatic(Vector3 pos, LazyLightMatrix olm, int pass) - { - if (pass == 0 && useStaticRenderer()) - { - CCRenderState.setBrightness(world(), x(), y(), z()); - RenderFlatWire.render(this, pos); - CCRenderState.setColour(-1); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void renderDynamic(Vector3 pos, float frame, int pass) - { - if (pass == 0 && !useStaticRenderer()) - { - GL11.glDisable(GL11.GL_LIGHTING); - TextureUtils.bindAtlas(0); - CCRenderState.useModelColours(true); - CCRenderState.startDrawing(7); - RenderFlatWire.render(this, pos); - CCRenderState.draw(); - CCRenderState.setColour(-1); - GL11.glEnable(GL11.GL_LIGHTING); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void drawBreaking(RenderBlocks renderBlocks) - { - CCRenderState.reset(); - RenderFlatWire.renderBreakingOverlay(renderBlocks.overrideBlockTexture, this); - } - - /** - * Utility method to aid in initializing this or subclasses, usually when you need to change the - * wire to another type - * - * @param otherCable the wire to copy from - */ - public void copyFrom(PartFlatWire otherCable) - { - this.isInsulated = otherCable.isInsulated; - this.color = otherCable.color; - this.connections = otherCable.connections; - this.material = otherCable.material; - this.side = otherCable.side; - this.connMap = otherCable.connMap; - this.setNetwork(otherCable.getNetwork()); - this.getNetwork().setBufferFor(this, otherCable.getNetwork().getBufferOf(otherCable)); - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/electrical/wire/framed/PartFramedSwitchWire.java b/archive/java/resonantinduction/electrical/wire/framed/PartFramedSwitchWire.java deleted file mode 100644 index 73cee964..00000000 --- a/archive/java/resonantinduction/electrical/wire/framed/PartFramedSwitchWire.java +++ /dev/null @@ -1,94 +0,0 @@ -package resonantinduction.electrical.wire.framed; - -import java.util.Collections; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import codechicken.lib.vec.BlockCoord; -import codechicken.multipart.MultiPartRegistry; -import codechicken.multipart.TileMultipart; - -public class PartFramedSwitchWire extends PartFramedWire -{ - @Override - public boolean isBlockedOnSide(ForgeDirection side) - { - if (this.checkRedstone(6)) - { - return super.isBlockedOnSide(side); - } - return true; - } - - @Override - public String getType() - { - return "resonant_induction_switch_wire"; - } - - @Override - public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack item) - { - TileMultipart tile = tile(); - World w = world(); - - if (item.getItem().itemID == Block.lever.blockID) - { - if (!w.isRemote) - { - PartFramedWire wire = (PartFramedWire) MultiPartRegistry.createPart("resonant_induction_wire", false); - wire.copyFrom(this); - - if (tile.canReplacePart(this, wire)) - { - tile.remPart(this); - TileMultipart.addPart(w, new BlockCoord(tile), wire); - - if (!player.capabilities.isCreativeMode) - { - tile.dropItems(Collections.singletonList(new ItemStack(Block.lever, 1))); - } - } - } - return true; - } - else - { - return super.activate(player, part, item); - } - } - - @Override - public Iterable getDrops() - { - List drops = (List) super.getDrops(); - drops.add(new ItemStack(Block.lever, 1)); - - return drops; - } - - @Override - public byte getPossibleAcceptorConnections() - { - if (this.checkRedstone(6)) - { - return super.getPossibleAcceptorConnections(); - } - return 0x00; - } - - @Override - public byte getPossibleWireConnections() - { - if (this.checkRedstone(6)) - { - return super.getPossibleWireConnections(); - } - return 0x00; - } -} diff --git a/archive/java/resonantinduction/electrical/wire/framed/PartFramedWire.java b/archive/java/resonantinduction/electrical/wire/framed/PartFramedWire.java deleted file mode 100644 index 0817c23b..00000000 --- a/archive/java/resonantinduction/electrical/wire/framed/PartFramedWire.java +++ /dev/null @@ -1,541 +0,0 @@ -package resonantinduction.electrical.wire.framed; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.client.particle.EffectRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.electrical.wire.EnumWireMaterial; -import resonantinduction.electrical.wire.PartAdvancedWire; -import universalelectricity.api.CompatibilityModule; -import universalelectricity.api.energy.IConductor; -import universalelectricity.api.vector.Vector3; -import universalelectricity.api.vector.VectorHelper; -import codechicken.lib.data.MCDataInput; -import codechicken.lib.data.MCDataOutput; -import codechicken.lib.lighting.LazyLightMatrix; -import codechicken.lib.raytracer.IndexedCuboid6; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.IconTransformation; -import codechicken.lib.render.RenderUtils; -import codechicken.lib.vec.BlockCoord; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Translation; -import codechicken.microblock.IHollowConnect; -import codechicken.multipart.IconHitEffects; -import codechicken.multipart.JIconHitEffects; -import codechicken.multipart.JNormalOcclusion; -import codechicken.multipart.MultiPartRegistry; -import codechicken.multipart.NormalOcclusionTest; -import codechicken.multipart.PartMap; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TSlottedPart; -import codechicken.multipart.TileMultipart; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PartFramedWire extends PartAdvancedWire implements TSlottedPart, JNormalOcclusion, IHollowConnect, JIconHitEffects -{ - /** Client Side Connection Check */ - private ForgeDirection testingSide; - - public static IndexedCuboid6[] sides = new IndexedCuboid6[7]; - public static IndexedCuboid6[] insulatedSides = new IndexedCuboid6[7]; - - /** - * Bitmask connections - */ - public byte currentWireConnections = 0x00; - public byte currentAcceptorConnections = 0x00; - - public PartFramedWire() - { - super(); - } - - public PartFramedWire(int typeID) - { - this(EnumWireMaterial.values()[typeID]); - } - - public PartFramedWire(EnumWireMaterial type) - { - super(); - material = type; - } - - static - { - sides[0] = new IndexedCuboid6(0, new Cuboid6(0.36, 0.000, 0.36, 0.64, 0.36, 0.64)); - sides[1] = new IndexedCuboid6(1, new Cuboid6(0.36, 0.64, 0.36, 0.64, 1.000, 0.64)); - sides[2] = new IndexedCuboid6(2, new Cuboid6(0.36, 0.36, 0.000, 0.64, 0.64, 0.36)); - sides[3] = new IndexedCuboid6(3, new Cuboid6(0.36, 0.36, 0.64, 0.64, 0.64, 1.000)); - sides[4] = new IndexedCuboid6(4, new Cuboid6(0.000, 0.36, 0.36, 0.36, 0.64, 0.64)); - sides[5] = new IndexedCuboid6(5, new Cuboid6(0.64, 0.36, 0.36, 1.000, 0.64, 0.64)); - sides[6] = new IndexedCuboid6(6, new Cuboid6(0.36, 0.36, 0.36, 0.64, 0.64, 0.64)); - insulatedSides[0] = new IndexedCuboid6(0, new Cuboid6(0.3, 0.0, 0.3, 0.7, 0.3, 0.7)); - insulatedSides[1] = new IndexedCuboid6(1, new Cuboid6(0.3, 0.7, 0.3, 0.7, 1.0, 0.7)); - insulatedSides[2] = new IndexedCuboid6(2, new Cuboid6(0.3, 0.3, 0.0, 0.7, 0.7, 0.3)); - insulatedSides[3] = new IndexedCuboid6(3, new Cuboid6(0.3, 0.3, 0.7, 0.7, 0.7, 1.0)); - insulatedSides[4] = new IndexedCuboid6(4, new Cuboid6(0.0, 0.3, 0.3, 0.3, 0.7, 0.7)); - insulatedSides[5] = new IndexedCuboid6(5, new Cuboid6(0.7, 0.3, 0.3, 1.0, 0.7, 0.7)); - insulatedSides[6] = new IndexedCuboid6(6, new Cuboid6(0.3, 0.3, 0.3, 0.7, 0.7, 0.7)); - } - - @Override - public String getType() - { - return "resonant_induction_wire"; - } - - @Override - public boolean occlusionTest(TMultiPart other) - { - return NormalOcclusionTest.apply(this, other); - } - - @Override - public Iterable getSubParts() - { - Set subParts = new HashSet(); - IndexedCuboid6[] currentSides = isInsulated() ? insulatedSides : sides; - - if (tile() != null) - { - for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - { - int ord = side.ordinal(); - if (connectionMapContainsSide(getAllCurrentConnections(), side) || side == testingSide) - subParts.add(currentSides[ord]); - } - } - - subParts.add(currentSides[6]); - return subParts; - } - - @Override - public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack item) - { - if (!world().isRemote) - { - System.out.println(this.getNetwork()); - } - - if (item != null) - { - if (item.getItem().itemID == Block.lever.blockID) - { - TileMultipart tile = tile(); - World w = world(); - - if (!w.isRemote) - { - PartFramedSwitchWire wire = (PartFramedSwitchWire) MultiPartRegistry.createPart("resonant_induction_switch_wire", false); - wire.copyFrom(this); - - if (tile.canReplacePart(this, wire)) - { - tile.remPart(this); - TileMultipart.addPart(w, new BlockCoord(tile), wire); - - if (!player.capabilities.isCreativeMode) - { - player.inventory.decrStackSize(player.inventory.currentItem, 1); - } - } - } - return true; - } - } - - return super.activate(player, part, item); - } - - public void preparePlacement(int meta) - { - this.setMaterial(meta); - } - - @Override - public Iterable getCollisionBoxes() - { - Set collisionBoxes = new HashSet(); - collisionBoxes.addAll((Collection) getSubParts()); - - return collisionBoxes; - } - - @Override - public float getStrength(MovingObjectPosition hit, EntityPlayer player) - { - return 10F; - } - - @Override - @SideOnly(Side.CLIENT) - public void renderStatic(codechicken.lib.vec.Vector3 pos, LazyLightMatrix olm, int pass) - { - if (pass == 0) - { - RenderPartWire.INSTANCE.renderStatic(this); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void renderDynamic(codechicken.lib.vec.Vector3 pos, float frame, int pass) - { - if (getMaterial() == EnumWireMaterial.SILVER) - { - RenderPartWire.INSTANCE.renderShine(this, pos.x, pos.y, pos.z, frame); - } - } - - @Override - public void drawBreaking(RenderBlocks renderBlocks) - { - CCRenderState.reset(); - RenderUtils.renderBlock(sides[6], 0, new Translation(x(), y(), z()), new IconTransformation(renderBlocks.overrideBlockTexture), null); - } - - @Override - public Iterable getOcclusionBoxes() - { - return getCollisionBoxes(); - } - - @Override - public int getSlotMask() - { - return PartMap.CENTER.mask; - } - - @Override - public int getHollowSize() - { - return isInsulated ? 8 : 6; - } - - @Override - public Cuboid6 getBounds() - { - return new Cuboid6(0.375, 0.375, 0.375, 0.625, 0.625, 0.625); - } - - @Override - public Icon getBreakingIcon(Object subPart, int side) - { - return RenderPartWire.breakIcon; - } - - @Override - public Icon getBrokenIcon(int side) - { - return RenderPartWire.breakIcon; - } - - @Override - public void addHitEffects(MovingObjectPosition hit, EffectRenderer effectRenderer) - { - IconHitEffects.addHitEffects(this, hit, effectRenderer); - } - - @Override - public void addDestroyEffects(EffectRenderer effectRenderer) - { - IconHitEffects.addDestroyEffects(this, effectRenderer, false); - } - - @Override - public void onPartChanged(TMultiPart part) - { - refresh(); - } - - public boolean isBlockedOnSide(ForgeDirection side) - { - TMultiPart blocker = tile().partMap(side.ordinal()); - testingSide = side; - boolean expandable = NormalOcclusionTest.apply(this, blocker); - testingSide = null; - return !expandable; - } - - public byte getAllCurrentConnections() - { - return (byte) (currentWireConnections | currentAcceptorConnections); - } - - public static boolean connectionMapContainsSide(byte connections, ForgeDirection side) - { - byte tester = (byte) (1 << side.ordinal()); - return ((connections & tester) > 0); - } - - @Override - public void bind(TileMultipart t) - { - if (tile() != null && this.getNetwork() != null) - { - getNetwork().getConnectors().remove(tile()); - super.bind(t); - getNetwork().getConnectors().add((IConductor) tile()); - } - else - { - super.bind(t); - } - } - - /** - * CONNECTION LOGIC CODE - */ - - public boolean canConnectBothSides(TileEntity tile, ForgeDirection side) - { - boolean notPrevented = !isConnectionPrevented(tile, side); - - if (tile instanceof IConductor) - { - notPrevented &= ((IConductor) tile).canConnect(side.getOpposite()); - } - - return notPrevented; - } - - /** - * Override if there are ways of preventing a connection - * - * @param tile The TileEntity on the given side - * @param side The side we're checking - * @return Whether we're preventing connections on given side or to given tileEntity - */ - public boolean isConnectionPrevented(TileEntity tile, ForgeDirection side) - { - return (tile instanceof IConductor ? this.canConnectTo(tile) : false) || (isBlockedOnSide(side)); - // || tile instanceof IBlockableConnection && ((IBlockableConnection) - // tile).isBlockedOnSide(side.getOpposite()))*/; - } - - public byte getPossibleWireConnections() - { - byte connections = 0x00; - - for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity tileEntity = VectorHelper.getTileEntityFromSide(world(), new Vector3(tile()), side); - - if (tileEntity instanceof IConductor && canConnectBothSides(tileEntity, side)) - { - connections |= 1 << side.ordinal(); - } - } - - return connections; - } - - public byte getPossibleAcceptorConnections() - { - byte connections = 0x00; - - for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity tileEntity = VectorHelper.getTileEntityFromSide(world(), new Vector3(tile()), side); - - if (CompatibilityModule.canConnect(tileEntity, side.getOpposite()) && canConnectBothSides(tileEntity, side)) - { - connections |= 1 << side.ordinal(); - } - } - - return connections; - } - - public void refresh() - { - if (!world().isRemote) - { - byte possibleWireConnections = getPossibleWireConnections(); - byte possibleAcceptorConnections = getPossibleAcceptorConnections(); - - if (possibleWireConnections != this.currentWireConnections) - { - byte or = (byte) (possibleWireConnections | this.currentWireConnections); - - // Connections have been removed - if (or != possibleWireConnections) - { - try - { - this.getNetwork().removeConnector(this); - this.getNetwork().split((IConductor) tile()); - } - catch (NullPointerException e) - { - } - this.setNetwork(null); - } - - for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - { - if (connectionMapContainsSide(possibleWireConnections, side)) - { - TileEntity tileEntity = VectorHelper.getConnectorFromSide(world(), new Vector3(tile()), side); - - if (tileEntity instanceof IConductor) - { - this.getNetwork().merge(((IConductor) tileEntity).getNetwork()); - } - } - } - - this.currentWireConnections = possibleWireConnections; - } - - this.currentAcceptorConnections = possibleAcceptorConnections; - this.getNetwork().reconstruct(); - this.sendConnectionUpdate(); - } - - tile().markRender(); - } - - /** - * Should include connections that are in the current connection maps even if those connections - * aren't allowed any more. This is so that networks split correctly. - */ - @Override - public TileEntity[] getConnections() - { - TileEntity[] connections = new TileEntity[6]; - - for (byte i = 0; i < 6; i++) - { - ForgeDirection side = ForgeDirection.getOrientation(i); - TileEntity tileEntity = VectorHelper.getTileEntityFromSide(world(), new Vector3(tile()), side); - - if (isCurrentlyConnected(side)) - { - connections[i] = tileEntity; - } - } - - return connections; - } - - public boolean isCurrentlyConnected(ForgeDirection side) - { - return connectionMapContainsSide(getAllCurrentConnections(), side); - } - - /** - * Shouldn't need to be overridden. Override connectionPrevented instead - */ - @Override - public boolean canConnect(ForgeDirection direction) - { - if (world().isBlockIndirectlyGettingPowered(x(), y(), z())) - { - return false; - } - - Vector3 connectPos = new Vector3(tile()).modifyPositionFromSide(direction); - TileEntity connectTile = connectPos.getTileEntity(world()); - return !isConnectionPrevented(connectTile, direction); - } - - @Override - public void onAdded() - { - super.onAdded(); - refresh(); - } - - @Override - public void onMoved() - { - this.refresh(); - } - - @Override - public void onChunkLoad() - { - super.onChunkLoad(); - refresh(); - } - - @Override - public void onNeighborChanged() - { - super.onNeighborChanged(); - refresh(); - } - - /** - * Packets - */ - public void sendConnectionUpdate() - { - tile().getWriteStream(this).writeByte(0).writeByte(this.currentWireConnections).writeByte(this.currentAcceptorConnections); - } - - @Override - public void readDesc(MCDataInput packet) - { - super.readDesc(packet); - this.currentWireConnections = packet.readByte(); - this.currentAcceptorConnections = packet.readByte(); - } - - @Override - public void writeDesc(MCDataOutput packet) - { - super.writeDesc(packet); - packet.writeByte(this.currentWireConnections); - packet.writeByte(this.currentAcceptorConnections); - } - - @Override - public void read(MCDataInput packet) - { - read(packet, packet.readUByte()); - } - - @Override - public void read(MCDataInput packet, int packetID) - { - if (packetID == 0) - { - this.currentWireConnections = packet.readByte(); - this.currentAcceptorConnections = packet.readByte(); - tile().markRender(); - } - else - { - super.read(packet, packetID); - } - } - - public void copyFrom(PartFramedWire otherCable) - { - this.isInsulated = otherCable.isInsulated; - this.color = otherCable.color; - this.connections = otherCable.connections; - this.material = otherCable.material; - this.currentWireConnections = otherCable.currentWireConnections; - this.currentAcceptorConnections = otherCable.currentAcceptorConnections; - this.setNetwork(otherCable.getNetwork()); - this.getNetwork().setBufferFor(this, otherCable.getNetwork().getBufferOf(otherCable)); - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/electrical/wire/framed/RenderPartWire.java b/archive/java/resonantinduction/electrical/wire/framed/RenderPartWire.java deleted file mode 100644 index 3344b286..00000000 --- a/archive/java/resonantinduction/electrical/wire/framed/RenderPartWire.java +++ /dev/null @@ -1,190 +0,0 @@ -package resonantinduction.electrical.wire.framed; - -import java.nio.FloatBuffer; -import java.util.Map; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.util.Icon; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.ForgeDirection; - -import org.lwjgl.BufferUtils; -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.core.render.InvertX; -import calclavia.lib.render.EnumColor; -import codechicken.lib.colour.Colour; -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.lighting.LightModel; -import codechicken.lib.render.CCModel; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.ColourMultiplier; -import codechicken.lib.render.IconTransformation; -import codechicken.lib.render.TextureUtils; -import codechicken.lib.vec.Rotation; -import codechicken.lib.vec.Translation; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * - * @author unpairedbracket - * - */ -@SideOnly(Side.CLIENT) -public class RenderPartWire -{ - private static final ResourceLocation WIRE_SHINE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_DIRECTORY + "white.png"); - public static final Map models; - public static final Map shinyModels; - public static Icon wireIcon; - public static Icon lainWireIcon; - public static Icon insulationIcon; - public static Icon breakIcon; - public static FloatBuffer location = BufferUtils.createFloatBuffer(4); - public static FloatBuffer specular = BufferUtils.createFloatBuffer(4); - public static FloatBuffer zero = BufferUtils.createFloatBuffer(4); - public static FloatBuffer defaultAmbient = BufferUtils.createFloatBuffer(4); - public static final RenderPartWire INSTANCE = new RenderPartWire(); - - static - { - models = CCModel.parseObjModels(new ResourceLocation("resonantinduction", "models/wire.obj"), 7, new InvertX()); - for (CCModel c : models.values()) - { - c.apply(new Translation(.5, 0, .5)); - c.computeLighting(LightModel.standardLightModel); - c.shrinkUVs(0.0005); - } - - shinyModels = CCModel.parseObjModels(new ResourceLocation("resonantinduction", "models/wireShine.obj"), 7, new InvertX()); - for (CCModel c : shinyModels.values()) - { - c.apply(new Translation(.5, 0, .5)); - c.computeLighting(LightModel.standardLightModel); - c.shrinkUVs(0.0005); - } - - loadBuffer(location, 0, 0, 0, 1); - loadBuffer(specular, 1, 1, 1, 1); - loadBuffer(zero, 0, 0, 0, 0); - loadBuffer(defaultAmbient, 0.4F, 0.4F, 0.4F, 1); - - GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, zero); - - GL11.glLight(GL11.GL_LIGHT3, GL11.GL_SPECULAR, specular); - - GL11.glMaterial(GL11.GL_FRONT, GL11.GL_SPECULAR, specular); - GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT, zero); - GL11.glMaterial(GL11.GL_FRONT, GL11.GL_DIFFUSE, zero); - GL11.glMaterialf(GL11.GL_FRONT, GL11.GL_SHININESS, 128f); - - } - - public static void loadBuffer(FloatBuffer buffer, float... src) - { - buffer.clear(); - buffer.put(src); - buffer.flip(); - } - - public void renderShine(PartFramedWire wire, double x, double y, double z, float f) - { - if (wire != null) - { - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_LIGHT0); - GL11.glDisable(GL11.GL_LIGHT1); - GL11.glEnable(GL11.GL_LIGHT3); - GL11.glLight(GL11.GL_LIGHT3, GL11.GL_POSITION, location); - - GL11.glTranslatef((float) x, (float) y, (float) z); - GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, zero); - - CCRenderState.reset(); - CCRenderState.useNormals(true); - CCRenderState.changeTexture(WIRE_SHINE); - CCRenderState.startDrawing(7); - renderSideShine(ForgeDirection.UNKNOWN, wire); - - byte renderSides = wire.getAllCurrentConnections(); - - for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - { - if (PartFramedWire.connectionMapContainsSide(renderSides, side)) - renderSideShine(side, wire); - } - CCRenderState.draw(); - - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_LIGHT0); - GL11.glEnable(GL11.GL_LIGHT1); - GL11.glDisable(GL11.GL_LIGHT3); - - GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, defaultAmbient); - - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glPopMatrix(); - } - } - - public static void registerIcons(IconRegister iconReg) - { - lainWireIcon = iconReg.registerIcon(Reference.PREFIX + "models/lainWire"); - breakIcon = iconReg.registerIcon(Reference.PREFIX + "wire"); - } - - public void renderStatic(PartFramedWire wire) - { - TextureUtils.bindAtlas(0); - CCRenderState.reset(); - CCRenderState.useModelColours(true); - CCRenderState.setBrightness(wire.world(), wire.x(), wire.y(), wire.z()); - renderSide(ForgeDirection.UNKNOWN, wire); - byte renderSides = wire.getAllCurrentConnections(); - - for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) - { - if (PartFramedWire.connectionMapContainsSide(renderSides, side)) - { - renderSide(side, wire); - } - } - } - - public void renderSide(ForgeDirection side, PartFramedWire wire) - { - String name = side.name().toLowerCase(); - name = name.equals("unknown") ? "center" : name; - Colour colour = wire.getMaterial().color; - renderPart(wireIcon, models.get(name), wire.x(), wire.y(), wire.z(), colour); - - if (wire.isInsulated()) - { - Colour insulationColour = new ColourRGBA(EnumColor.DYES[wire.getColor()].toColor().getRGB()); - renderPart(insulationIcon, models.get(name + "Insulation"), wire.x(), wire.y(), wire.z(), insulationColour); - } - } - - public void renderSideShine(ForgeDirection side, PartFramedWire wire) - { - String name = side.name().toLowerCase(); - name = name.equals("unknown") ? "center" : name; - renderPartShine(shinyModels.get(name)); - } - - public void renderPart(Icon icon, CCModel cc, double x, double y, double z, Colour colour) - { - cc.render(0, cc.verts.length, Rotation.sideOrientation(0, Rotation.rotationTo(0, 2)).at(codechicken.lib.vec.Vector3.center).with(new Translation(x, y, z)), new IconTransformation(icon), new ColourMultiplier(colour)); - } - - public void renderPartShine(CCModel cc) - { - cc.render(null, 0, 0); - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/electrical/wire/trait/TraitConductor.java b/archive/java/resonantinduction/electrical/wire/trait/TraitConductor.java deleted file mode 100644 index b3a703c8..00000000 --- a/archive/java/resonantinduction/electrical/wire/trait/TraitConductor.java +++ /dev/null @@ -1,167 +0,0 @@ -package resonantinduction.electrical.wire.trait; - -import java.util.HashSet; -import java.util.Set; - -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.api.energy.IConductor; -import universalelectricity.api.energy.IEnergyNetwork; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TileMultipart; - -public class TraitConductor extends TileMultipart implements IConductor -{ - public Set ueInterfaces = new HashSet(); - - @Override - public void copyFrom(TileMultipart that) - { - super.copyFrom(that); - - if (that instanceof TraitConductor) - { - this.ueInterfaces = ((TraitConductor) that).ueInterfaces; - } - } - - @Override - public void bindPart(TMultiPart part) - { - super.bindPart(part); - - if (part instanceof IConductor) - { - this.ueInterfaces.add((IConductor) part); - } - } - - @Override - public void partRemoved(TMultiPart part, int p) - { - super.partRemoved(part, p); - - if (part instanceof IConductor) - { - this.ueInterfaces.remove(part); - } - } - - @Override - public void clearParts() - { - super.clearParts(); - this.ueInterfaces.clear(); - } - - @Override - public Object[] getConnections() - { - for (IConductor conductor : this.ueInterfaces) - { - return conductor.getConnections(); - } - - return null; - } - - @Override - public IEnergyNetwork getNetwork() - { - for (IConductor conductor : this.ueInterfaces) - { - return conductor.getNetwork(); - } - - return null; - } - - @Override - public void setNetwork(IEnergyNetwork network) - { - for (IConductor conductor : this.ueInterfaces) - { - conductor.setNetwork(network); - } - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - for (IConductor conductor : this.ueInterfaces) - { - if (conductor.canConnect(direction.getOpposite())) - { - return true; - } - } - - return false; - } - - @Override - public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) - { - /** - * Try out different sides to try to inject energy into. - */ - if (this.partMap(from.ordinal()) == null) - { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir != from.getOpposite()) - { - TMultiPart part = this.partMap(dir.ordinal()); - - if (this.ueInterfaces.contains(part)) - { - return ((IConductor) part).onReceiveEnergy(from, receive, doReceive); - } - } - } - } - - return 0; - } - - @Override - public long onExtractEnergy(ForgeDirection from, long extract, boolean doExtract) - { - return 0; - } - - @Override - public float getResistance() - { - long energyLoss = 0; - - if (this.ueInterfaces.size() > 0) - { - for (IConductor conductor : this.ueInterfaces) - { - energyLoss += conductor.getResistance(); - } - - energyLoss /= this.ueInterfaces.size(); - } - - return energyLoss; - } - - @Override - public long getCurrentCapacity() - { - long capacitance = 0; - - if (this.ueInterfaces.size() > 0) - { - for (IConductor conductor : this.ueInterfaces) - { - capacitance += conductor.getCurrentCapacity(); - } - - capacitance /= this.ueInterfaces.size(); - } - - return capacitance; - } -} diff --git a/archive/java/resonantinduction/electrical/wire/trait/TraitEnergySink.java b/archive/java/resonantinduction/electrical/wire/trait/TraitEnergySink.java deleted file mode 100644 index 8c28ff29..00000000 --- a/archive/java/resonantinduction/electrical/wire/trait/TraitEnergySink.java +++ /dev/null @@ -1,125 +0,0 @@ -package resonantinduction.electrical.wire.trait; - -import ic2.api.energy.tile.IEnergySink; - -import java.util.HashSet; -import java.util.Set; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TileMultipart; - -public class TraitEnergySink extends TileMultipart implements IEnergySink -{ - public Set icInterfaces = new HashSet(); - - @Override - public void copyFrom(TileMultipart that) - { - super.copyFrom(that); - - if (that instanceof TraitEnergySink) - { - this.icInterfaces = ((TraitEnergySink) that).icInterfaces; - } - } - - @Override - public void bindPart(TMultiPart part) - { - super.bindPart(part); - - if (part instanceof IEnergySink) - { - this.icInterfaces.add((IEnergySink) part); - } - } - - @Override - public void partRemoved(TMultiPart part, int p) - { - super.partRemoved(part, p); - - if (part instanceof IEnergySink) - { - this.icInterfaces.remove(part); - } - } - - @Override - public void clearParts() - { - super.clearParts(); - this.icInterfaces.clear(); - } - - @Override - public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection from) - { - if (this.partMap(from.ordinal()) == null) - { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir != from.getOpposite()) - { - TMultiPart part = this.partMap(dir.ordinal()); - - if (this.icInterfaces.contains(part)) - { - return ((IEnergySink) part).acceptsEnergyFrom(emitter, from); - } - } - } - } - - return false; - } - - @Override - public double demandedEnergyUnits() - { - double demanded = 0; - - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - TMultiPart part = this.partMap(dir.ordinal()); - - if (this.icInterfaces.contains(part)) - { - return ((IEnergySink) part).demandedEnergyUnits(); - } - } - - return demanded; - } - - @Override - public double injectEnergyUnits(ForgeDirection from, double amount) - { - if (this.partMap(from.ordinal()) == null) - { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir != from.getOpposite()) - { - TMultiPart part = this.partMap(dir.ordinal()); - - if (this.icInterfaces.contains(part)) - { - return ((IEnergySink) part).injectEnergyUnits(from, amount); - } - } - } - } - - return amount; - } - - @Override - public int getMaxSafeInput() - { - return Integer.MAX_VALUE; - } - -} diff --git a/archive/java/resonantinduction/mechanical/ClientProxy.java b/archive/java/resonantinduction/mechanical/ClientProxy.java deleted file mode 100644 index 5193562c..00000000 --- a/archive/java/resonantinduction/mechanical/ClientProxy.java +++ /dev/null @@ -1,12 +0,0 @@ -package resonantinduction.mechanical; - -import resonantinduction.mechanical.render.MechanicalBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; - -public class ClientProxy extends CommonProxy -{ - public void preInit() - { - RenderingRegistry.registerBlockHandler(MechanicalBlockRenderingHandler.INSTANCE); - } -} diff --git a/archive/java/resonantinduction/mechanical/CommonProxy.java b/archive/java/resonantinduction/mechanical/CommonProxy.java deleted file mode 100644 index 61b8da9e..00000000 --- a/archive/java/resonantinduction/mechanical/CommonProxy.java +++ /dev/null @@ -1,8 +0,0 @@ -package resonantinduction.mechanical; - -import resonantinduction.core.prefab.ProxyBase; - -public class CommonProxy extends ProxyBase -{ - -} diff --git a/archive/java/resonantinduction/mechanical/Mechanical.java b/archive/java/resonantinduction/mechanical/Mechanical.java deleted file mode 100644 index cc291ea2..00000000 --- a/archive/java/resonantinduction/mechanical/Mechanical.java +++ /dev/null @@ -1,61 +0,0 @@ -package resonantinduction.mechanical; - -import net.minecraft.block.Block; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInduction; -import resonantinduction.core.Settings; -import resonantinduction.mechanical.belt.BlockConveyorBelt; -import resonantinduction.old.core.recipe.RecipeLoader; -import resonantinduction.old.transport.ResonantInductionTransport; -import calclavia.lib.network.PacketHandler; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.ModMetadata; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkMod; -import cpw.mods.fml.common.network.NetworkRegistry; -import dark.lib.CoreRegistry; - -/** - * Resonant Induction Archaic Module - * - * @author DarkCow, Calclavia - * - */ -@Mod(modid = Mechanical.ID, name = Mechanical.NAME, version = Reference.VERSION, dependencies = "required-after:" + ResonantInduction.ID) -@NetworkMod(channels = Reference.CHANNEL, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) -public class Mechanical -{ - /** Mod Information */ - public static final String ID = "ResonantInduction|Mechanical"; - public static final String NAME = Reference.NAME + " Mechanical"; - - @Instance(ID) - public static Mechanical INSTANCE; - - @SidedProxy(clientSide = "resonantinduction.mechanical.ClientProxy", serverSide = "resonantinduction.mechanical.CommonProxy") - public static CommonProxy proxy; - - @Mod.Metadata(ID) - public static ModMetadata metadata; - - public static Block blockConveyorBelt; - - @EventHandler - public void preInit(FMLPreInitializationEvent evt) - { - NetworkRegistry.instance().registerGuiHandler(this, proxy); - blockConveyorBelt = CoreRegistry.createNewBlock("RIConveyorBelt", ID, BlockConveyorBelt.class); - proxy.preInit(); - } - - @EventHandler - public void init(FMLInitializationEvent evt) - { - Settings.setModMetadata(metadata, ID, NAME); - proxy.init(); - } -} diff --git a/archive/java/resonantinduction/mechanical/belt/BlockConveyorBelt.java b/archive/java/resonantinduction/mechanical/belt/BlockConveyorBelt.java deleted file mode 100644 index b681c2c4..00000000 --- a/archive/java/resonantinduction/mechanical/belt/BlockConveyorBelt.java +++ /dev/null @@ -1,398 +0,0 @@ -package resonantinduction.mechanical.belt; - -import java.util.List; -import java.util.Set; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.mechanical.belt.TileConveyorBelt.SlantType; -import resonantinduction.mechanical.render.MechanicalBlockRenderingHandler; -import resonantinduction.old.client.render.RenderConveyorBelt; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.IExtraInfo.IExtraBlockInfo; - -/** The block for the actual conveyor belt! - * - * @author Calclavia, DarkGuardsman */ -public class BlockConveyorBelt extends BlockMachine implements IExtraBlockInfo -{ - public BlockConveyorBelt() - { - super("conveyorBelt"); - this.setBlockBounds(0, 0, 0, 1, 0.3f, 1); - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) - { - if (world.getBlockTileEntity(x, y, z) instanceof TileConveyorBelt) - { - TileConveyorBelt tileEntity = (TileConveyorBelt) world.getBlockTileEntity(x, y, z); - - if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN) - { - this.setBlockBounds(0f, 0f, 0f, 1f, 0.96f, 1f); - return; - } - if (tileEntity.getSlant() == SlantType.TOP) - { - this.setBlockBounds(0f, 0.68f, 0f, 1f, 0.96f, 1f); - return; - } - } - - this.setBlockBounds(0f, 0f, 0f, 1f, 0.3f, 1f); - } - - @Override - public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) - { - TileEntity t = world.getBlockTileEntity(x, y, z); - - if (t != null && t instanceof TileConveyorBelt) - { - TileConveyorBelt tileEntity = (TileConveyorBelt) t; - - if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN) - { - return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, (double) x + 1, (double) y + 1, (double) z + 1); - } - if (tileEntity.getSlant() == SlantType.TOP) - { - return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, (double) y + 0.68f, z + this.minZ, x + this.maxX, (double) y + 0.98f, z + this.maxZ); - } - } - - return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); - } - - @Override - public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) - { - - TileEntity t = world.getBlockTileEntity(x, y, z); - - if (t != null && t instanceof TileConveyorBelt) - { - TileConveyorBelt tileEntity = (TileConveyorBelt) t; - - if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN) - { - AxisAlignedBB boundBottom = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.3, z + 1); - AxisAlignedBB boundTop = null; - - ForgeDirection direction = tileEntity.getDirection(); - - if (tileEntity.getSlant() == SlantType.UP) - { - if (direction.offsetX > 0) - { - boundTop = AxisAlignedBB.getAABBPool().getAABB(x + (float) direction.offsetX / 2, y, z, x + 1, y + 0.8, z + 1); - } - else if (direction.offsetX < 0) - { - boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + (float) direction.offsetX / -2, y + 0.8, z + 1); - } - else if (direction.offsetZ > 0) - { - boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z + (float) direction.offsetZ / 2, x + 1, y + 0.8, z + 1); - } - else if (direction.offsetZ < 0) - { - boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.8, z + (float) direction.offsetZ / -2); - } - } - else if (tileEntity.getSlant() == SlantType.DOWN) - { - if (direction.offsetX > 0) - { - boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + (float) direction.offsetX / 2, y + 0.8, z + 1); - } - else if (direction.offsetX < 0) - { - boundTop = AxisAlignedBB.getAABBPool().getAABB(x + (float) direction.offsetX / -2, y, z, x + 1, y + 0.8, z + 1); - } - else if (direction.offsetZ > 0) - { - boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.8, z + (float) direction.offsetZ / 2); - } - else if (direction.offsetZ < 0) - { - boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z + (float) direction.offsetZ / -2, x + 1, y + 0.8, z + 1); - } - } - - if (par5AxisAlignedBB.intersectsWith(boundBottom)) - { - par6List.add(boundBottom); - } - if (boundTop != null && par5AxisAlignedBB.intersectsWith(boundTop)) - { - par6List.add(boundTop); - } - - return; - } - - if (tileEntity.getSlant() == SlantType.TOP) - { - AxisAlignedBB newBounds = AxisAlignedBB.getAABBPool().getAABB(x, y + 0.68, z, x + 1, y + 0.98, z + 1); - - if (newBounds != null && par5AxisAlignedBB.intersectsWith(newBounds)) - { - par6List.add(newBounds); - } - - return; - } - } - - AxisAlignedBB newBounds = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.3, z + 1); - - if (newBounds != null && par5AxisAlignedBB.intersectsWith(newBounds)) - { - par6List.add(newBounds); - } - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack stack) - { - super.onBlockPlacedBy(world, x, y, z, par5EntityLiving, stack); - int angle = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - int change = 2; - - switch (angle) - { - case 0: - change = 3; - break; - case 1: - change = 4; - break; - case 2: - change = 2; - break; - case 3: - change = 5; - break; - - } - world.setBlockMetadataWithNotify(x, y, z, change, 3); - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - int original = world.getBlockMetadata(x, y, z); - int change = 2; - - switch (original) - { - case 2: - change = 4; - break; - case 3: - change = 5; - break; - case 4: - change = 3; - break; - case 5: - change = 2; - break; - - } - - world.setBlockMetadataWithNotify(x, y, z, change, 3); - - return true; - } - - @Override - public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - TileConveyorBelt tileEntity = (TileConveyorBelt) world.getBlockTileEntity(x, y, z); - - int slantOrdinal = tileEntity.getSlant().ordinal() + 1; - - if (slantOrdinal >= SlantType.values().length) - { - slantOrdinal = 0; - } - - tileEntity.setSlant(SlantType.values()[slantOrdinal]); - - return true; - } - - /** Moves the entity if the conductor is powered. */ - @Override - public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) - { - TileConveyorBelt tileEntity = (TileConveyorBelt) world.getBlockTileEntity(x, y, z); - if (tileEntity.IgnoreList.contains(entity)) - { - return; - } - if (tileEntity.isFunctioning() && !world.isBlockIndirectlyGettingPowered(x, y, z)) - { - float acceleration = tileEntity.acceleration; - float maxSpeed = tileEntity.maxSpeed; - - SlantType slantType = tileEntity.getSlant(); - ForgeDirection direction = tileEntity.getDirection(); - - if (entity instanceof EntityLiving) - { - acceleration *= 5; - maxSpeed *= 10; - } - if (slantType == SlantType.UP) - { - if (entity.motionY < 0.2) - { - entity.addVelocity(0, 0.2, 0); - } - } - else if (slantType == SlantType.DOWN) - { - if (entity.motionY > -0.1) - { - entity.addVelocity(0, -0.1, 0); - } - } - // Move the entity based on the conveyor belt's direction. - entity.addVelocity(direction.offsetX * acceleration, 0, direction.offsetZ * acceleration); - - if (direction.offsetX != 0 && Math.abs(entity.motionX) > maxSpeed) - { - entity.motionX = direction.offsetX * maxSpeed; - entity.motionZ = 0; - } - - if (direction.offsetZ != 0 && Math.abs(entity.motionZ) > maxSpeed) - { - entity.motionZ = direction.offsetZ * maxSpeed; - entity.motionX = 0; - } - - entity.motionY += 0.0125f; - - if (entity instanceof EntityItem) - { - if (direction.offsetX != 0) - { - double difference = (z + 0.5) - entity.posZ; - entity.motionZ += difference * 0.1; - // entity.posZ = z + 0.5; - } - else if (direction.offsetZ != 0) - { - double difference = (x + 0.5) - entity.posX; - entity.motionX += difference * 0.1; - // /entity.posX = x + 0.5; - } - - ((EntityItem) entity).age++; - - boolean foundSneaking = false; - for (EntityPlayer player : (List) world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1))) - { - if (player.isSneaking()) - foundSneaking = true; - } - - if (foundSneaking) - ((EntityItem) entity).delayBeforeCanPickup = 0; - else - ((EntityItem) entity).delayBeforeCanPickup = 20; - entity.onGround = false; - } - - } - } - - @Override - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - list.add(new Pair, TileEntitySpecialRenderer>(TileConveyorBelt.class, new RenderConveyorBelt())); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("ALConveyorBelt", TileConveyorBelt.class)); - } - - /** Returns the TileEntity used by this block. */ - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileConveyorBelt(); - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderType() - { - return MechanicalBlockRenderingHandler.BLOCK_RENDER_ID; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public int damageDropped(int par1) - { - return 0; - } - - @Override - public boolean hasExtraConfigs() - { - return false; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - // TODO Auto-generated method stub - - } - - @Override - public void loadOreNames() - { - // TODO Auto-generated method stub - - } -} diff --git a/archive/java/resonantinduction/mechanical/belt/TileConveyorBelt.java b/archive/java/resonantinduction/mechanical/belt/TileConveyorBelt.java deleted file mode 100644 index 7ffc0b03..00000000 --- a/archive/java/resonantinduction/mechanical/belt/TileConveyorBelt.java +++ /dev/null @@ -1,255 +0,0 @@ -package resonantinduction.mechanical.belt; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.ResonantInduction; -import resonantinduction.old.api.IBelt; -import resonantinduction.old.core.recipe.RecipeLoader; -import resonantinduction.old.transport.TileEntityAssembly; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.network.PacketHandler; -import calclavia.lib.prefab.tile.IRotatable; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; - -/** - * Conveyer belt TileEntity that allows entities of all kinds to be moved - * - * @author DarkGuardsman - */ -public class TileConveyorBelt extends TileEntityAssembly implements IBelt, IRotatable -{ - - public enum SlantType - { - NONE, UP, DOWN, TOP - } - - public static final int MAX_FRAME = 13; - public static final int MAX_SLANT_FRAME = 23; - /** Packet name to ID the packet containing info on the angle of the belt */ - public static final String slantPacketID = "slantPacket"; - /** Acceleration of entities on the belt */ - public final float acceleration = 0.01f; - /** max speed of entities on the belt */ - public final float maxSpeed = 0.1f; - /** Current rotation of the model wheels */ - public float wheelRotation = 0; - /** Frame count for texture animation from 0 - maxFrame */ - private int animFrame = 0; - private SlantType slantType = SlantType.NONE; - /** Entities that are ignored allowing for other tiles to interact with them */ - public List IgnoreList = new ArrayList(); - - public TileConveyorBelt() - { - super(1); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - /* PROCESSES IGNORE LIST AND REMOVES UNNEED ENTRIES */ - Iterator it = this.IgnoreList.iterator(); - while (it.hasNext()) - { - if (!this.getAffectedEntities().contains(it.next())) - { - it.remove(); - } - } - if (this.worldObj.isRemote && this.isFunctioning()) - { - if (this.ticks % 10 == 0 && this.worldObj.isRemote && this.worldObj.getBlockId(this.xCoord - 1, this.yCoord, this.zCoord) != RecipeLoader.blockConveyorBelt.blockID && this.worldObj.getBlockId(xCoord, yCoord, zCoord - 1) != RecipeLoader.blockConveyorBelt.blockID) - { - this.worldObj.playSound(this.xCoord, this.yCoord, this.zCoord, "mods.assemblyline.conveyor", 0.5f, 0.7f, true); - } - this.wheelRotation = (40 + this.wheelRotation) % 360; - - float wheelRotPct = wheelRotation / 360f; - - // Sync the animation. Slant belts are slower. - if (this.getSlant() == SlantType.NONE || this.getSlant() == SlantType.TOP) - { - this.animFrame = (int) (wheelRotPct * MAX_FRAME); - if (this.animFrame < 0) - this.animFrame = 0; - if (this.animFrame > MAX_FRAME) - this.animFrame = MAX_FRAME; - } - else - { - this.animFrame = (int) (wheelRotPct * MAX_SLANT_FRAME); - if (this.animFrame < 0) - this.animFrame = 0; - if (this.animFrame > MAX_SLANT_FRAME) - this.animFrame = MAX_SLANT_FRAME; - } - } - - } - - @Override - public boolean canFunction() - { - return super.canFunction() && !this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord); - } - - @Override - public Packet getDescriptionPacket() - { - if (this.slantType != SlantType.NONE) - { - return ResonantInduction.PACKET_TILE.getPacket(this, slantPacketID, this.isFunctioning(), this.slantType.ordinal()); - } - return super.getDescriptionPacket(); - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput dis, Player player) - { - if (!super.simplePacket(id, dis, player) && this.worldObj.isRemote) - { - try - { - if (id.equalsIgnoreCase(slantPacketID)) - { - this.functioning = dis.readBoolean(); - this.slantType = SlantType.values()[dis.readInt()]; - return true; - } - } - catch (Exception e) - { - e.printStackTrace(); - } - } - return false; - } - - public SlantType getSlant() - { - return slantType; - } - - public void setSlant(SlantType slantType) - { - if (slantType == null) - { - slantType = SlantType.NONE; - } - this.slantType = slantType; - this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - @Override - public void setDirection(ForgeDirection facingDirection) - { - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, facingDirection.ordinal(), 3); - } - - @Override - public ForgeDirection getDirection() - { - return ForgeDirection.getOrientation(this.getBlockMetadata()); - } - - @Override - public List getAffectedEntities() - { - return worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(this.xCoord, this.yCoord, this.zCoord, this.xCoord + 1, this.yCoord + 1, this.zCoord + 1)); - } - - public int getAnimationFrame() - { - return this.animFrame; - } - - /** NBT Data */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.slantType = SlantType.values()[nbt.getByte("slant")]; - } - - /** Writes a tile entity to NBT. */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setByte("slant", (byte) this.slantType.ordinal()); - } - - @Override - public void ignoreEntity(Entity entity) - { - if (!this.IgnoreList.contains(entity)) - { - this.IgnoreList.add(entity); - } - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return direction == ForgeDirection.DOWN; - } - - @Override - public void refresh() - { - super.refresh(); - if (this.worldObj != null && !this.worldObj.isRemote) - { - Vector3 face = new Vector3(this).modifyPositionFromSide(this.getDirection()); - Vector3 back = new Vector3(this).modifyPositionFromSide(this.getDirection().getOpposite()); - TileEntity front, rear; - if (this.slantType == SlantType.DOWN) - { - face.translate(new Vector3(0, -1, 0)); - back.translate(new Vector3(0, 1, 0)); - } - else if (this.slantType == SlantType.UP) - { - face.translate(new Vector3(0, 1, 0)); - back.translate(new Vector3(0, -1, 0)); - } - else - { - return; - } - front = face.getTileEntity(this.worldObj); - rear = back.getTileEntity(this.worldObj); - if (front instanceof TileEntityAssembly) - { - this.getTileNetwork().mergeNetwork(((TileEntityAssembly) front).getTileNetwork(), this); - this.connectedTiles.add(front); - } - if (rear instanceof TileEntityAssembly) - { - this.getTileNetwork().mergeNetwork(((TileEntityAssembly) rear).getTileNetwork(), this); - this.connectedTiles.add(rear); - } - - } - } - - @Override - public int getWattLoad() - { - return 5; - } - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/BlockKitchenSink.java b/archive/java/resonantinduction/mechanical/fluid/BlockKitchenSink.java deleted file mode 100644 index 192c7e28..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/BlockKitchenSink.java +++ /dev/null @@ -1,114 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.client.render.BlockRenderHelper; -import calclavia.lib.utility.FluidHelper; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockKitchenSink extends BlockMachine -{ - public BlockKitchenSink() - { - super(Settings.CONFIGURATION, "FluidSink", Material.iron); - this.setResistance(4f); - this.setHardness(4f); - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileKitchenSink(); - } - - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) - { - return FluidHelper.playerActivatedFluidItem(world, x, y, z, entityplayer, side); - } - - @Override - public boolean onUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - int meta = par1World.getBlockMetadata(x, y, z); - int metaGroup = meta % 4; - - if (meta == (metaGroup * 4) + 3) - { - par1World.setBlockMetadataWithNotify(x, y, z, (metaGroup * 4), 3); - return true; - } - else - { - par1World.setBlockMetadataWithNotify(x, y, z, meta + 1, 3); - return true; - } - // return false; - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack itemStack) - { - int meta = world.getBlockMetadata(x, y, z); - int angle = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - TileEntity ent = world.getBlockTileEntity(x, y, z); - - world.setBlockMetadataWithNotify(x, y, z, angle * 4, 3); - if (ent instanceof TileEntityAdvanced) - { - ((TileEntityAdvanced) world.getBlockTileEntity(x, y, z)).initiate(); - } - - world.notifyBlocksOfNeighborChange(x, y, z, this.blockID); - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - - return new ItemStack(this, 1, 0); - - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderType() - { - return BlockRenderHelper.renderID; - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("FluidSink", TileKitchenSink.class)); - - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/BlockReleaseValve.java b/archive/java/resonantinduction/mechanical/fluid/BlockReleaseValve.java deleted file mode 100644 index a630910e..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/BlockReleaseValve.java +++ /dev/null @@ -1,93 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import java.util.Random; -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.core.recipe.RecipeLoader; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockReleaseValve extends BlockMachine -{ - public BlockReleaseValve() - { - super(Settings.CONFIGURATION, "ReleaseValve", Material.iron); - this.setHardness(1f); - this.setResistance(5f); - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityReleaseValve(); - } - - @Override - public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) - { - return true; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderType() - { - return -1; - } - - @Override - public int damageDropped(int meta) - { - return 0; - } - - @Override - public int quantityDropped(Random par1Random) - { - return 1; - } - - @Override - public void onNeighborBlockChange(World par1World, int x, int y, int z, int side) - { - super.onNeighborBlockChange(par1World, x, y, z, side); - - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - return new ItemStack(RecipeLoader.blockReleaseValve, 1, 0); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("ReleaseValve", TileEntityReleaseValve.class)); - - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/BlockSteamPiston.java b/archive/java/resonantinduction/mechanical/fluid/BlockSteamPiston.java deleted file mode 100644 index 1985cf8d..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/BlockSteamPiston.java +++ /dev/null @@ -1,91 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import java.util.Random; -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.block.BlockMachine; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockSteamPiston extends BlockMachine -{ - - public BlockSteamPiston() - { - super(Settings.CONFIGURATION, "SteamEngine", Material.iron); - - } - - @Override - public boolean onUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - int angle = MathHelper.floor_double((par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - int metadata = par1World.getBlockMetadata(x, y, z); - if (metadata < 3) - { - par1World.setBlock(x, y, z, blockID, metadata + angle, 3); - } - else - { - par1World.setBlock(x, y, z, blockID, 0, 3); - } - return true; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderType() - { - return -1; - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntitySteamPiston(); - - } - - @Override - public int idDropped(int par1, Random par2Random, int par3) - { - return this.blockID; - } - - @Override - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { - int var5 = par1World.getBlockId(par2, par3, par4); - int var6 = par1World.getBlockId(par2, par3 + 1, par4); - return (var5 == 0 || blocksList[var5].blockMaterial.isReplaceable()) && (var6 == 0 || blocksList[var6].blockMaterial.isReplaceable()); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("FMSteamPiston", TileEntitySteamPiston.class)); - - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/BlockTank.java b/archive/java/resonantinduction/mechanical/fluid/BlockTank.java deleted file mode 100644 index 16bf305d..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/BlockTank.java +++ /dev/null @@ -1,153 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import net.minecraft.block.material.Material; -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.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.mechanical.fluid.pipes.FluidPartsMaterial; -import resonantinduction.mechanical.fluid.pipes.ItemBlockPipe; -import resonantinduction.mechanical.fluid.pipes.TileEntityPipe; -import resonantinduction.old.client.render.BlockRenderHelper; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.FluidHelper; -import calclavia.lib.utility.HelperMethods; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockTank extends BlockMachine -{ - public static int tankVolume = 16; - - public BlockTank() - { - super(Settings.CONFIGURATION, "FluidTank", Material.rock); - this.setHardness(1f); - this.setResistance(5f); - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderType() - { - return BlockRenderHelper.renderID; - } - - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) - { - return FluidHelper.playerActivatedFluidItem(world, x, y, z, entityplayer, side); - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityTank(); - } - - @Override - public boolean hasComparatorInputOverride() - { - return true; - } - - @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int par5) - { - TileEntityTank tileEntity = (TileEntityTank) world.getBlockTileEntity(x, y, z); - if (tileEntity != null && tileEntity.getTileNetwork().getNetworkTankInfo().fluid != null) - { - return 15 * (tileEntity.getTileNetwork().getNetworkTankInfo().fluid.amount / tileEntity.getTileNetwork().getNetworkTankInfo().capacity); - } - return 0; - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - return new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z)); - } - - @Override - public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) - { - ArrayList ret = new ArrayList(); - TileEntity entity = world.getBlockTileEntity(x, y, z); - if (entity instanceof TileEntityPipe) - { - ret.add(new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z))); - } - return ret; - } - - @SuppressWarnings("unchecked") - @Override - public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (FluidPartsMaterial data : FluidPartsMaterial.values()) - { - par3List.add(new ItemStack(this, 1, data.ordinal() * FluidPartsMaterial.spacing)); - } - } - - @Override - public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (!world.isRemote) - { - ItemStack dropStack = ItemBlockPipe.getWrenchedItem(world, new Vector3(x, y, z)); - if (dropStack != null) - { - if (entityPlayer.getHeldItem() == null) - { - entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, dropStack); - } - else - { - HelperMethods.dropItemStack(world, new Vector3(x, y, z), dropStack, false); - } - world.setBlockToAir(x, y, z); - } - } - return true; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - BlockTank.tankVolume = config.get("settings", "TankBucketVolume", 16, "Number of buckets each tank block can store, Settings this to zero is the same as one").getInt(); - - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("FluidTank", TileEntityTank.class)); - - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/EnumFluid.java b/archive/java/resonantinduction/mechanical/fluid/EnumFluid.java deleted file mode 100644 index 62f73b52..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/EnumFluid.java +++ /dev/null @@ -1,23 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import net.minecraftforge.fluids.Fluid; - -/** - * Some common Fluid that other mods use - * - * @author DarkGuardsman - */ -public enum EnumFluid -{ - FUEL(new Fluid("fuel").setUnlocalizedName("fluid.fuel.name")), - OIL(new Fluid("oil").setUnlocalizedName("fluid.oil.name").setDensity(1500).setViscosity(4700)), - BIOFUEL(new Fluid("biofuel").setUnlocalizedName("fluid.biofuel.name")), - WASTE(new Fluid("waste").setUnlocalizedName("fluid.waste.name").setDensity(1300).setViscosity(1800)); - - public final Fluid fluid; - - private EnumFluid(Fluid fluid) - { - this.fluid = fluid; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/EnumGas.java b/archive/java/resonantinduction/mechanical/fluid/EnumGas.java deleted file mode 100644 index d2d0d83b..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/EnumGas.java +++ /dev/null @@ -1,77 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import com.builtbroken.common.science.ChemElement; -import com.builtbroken.common.science.ChemicalCompound; - -/** - * Enum of gases used to create all the gas fluids - * - * @author DarkGuardsman - */ -public enum EnumGas -{ - CARBONDIOXIDE("Carbon DiOxide", false), OXYGEN(ChemElement.Oxygen, 2f, true), - BUTANE(ChemicalCompound.BUTANE, true), METHANE(ChemicalCompound.METHANE, true), - NATURAL_GAS("Natural Gas", false), PROPANE("Propane", false); - - /** Name used when creating this as a fluid */ - public final String fluidName; - /** Name used to display to the players */ - public final String name; - /** - * Object data reference that was used to create this gas, can be a ChemicalCompound, Element, - * or Fluid - */ - public final Object data; - public boolean enabled = false; - /** Only used for elements since when used as a gas they sometimes bind together */ - private float molePerGasMolecule = 1.0f; - /** Local instance of the gas used when the getGas method is called */ - private Gas gas; - - private EnumGas(String name, boolean enabled) - { - this.fluidName = name.replace(" ", "").toLowerCase(); - this.name = name; - data = null; - this.enabled = enabled; - } - - private EnumGas(ChemicalCompound compound, boolean enabled) - { - this.fluidName = "gas:" + compound.compoundName.replace(" ", "").toLowerCase(); - this.name = compound.compoundName; - data = compound; - this.enabled = enabled; - } - - private EnumGas(ChemElement element, float molesPerGasMolecule, boolean enabled) - { - this.fluidName = "gas:" + element.elementName.replace(" ", "").toLowerCase(); - this.name = element.elementName; - data = element; - this.enabled = enabled; - this.molePerGasMolecule = molesPerGasMolecule; - } - - public Gas getGas() - { - if (gas == null) - { - gas = new Gas(fluidName); - if (data instanceof ChemElement) - { - gas.setDensity((int) ((ChemElement) data).density * 1000); - } - else if (data instanceof ChemicalCompound) - { - gas.setDensity((int) ((ChemicalCompound) data).density * 1000); - } - else - { - gas.setDensity(-1000); - } - } - return gas; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/FilteredTank.java b/archive/java/resonantinduction/mechanical/fluid/FilteredTank.java deleted file mode 100644 index dff8186a..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/FilteredTank.java +++ /dev/null @@ -1,60 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; - -/** - * Tank that has a filter on the fluid ids it will accept - * - * @author DarkGuardsman - */ -public class FilteredTank extends FluidTank -{ - private List fluidIds = new ArrayList(); - boolean gas = true; - boolean liquid = true; - - public FilteredTank(int capacity, int... fluidIds) - { - this(capacity, true, true, fluidIds); - } - - public FilteredTank(int capacity, boolean gas, boolean liquid, int... fluidIds) - { - super(capacity); - this.gas = gas; - this.liquid = liquid; - for (int id : fluidIds) - { - this.fluidIds.add(id); - } - } - - public FilteredTank(FluidStack stack, int capacity) - { - super(stack, capacity); - } - - public FilteredTank(Fluid fluid, int amount, int capacity) - { - super(fluid, amount, capacity); - } - - @Override - public int fill(FluidStack resource, boolean doFill) - { - if (resource != null && resource.getFluid() != null && (!gas || gas && resource.getFluid().isGaseous()) && (!liquid || liquid && !resource.getFluid().isGaseous())) - { - if (fluidIds.contains(resource.fluidID)) - { - return super.fill(resource, doFill); - } - } - return 0; - } - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/FluidCraftingHandler.java b/archive/java/resonantinduction/mechanical/fluid/FluidCraftingHandler.java deleted file mode 100644 index 83937557..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/FluidCraftingHandler.java +++ /dev/null @@ -1,298 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import resonantinduction.mechanical.fluid.network.IFluidRecipeCrafter; -import resonantinduction.mechanical.fluid.network.FluidRecipeInfo.SimpleFluidRecipe; -import calclavia.lib.utility.FluidHelper; - -import com.builtbroken.common.Pair; -import com.builtbroken.common.Triple; - -/** - * Handles all kinds of process involving mixing Fluids with other fluids and/or Items, Blocks, - * ItemStack, or Liquids - * - * @author DarkGuardsman - */ -public class FluidCraftingHandler -{ - /** Map of results of two different liquids merging */ - public static HashMap, Object> fluidMergeResults = new HashMap, Object>(); - - static - { - registerRecipe(FluidRegistry.LAVA, FluidRegistry.WATER, Block.obsidian); - registerRecipe(FluidRegistry.WATER, FluidRegistry.LAVA, Block.cobblestone); - } - - /** - * Creates a very basic A + B = C result for mixing two objects together. Suggest that the use - * of a SimpleFluidRecipe i used instead to create a more refined fluid mixing that takes into - * account ratios, and fluid volumes - */ - public static void registerRecipe(Object a, Object b, Object c) - { - if (a != null && b != null && c != null) - { - registerFluidRecipe(new SimpleFluidRecipe(a, b, c)); - } - } - - public static void registerFluidRecipe(SimpleFluidRecipe recipe) - { - if (recipe != null && recipe.recipeObjectA != null && recipe.recipeObjectB != null && recipe.recipeObjectC != null) - { - if (!fluidMergeResults.containsKey(new Pair(recipe.recipeObjectA, recipe.recipeObjectB))) - { - fluidMergeResults.put(new Pair(recipe.recipeObjectA, recipe.recipeObjectB), recipe); - } - if (recipe.canBeReversed) - { - if (!fluidMergeResults.containsKey(new Pair(recipe.recipeObjectB, recipe.recipeObjectA))) - { - fluidMergeResults.put(new Pair(recipe.recipeObjectB, recipe.recipeObjectA), recipe); - } - } - } - } - - public static void loadPotionRecipes() - { - // TODO load the process by which a potion would be created threw fliud crafting - } - - /** - * Does the fluid recipe crafting for the crafter object. Requires that the object fully use all - * methods from the #IFluidRecipeCrafter - * - * @param crafter - crafting object, recommend it be a tile but can be anything as long as the - * method are used correctly. In some recipe cases when the setRecipeObjectContent nothing will - * be used. If result is null assume not crafting was performed. If there is a result the - * crafter couldn't use the output to reduce the input values. From here the IFluidRecipeCrafter - * will need to process the output and decress the input values correctly - */ - public static void craft(IFluidRecipeCrafter crafter) - { - Object received = crafter.getReceivingObjectStack(); - int receivedVolume = 0; - Object input = crafter.getInputObjectStack(); - int inputVolume = 0; - if (crafter != null && received != null && input != null) - { - // Trip input values so they will match the correct mapped values - if (received instanceof FluidStack) - { - receivedVolume = ((FluidStack) received).amount; - received = FluidHelper.getStack((FluidStack) received, 1); - } - if (received instanceof ItemStack) - { - receivedVolume = ((ItemStack) received).stackSize; - ((ItemStack) received).stackSize = 1; - } - if (input instanceof FluidStack) - { - inputVolume = ((FluidStack) input).amount; - input = FluidHelper.getStack((FluidStack) input, 1); - } - if (input instanceof ItemStack) - { - receivedVolume = ((ItemStack) input).stackSize; - ((ItemStack) input).stackSize = 1; - } - - // Get result - Object result = fluidMergeResults.containsKey(new Pair(crafter.getReceivingObjectStack(), crafter.getInputObjectStack())); - - // reset stack sized - if (received instanceof FluidStack) - { - ((FluidStack) received).amount = receivedVolume; - } - if (received instanceof ItemStack) - { - ((ItemStack) received).stackSize = receivedVolume; - } - if (input instanceof FluidStack) - { - ((FluidStack) input).amount = inputVolume; - } - if (input instanceof ItemStack) - { - ((ItemStack) input).stackSize = inputVolume; - } - if (result != null) - { - if (result instanceof SimpleFluidRecipe) - { - Triple> re = ((SimpleFluidRecipe) result).mix(crafter.getInputObjectStack(), crafter.getInputObjectStack()); - crafter.setRecipeObjectContent(received, re.getA(), input, re.getB(), re.getC().left(), re.getC().right()); - } - } - crafter.setRecipeObjectContent(received, 0, input, 0, result, 0); - } - } - - /** Merges two fluids together that don't result in damage to the network */ - public static FluidStack mergeFluidStacks(FluidStack stackOne, FluidStack stackTwo) - { - FluidStack resultStack = null; - - if (stackTwo != null && stackOne != null && stackOne.isFluidEqual(stackTwo)) - { - resultStack = stackOne.copy(); - resultStack.amount += stackTwo.amount; - } - else if (stackOne == null && stackTwo != null) - { - resultStack = stackTwo.copy(); - } - else if (stackOne != null && stackTwo == null) - { - resultStack = stackOne.copy(); - } - else if (stackTwo != null && stackOne != null && !stackOne.isFluidEqual(stackTwo)) - { - System.out.println("preforming fluid merge event"); - Object result = fluidMergeResults.get(new Pair(stackOne.getFluid(), stackTwo.getFluid())); - /* Try to merge fluids by mod defined rules first */ - if (result != null) - { - System.out.println("result = " + result.toString()); - if (result instanceof Fluid) - { - resultStack = new FluidStack(((Fluid) result).getID(), stackOne.amount + stackTwo.amount); - } - else if (result instanceof FluidStack) - { - resultStack = ((FluidStack) result).copy(); - resultStack.amount = stackOne.amount + stackTwo.amount; - } - else if (result instanceof String && ((String) result).startsWith("Liquid:")) - { - resultStack = new FluidStack(FluidRegistry.getFluid(((String) result).replace("Liquid:", "")), stackOne.amount + stackTwo.amount); - } - else if (result instanceof SimpleFluidRecipe) - { - Triple> re = ((SimpleFluidRecipe) result).mix(stackOne, stackTwo); - if (re.getC().left() instanceof FluidStack) - { - resultStack = FluidHelper.getStack((FluidStack) re.getC().left(), re.getC().right()); - } - else if (re.getC().left() instanceof FluidStack) - { - resultStack = new FluidStack((Fluid) re.getC().left(), re.getC().right()); - } - } - } - if (resultStack == null) - { - System.out.println("Merging fluids into a waste fluid stack"); - Fluid waste = FluidRegistry.getFluid("waste"); - if (waste == null) - { - System.out.println("[FluidNetworkHelper] Attempted to merge two fluids into a waste fluid stack but Forge fluid registry return null for waste. Possible that waste fluid was disabled or not registered correctly."); - return null; - } - /* If both liquids are waste then copy fluidStack lists then merge */ - if (stackTwo.fluidID == waste.getID() && stackOne.fluidID == waste.getID()) - { - List stacks = new ArrayList(); - stacks.addAll(getStacksFromWaste(stackOne.copy())); - stacks.addAll(getStacksFromWaste(stackTwo.copy())); - resultStack = createNewWasteStack(stacks.toArray(new FluidStack[stacks.size()])); - } - else - { - resultStack = createNewWasteStack(stackOne.copy(), stackTwo.copy()); - } - } - } - return resultStack; - } - - /** Gets the fluidStacks that make up a waste FluidStack */ - public static List getStacksFromWaste(FluidStack wasteStack) - { - List stacks = new ArrayList(); - if (wasteStack.fluidID == FluidRegistry.getFluidID("waste")) - { - for (int i = 1; i <= wasteStack.tag.getInteger("liquids"); i++) - { - FluidStack readStack = FluidStack.loadFluidStackFromNBT(wasteStack.tag.getCompoundTag("Liquid" + i)); - if (readStack != null) - { - stacks.add(readStack); - } - } - } - return stacks; - } - - /** Creates a new waste stack from the listed fluidStacks */ - public static FluidStack createNewWasteStack(FluidStack... liquids) - { - FluidStack stack = new FluidStack(FluidRegistry.getFluid("waste"), 0); - stack.tag = new NBTTagCompound(); - if (liquids != null) - { - int count = 0; - for (int i = 0; i < liquids.length; i++) - { - if (liquids[i] != null) - { - if (!liquids[i].getFluid().equals(stack.getFluid())) - { - count++; - stack.tag.setCompoundTag("Liquids" + count, liquids[i].writeToNBT(new NBTTagCompound())); - stack.amount += liquids[i].amount; - } - else - { - for (FluidStack loadStack : getStacksFromWaste(liquids[i])) - { - count++; - stack.tag.setCompoundTag("Liquids" + count, loadStack.writeToNBT(new NBTTagCompound())); - stack.amount += loadStack.amount; - } - } - } - } - stack.tag.setInteger("liquids", count); - } - return stack; - } - - /** - * Gets the result of the merge of the two fluids, order of merge does matter and will produce - * different results. - * - * @param stackOne - Receiving fluid, eg the one that is not moving - * @param stackTwo - Flowing fluid, eg the one moving into the first fluid - * @return Object result of the merge, can be anything from string, ItemStack, Item, Block, or - * enum action - */ - public static Object getMergeResult(FluidStack stackOne, FluidStack stackTwo) - { - FluidStack sampleStackOne, sampleStackTwo; - if (stackOne != null && stackTwo != null && !stackOne.equals(stackTwo)) - { - sampleStackOne = FluidHelper.getStack(stackOne, 1); - sampleStackTwo = FluidHelper.getStack(stackTwo, 1); - if (fluidMergeResults.containsKey(new Pair(sampleStackOne, sampleStackTwo))) - { - return fluidMergeResults.get(new Pair(sampleStackOne, sampleStackTwo)); - } - } - return null; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/Gas.java b/archive/java/resonantinduction/mechanical/fluid/Gas.java deleted file mode 100644 index faa29fc4..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/Gas.java +++ /dev/null @@ -1,19 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import net.minecraftforge.fluids.Fluid; - -/** - * These is an extension of the Fluid system forcing it to be a gas on creation - * - * @author Archadia, DarkGuardsman - */ -public class Gas extends Fluid -{ - - public Gas(String name) - { - super(name); - this.isGaseous = true; - this.density = -1000; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/GasTank.java b/archive/java/resonantinduction/mechanical/fluid/GasTank.java deleted file mode 100644 index 0df517ca..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/GasTank.java +++ /dev/null @@ -1,40 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; - -/** - * Version of the fluid tank that is restricted to gases only - * - * @author DarkGuardsman - */ -public class GasTank extends FluidTank -{ - - public GasTank(int capacity) - { - super(capacity); - } - - public GasTank(FluidStack stack, int capacity) - { - super(stack, capacity); - } - - public GasTank(Fluid fluid, int amount, int capacity) - { - super(fluid, amount, capacity); - } - - @Override - public int fill(FluidStack resource, boolean doFill) - { - if (resource != null && resource.getFluid() != null && resource.getFluid().isGaseous()) - { - return super.fill(resource, doFill); - } - return 0; - } - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/ItemFluidCan.java b/archive/java/resonantinduction/mechanical/fluid/ItemFluidCan.java deleted file mode 100644 index a6fb504d..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/ItemFluidCan.java +++ /dev/null @@ -1,90 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.ItemFluidContainer; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.old.transport.ResonantInductionTransport; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Small fluid can that is designed to store up to one bucket of fluid. Doesn't work like a bucket - * as it is sealed with a pressure cap. This can is designed to work with tools or machines only. - * - * @author DarkGuardsman - */ -public class ItemFluidCan extends ItemFluidContainer -{ - public static final String FLUID_NBT = "FluidStack"; - - @SideOnly(Side.CLIENT) - public Icon[] icons; - - public ItemFluidCan() - { - super(ResonantInductionTransport.CONFIGURATION.getItem("FluidCan", DarkCore.getNextItemId()).getInt()); - this.setUnlocalizedName("FluidCan"); - this.setCreativeTab(ResonantInductionTabs.tabHydraulic()); - this.setMaxStackSize(1); - this.setMaxDamage(100); - this.setNoRepair(); - this.capacity = FluidContainerRegistry.BUCKET_VOLUME * 2; - this.setContainerItem(this); - } - - @Override - public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) - { - FluidStack fluidStack = this.drain(par1ItemStack, Integer.MAX_VALUE, false); - if (fluidStack != null) - { - return false; - } - return true; - } - - @Override - public String getItemDisplayName(ItemStack par1ItemStack) - { - String fluid = ""; - FluidStack fluidStack = this.drain(par1ItemStack, Integer.MAX_VALUE, false); - if (fluidStack != null) - { - fluid = fluidStack.getFluid().getLocalizedName(); - } - return ("" + (fluid + " " + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(par1ItemStack) + ".name"))).trim(); - } - - @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) - { - FluidStack fluidStack = this.drain(par1ItemStack, Integer.MAX_VALUE, false); - if (fluidStack != null) - { - par3List.add("Volume: " + fluidStack.amount + "mb"); - } - } - - @Override - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - par3List.add(new ItemStack(this)); - - ItemStack waterCan = new ItemStack(this); - this.fill(waterCan, new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), true); - par3List.add(waterCan); - - ItemStack lavaCan = new ItemStack(this); - this.fill(lavaCan, new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME), true); - par3List.add(lavaCan); - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/LiquidTank.java b/archive/java/resonantinduction/mechanical/fluid/LiquidTank.java deleted file mode 100644 index 03a9579d..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/LiquidTank.java +++ /dev/null @@ -1,40 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; - -/** - * Version of the fluid tank that only supports liquids - * - * @author DarkGuardsman - */ -public class LiquidTank extends FluidTank -{ - - public LiquidTank(int capacity) - { - super(capacity); - } - - public LiquidTank(FluidStack stack, int capacity) - { - super(stack, capacity); - } - - public LiquidTank(Fluid fluid, int amount, int capacity) - { - super(fluid, amount, capacity); - } - - @Override - public int fill(FluidStack resource, boolean doFill) - { - if (resource != null && resource.getFluid() != null && !resource.getFluid().isGaseous()) - { - return super.fill(resource, doFill); - } - return 0; - } - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/TileEntityReleaseValve.java b/archive/java/resonantinduction/mechanical/fluid/TileEntityReleaseValve.java deleted file mode 100644 index 8ae474b9..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/TileEntityReleaseValve.java +++ /dev/null @@ -1,113 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.core.tilenetwork.ITileConnector; -import resonantinduction.mechanical.fluid.network.NetworkPipes; -import resonantinduction.mechanical.fluid.prefab.TileEntityFluidDevice; -import resonantinduction.old.api.fluid.INetworkPipe; -import calclavia.lib.utility.HelperMethods; -import dark.lib.interfaces.IReadOut; - -public class TileEntityReleaseValve extends TileEntityFluidDevice implements ITileConnector, IReadOut -{ - public TileEntity[] connected = new TileEntity[6]; - - @Override - public void updateEntity() - { - super.updateEntity(); - - if (this.ticks % 10 == 0) - { - this.refresh(); - if (!this.worldObj.isRemote && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) - { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (connected[dir.ordinal()] instanceof IFluidHandler && !(connected[dir.ordinal()] instanceof INetworkPipe)) - { - IFluidHandler drainedTank = (IFluidHandler) connected[dir.ordinal()]; - FluidStack stack = drainedTank.drain(dir.getOpposite(), FluidContainerRegistry.BUCKET_VOLUME, false); - if (stack != null && stack.amount > 0) - { - INetworkPipe inputPipe = this.findValidPipe(stack); - if (inputPipe != null) - { - int ammountFilled = ((NetworkPipes) inputPipe.getTileNetwork()).addFluidToNetwork((TileEntity) drainedTank, stack, true); - drainedTank.drain(dir.getOpposite(), ammountFilled, true); - } - } - } - } - } - } - } - - /** used to find a valid pipe for filling of the liquid type */ - public INetworkPipe findValidPipe(FluidStack stack) - { - // find normal color selective pipe first - for (int i = 0; i < connected.length; i++) - { - TileEntity tile = connected[i]; - if (tile instanceof INetworkPipe && ((INetworkPipe) tile).fill(ForgeDirection.getOrientation(i), stack, false) > 0) - { - return (INetworkPipe) tile; - } - } - return null; - } - - /** - * Collects info about the surrounding 6 tiles and orders them into drain-able(ITankContainer) - * and fill-able(TileEntityPipes) instances - */ - public void refresh() - { - // cleanup - this.connected = HelperMethods.getSurroundingTileEntities(this); - // read surroundings - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity tileEntity = connected[dir.ordinal()]; - if (tileEntity instanceof ITileConnector) - { - if (this.canTileConnect(Connection.FLUIDS, dir.getOpposite())) - { - this.connected[dir.ordinal()] = tileEntity; - } - } - else if (tileEntity instanceof IFluidHandler) - { - this.connected[dir.ordinal()] = tileEntity; - } - } - } - - @Override - public boolean canTileConnect(Connection type, ForgeDirection dir) - { - return type == Connection.FLUIDS; - } - - @Override - public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) - { - // TODO maybe debug on # of connected units of input/output - String output = ""; - if (!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) - { - output += "Open"; - } - else - { - output += "Closed"; - } - return output; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/TileEntityTank.java b/archive/java/resonantinduction/mechanical/fluid/TileEntityTank.java deleted file mode 100644 index 4fc63d33..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/TileEntityTank.java +++ /dev/null @@ -1,53 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.tilenetwork.INetworkPart; -import resonantinduction.core.tilenetwork.ITileNetwork; -import resonantinduction.mechanical.fluid.network.NetworkFluidContainers; -import resonantinduction.mechanical.fluid.prefab.TileEntityFluidNetworkTile; -import resonantinduction.old.api.fluid.INetworkFluidPart; - -public class TileEntityTank extends TileEntityFluidNetworkTile -{ - public TileEntityTank() - { - super(BlockTank.tankVolume); - } - - @Override - public NetworkFluidContainers getTileNetwork() - { - if (!(this.network instanceof NetworkFluidContainers)) - { - this.setTileNetwork(new NetworkFluidContainers(this)); - } - return (NetworkFluidContainers) this.network; - } - - @Override - public void setTileNetwork(ITileNetwork network) - { - if (network instanceof NetworkFluidContainers) - { - this.network = (NetworkFluidContainers) network; - } - } - - @Override - public void validateConnectionSide(TileEntity tileEntity, ForgeDirection side) - { - if (!this.worldObj.isRemote) - { - if (tileEntity instanceof TileEntityTank) - { - if (this.canTileConnect(Connection.NETWORK, side.getOpposite())) - { - this.getTileNetwork().mergeNetwork(((INetworkFluidPart) tileEntity).getTileNetwork(), (INetworkPart) tileEntity); - this.renderConnection[side.ordinal()] = true; - connectedBlocks.add(tileEntity); - } - } - } - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/TileKitchenSink.java b/archive/java/resonantinduction/mechanical/fluid/TileKitchenSink.java deleted file mode 100644 index 9784c2bd..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/TileKitchenSink.java +++ /dev/null @@ -1,112 +0,0 @@ -package resonantinduction.mechanical.fluid; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -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 resonantinduction.core.network.ISimplePacketReceiver; -import resonantinduction.mechanical.fluid.prefab.TileEntityFluidStorage; -import resonantinduction.old.transport.ResonantInductionTransport; -import calclavia.lib.network.PacketHandler; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; -import dark.lib.helpers.ColorCode; - -public class TileKitchenSink extends TileEntityFluidStorage implements ISimplePacketReceiver -{ - @Override - public int getTankSize() - { - return FluidContainerRegistry.BUCKET_VOLUME * 2; - } - - @Override - public void updateEntity() - { - if (!worldObj.isRemote) - { - if (ticks % (random.nextInt(5) * 10 + 20) == 0) - { - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - } - } - - @Override - public Packet getDescriptionPacket() - { - FluidStack stack = new FluidStack(FluidRegistry.WATER, 0); - if (this.getTank().getFluid() != null) - { - stack = this.getTank().getFluid(); - } - return PacketHandler.instance().getTilePacket(ResonantInductionTransport.CHANNEL, "FluidLevel", this, stack.writeToNBT(new NBTTagCompound())); - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput data, Player player) - { - try - { - if (id.equalsIgnoreCase("FluidLevel")) - { - this.getTank().setFluid(FluidStack.loadFluidStackFromNBT(PacketHandler.instance().readNBTTagCompound(data))); - return true; - } - } - catch (Exception e) - { - e.printStackTrace(); - return true; - } - return false; - } - - @Override - public int fill(ForgeDirection side, FluidStack resource, boolean doFill) - { - int f = super.fill(side, resource, doFill); - if (doFill && f > 0) - { - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - return f; - } - - @Override - public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) - { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean canFill(ForgeDirection from, Fluid fluid) - { - return fluid != null && fluid.getName().equalsIgnoreCase("water") && from != ForgeDirection.UP; - } - - @Override - public boolean canDrain(ForgeDirection from, Fluid fluid) - { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean setColor(Object obj) - { - return false; - } - - @Override - public ColorCode getColor() - { - return ColorCode.BLUE; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/network/FluidPressurePack.java b/archive/java/resonantinduction/mechanical/fluid/network/FluidPressurePack.java deleted file mode 100644 index 1b091e81..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/network/FluidPressurePack.java +++ /dev/null @@ -1,26 +0,0 @@ -package resonantinduction.mechanical.fluid.network; - -import net.minecraftforge.fluids.FluidStack; - -public class FluidPressurePack implements Cloneable -{ - public FluidStack liquidStack; - public double pressure; - - public FluidPressurePack(FluidStack liquidStack, double voltage) - { - this.liquidStack = liquidStack; - this.pressure = voltage; - } - - @Override - public FluidPressurePack clone() - { - return new FluidPressurePack(this.liquidStack, this.pressure); - } - - public boolean isEqual(FluidPressurePack packet) - { - return this.liquidStack.isFluidEqual(packet.liquidStack) && this.pressure == packet.pressure; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/network/FluidRecipeInfo.java b/archive/java/resonantinduction/mechanical/fluid/network/FluidRecipeInfo.java deleted file mode 100644 index e3973d8f..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/network/FluidRecipeInfo.java +++ /dev/null @@ -1,233 +0,0 @@ -package resonantinduction.mechanical.fluid.network; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -import com.builtbroken.common.Pair; -import com.builtbroken.common.Triple; - -/** - * Used to store more complex info, than A + B = C, on two FluidStack mixing behavior - * - * @author DarkGuardsman - */ -public class FluidRecipeInfo -{ - /** - * A + Energy = C, simple recipe designed to tell a boiler like machine how to handle input to - * output process - */ - public static class BoilingFluidRecipe - { - /** Unboiled object */ - public Object boiledObject; - /** Boiled object */ - public Object boiledResult; - /** In kelvin tempature units only */ - public float heatLevel = 0; - /** Energy in jouls need to turn convert A to B */ - public float energyPerMb = 1; - - public BoilingFluidRecipe(Object unboiled, Object boiled, float boilingTempature, float energyPerUnitBoiled) - { - this.boiledObject = unboiled; - this.boiledResult = boiled; - this.heatLevel = boilingTempature; - this.energyPerMb = energyPerUnitBoiled; - } - - @Override - public String toString() - { - return "[BoilingFluidRecipe] UnboiledObject: " + (this.boiledObject != null ? this.boiledObject.toString() : "null") + " | BoiledObject: " + (this.boiledResult != null ? this.boiledResult.toString() : "null") + " | BoilingTemp: " + this.heatLevel + "k | EnergyPerUnit: " + this.energyPerMb + "j"; - } - } - - /** - * Basic A + B = C recipe result that should involve fluids but can be used as a 2 item crafting - * system if needed - */ - public static class SimpleFluidRecipe - { - public Object recipeObjectA, recipeObjectB, recipeObjectC; - public int ratioOfA = 1, ratioOfB = 1, ratioOfC = 1; - /** Size compared to the largest volume that the smallest volume can be */ - public float mixingPercentMin = .1f; - public boolean canBeReversed = false; - - /** - * receiving & input object must be either be an instance of a class extending Item, - * ItemStack, Block, Fluid, FluidStack, or OreNames. Anything else and the mixing will never - * work - * - * @param receiving - receiving object that is waiting to be mixed - * @param input - object being added to the receiving object - * @param output - result of mixing the object together. Can be anything but not all - * machines using this will respect all output types - */ - public SimpleFluidRecipe(Object receiving, Object input, Object output) - { - this.recipeObjectA = receiving; - this.recipeObjectB = input; - this.recipeObjectC = output; - } - - public SimpleFluidRecipe setRatio(int receivingVolume, int inputVolume, int result) - { - this.ratioOfA = receivingVolume; - this.ratioOfB = inputVolume; - this.ratioOfC = result; - return this; - } - - public SimpleFluidRecipe setIsReversable(boolean canBeReversed) - { - this.canBeReversed = canBeReversed; - return this; - } - - public Object getResult() - { - return this.recipeObjectC; - } - - /** - * Can the mixing be complete in anyway. Does a basic volume check but does not check for - * volume wasted in mixing - * - * @param receiving - Object stored and waiting for mixing - * @param input - Object being added to the receiving object - * @return true if the process can be completed - */ - public boolean canComplete(Object receiving, Object input) - { - int countReceiving = 0; - int countInput = 0; - float percent = 0; - if (receiving != null && input != null && recipeObjectA.equals(receiving) && recipeObjectB.equals(input)) - { - countReceiving = this.getObjectVolume(receiving); - countInput = this.getObjectVolume(input); - if (countReceiving > 0 && countInput > 0) - { - float per = countInput / countReceiving; - float per2 = countReceiving / countInput; - percent = per > per2 ? per2 : per; - if (percent >= this.mixingPercentMin) - { - return true; - } - } - } - return false; - } - - public int getObjectVolume(Object object) - { - int volume = 0; - if (object instanceof Item) - { - volume = 1; - } - else if (object instanceof ItemStack) - { - volume = ((ItemStack) object).stackSize; - } - else if (object instanceof FluidStack) - { - volume = ((FluidStack) object).amount; - } - else if (object instanceof Fluid) - { - volume = 1; - } - - return volume; - } - - /** - * @param receiving - Object receiving an input object for mixing - * @param input - Object being added to the receiving object - * @return Triple containing values of mixing. Complex way to handle it, and may be replaced - * later, However to prevent 4 different methods be created for mixing this is the best - * output design. As well this doesn't consume the object but does the calculations of the - * recipe out at the given object volumes - * - * First value is amount of the first object used. Second value is the amount of the second - * object used. Third value Pair containing object output then amount of output - */ - public Triple> mix(Object receiving, Object input) - { - if (this.canComplete(receiving, input)) - { - // Collect volume of each input object - int volumeReceiving = this.getObjectVolume(receiving); - int volumeInput = this.getObjectVolume(input); - int volAUsed, volBUsed; - - // check if there is enough to mix even once - if (volumeReceiving > this.ratioOfA && volumeInput > this.ratioOfB) - { - // Collect ratio of each - int ratioA = (volumeReceiving / this.ratioOfA); - int ratioB = (volumeInput / this.ratioOfB); - - // Take the least ratio value and multiply it by the ratio of the output - int outputVolume = ratioA > ratioB ? ratioB * this.ratioOfC : ratioA * this.ratioOfC; - - volAUsed = (outputVolume / this.ratioOfC) * this.ratioOfA; - volBUsed = (outputVolume / this.ratioOfC) * this.ratioOfB; - return new Triple>(volAUsed, volBUsed, new Pair(this.recipeObjectC, outputVolume)); - } - - } - return null; - } - } - - /** - * Stores the list of processes needed to complete a fluid recipe that require more than one - * step to complete. Only used by brewing factories, and is suggest too still register result as - * a SimpleFluidRecipe unless the result can't be stored or moved easily. - */ - public static class ComplexFluidRecipe - { - public int numberOfSteps; - public SimpleFluidRecipe[] stepArray; - - public ComplexFluidRecipe(int numberOfSteps) - { - this.numberOfSteps = numberOfSteps; - this.stepArray = new SimpleFluidRecipe[this.numberOfSteps]; - } - - public ComplexFluidRecipe createStep(int step, SimpleFluidRecipe stepRecipe) - { - if (step < numberOfSteps) - { - stepArray[step] = stepRecipe; - } - return this; - } - - public boolean canCompleteStep(int step, Object receiving, Object input) - { - if (this.getStep(step) != null) - { - return this.getStep(step).canComplete(receiving, input); - } - return false; - } - - public SimpleFluidRecipe getStep(int step) - { - if (step < numberOfSteps) - { - return stepArray[step]; - } - return null; - } - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/network/IFluidRecipeCrafter.java b/archive/java/resonantinduction/mechanical/fluid/network/IFluidRecipeCrafter.java deleted file mode 100644 index 3939a833..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/network/IFluidRecipeCrafter.java +++ /dev/null @@ -1,22 +0,0 @@ -package resonantinduction.mechanical.fluid.network; - -/** - * Use this if you want to take advantage of the {@link #FluidCraftingHandler} 's auto crafting - * methods to do as little as work as possible to create recipe results - * - * @author DarkGuardsman - */ -public interface IFluidRecipeCrafter -{ - /** - * After calling {@link #FluidCraftingHandler} 's crafting method this will be called to setup - * the end result of all 3 objects. That is if crafting was not called for calculations only - */ - public void setRecipeObjectContent(Object receivingObject, int usedReceivingVolume, Object inputObject, int usedInputVolume, Object resultObject, int resultCreatedVolume); - - /** Stack that is receiving the input object (ItemStack & FluidStack are best) */ - public Object getReceivingObjectStack(); - - /** Stack that will be received by the receiving object (ItemStack & FluidStack are best) */ - public Object getInputObjectStack(); -} diff --git a/archive/java/resonantinduction/mechanical/fluid/network/NetworkFluidContainers.java b/archive/java/resonantinduction/mechanical/fluid/network/NetworkFluidContainers.java deleted file mode 100644 index 6850477d..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/network/NetworkFluidContainers.java +++ /dev/null @@ -1,109 +0,0 @@ -package resonantinduction.mechanical.fluid.network; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.core.tilenetwork.INetworkPart; -import resonantinduction.core.tilenetwork.prefab.NetworkUpdateHandler; -import resonantinduction.old.api.fluid.INetworkFluidPart; -import calclavia.lib.utility.FluidHelper; - -/** - * Basically the same as network Fluid tiles class with the only difference being in how it stores - * the fluid. When it goes to sort the fluid it will use the fluid properties to adjust its position - * in the over all tank. Eg water goes down air goes up. - * - * @author DarkGuardsman - */ -public class NetworkFluidContainers extends NetworkFluidTiles -{ - static - { - NetworkUpdateHandler.registerNetworkClass("FluidContainers", NetworkFluidContainers.class); - } - - public NetworkFluidContainers() - { - super(); - } - - public NetworkFluidContainers(INetworkPart... parts) - { - super(parts); - } - - @Override - public void save() - { - this.cleanUpMembers(); - - if (this.getNetworkTank() == null || this.getNetworkTank().getFluid() == null) - { - super.save(); - return; - } - FluidStack fillStack = this.getNetworkTank().getFluid().copy(); - - int lowestY = 255, highestY = 0; - - if (this.getNetworkTank().getFluid() != null && this.getMembers().size() > 0) - { - for (INetworkPart part : this.getMembers()) - { - if (part instanceof IFluidHandler) - { - ((INetworkFluidPart) part).drainTankContent(0, Integer.MAX_VALUE, true); - } - if (part instanceof TileEntity && ((TileEntity) part).yCoord < lowestY) - { - lowestY = ((TileEntity) part).yCoord; - } - if (part instanceof TileEntity && ((TileEntity) part).yCoord > highestY) - { - highestY = ((TileEntity) part).yCoord; - } - } - - // TODO change this to use hydraulics to not only place fluid at the lowest but as well - // not move it to another side if there is no path there threw fluid - for (int y = lowestY; y <= highestY; y++) - { - /** List of parts for this Y level */ - List parts = new ArrayList(); - - /* Grab all parts that share this Y level */ - for (INetworkPart part : this.getMembers()) - { - if (part instanceof INetworkFluidPart && ((TileEntity) part).yCoord == y) - { - parts.add((INetworkFluidPart) part); - } - } - if (!parts.isEmpty()) - { - /* - * Div out the volume for this level. TODO change this to use a percent system - * for even filling - */ - int fillvolume = Math.abs(fillStack.amount / parts.size()); - - /* Fill all tanks on this level */ - for (INetworkFluidPart part : parts) - { - part.drainTankContent(0, Integer.MAX_VALUE, true); - fillStack.amount -= part.fillTankContent(0, FluidHelper.getStack(fillStack, fillvolume), true); - } - } - - if (fillStack == null || fillStack.amount <= 0) - { - break; - } - } - } - - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/network/NetworkFluidTiles.java b/archive/java/resonantinduction/mechanical/fluid/network/NetworkFluidTiles.java deleted file mode 100644 index 12e66be4..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/network/NetworkFluidTiles.java +++ /dev/null @@ -1,317 +0,0 @@ -package resonantinduction.mechanical.fluid.network; - -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Iterator; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.core.tilenetwork.INetworkPart; -import resonantinduction.core.tilenetwork.ITileNetwork; -import resonantinduction.core.tilenetwork.prefab.NetworkTileEntities; -import resonantinduction.core.tilenetwork.prefab.NetworkUpdateHandler; -import resonantinduction.mechanical.fluid.FluidCraftingHandler; -import resonantinduction.old.api.fluid.INetworkFluidPart; -import calclavia.lib.utility.FluidHelper; - -public class NetworkFluidTiles extends NetworkTileEntities -{ - /** Fluid Tanks that are connected to the network but not part of the network's main body */ - public HashMap> connctedFluidHandlers = new HashMap>(); - /** Collective storage tank of all fluid tile that make up this networks main body */ - protected FluidTank sharedTank; - protected FluidTankInfo sharedTankInfo; - - /** Has the collective tank been loaded yet */ - protected boolean loadedLiquids = false; - - static - { - NetworkUpdateHandler.registerNetworkClass("FluidTiles", NetworkFluidTiles.class); - } - - public NetworkFluidTiles() - { - super(); - } - - public NetworkFluidTiles(INetworkPart... parts) - { - super(parts); - } - - /** Gets the collective tank of the network */ - public FluidTank getNetworkTank() - { - if (this.sharedTank == null) - { - this.sharedTank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); - this.getNetworkTankInfo(); - } - return this.sharedTank; - } - - public FluidTankInfo getNetworkTankInfo() - { - if (this.sharedTankInfo == null) - { - this.sharedTankInfo = this.getNetworkTank().getInfo(); - } - return this.sharedTankInfo; - } - - public int fillNetworkTank(TileEntity source, FluidStack stack, boolean doFill) - { - if (!this.loadedLiquids) - { - this.load(); - this.loadedLiquids = true; - } - if (!source.worldObj.isRemote && this.getNetworkTank() != null && stack != null) - { - int p = this.getNetworkTank().getFluidAmount(); - int r = this.getNetworkTank().fill(stack, doFill); - // System.out.println((world.isRemote ? "Client" : "Server") + " Network Fill: B:" + p + - // " A:" + this.getNetworkTank().getFluidAmount()); - if (doFill) - { - if (p != this.getNetworkTank().getFluidAmount()) - { - this.sharedTankInfo = this.getNetworkTank().getInfo(); - this.save(); - } - } - return r; - } - return 0; - } - - public FluidStack drainNetworkTank(World world, int volume, boolean doDrain) - { - - if (!this.loadedLiquids) - { - this.load(); - this.loadedLiquids = true; - } - FluidStack before = this.getNetworkTank().getFluid(); - if (!world.isRemote && this.getNetworkTank() != null && before != null) - { - FluidStack drain = this.getNetworkTank().drain(volume, doDrain); - FluidStack after = this.getNetworkTank().getFluid(); - // System.out.println((doDrain ? "" : "Fake") + " Network Drain for " + volume + " B:" + - // (before != null ? before.amount : 0) + " A:" + (after != null ? after.amount : 0) + - // " D:" + (drain != null ? drain.amount : 0)); - if (doDrain) - { - // Has the tank changed any. If yes then update all info and do a client update - if (!before.isFluidEqual(after) || (before != null && after != null && before.amount != after.amount)) - { - this.sharedTankInfo = this.getNetworkTank().getInfo(); - this.save(); - /* - * TODO do a client update from the network rather than each pipe updating - * itself. - * This will save on packet size but will increase the CPU load of the client - * since the client - * will need to do network calculations - */ - } - } - return drain; - } - return null; - } - - @Override - public void save() - { - this.cleanUpMembers(); - if (this.getNetworkTank().getFluid() != null && this.getMembers().size() > 0) - { - FluidStack stack = this.getNetworkTank().getFluid() == null ? null : this.getNetworkTank().getFluid().copy(); - int membersFilled = 0; - - for (INetworkPart par : this.getMembers()) - { - // UPDATE FILL VOLUME - int fillVol = stack == null ? 0 : (stack.amount / (this.getMembers().size() - membersFilled)); - - if (par instanceof INetworkFluidPart) - { - // EMPTY TANK - ((INetworkFluidPart) par).drainTankContent(0, Integer.MAX_VALUE, true); - // FILL TANK - if (stack != null) - { - stack.amount -= ((INetworkFluidPart) par).fillTankContent(0, FluidHelper.getStack(stack, fillVol), true); - membersFilled++; - } - } - } - } - - } - - @Override - public void load() - { - FluidStack stack = null; - this.cleanUpMembers(); - for (INetworkPart par : this.getMembers()) - { - if (par instanceof INetworkFluidPart) - { - if (((INetworkFluidPart) par).getTankInfo()[0] != null && ((INetworkFluidPart) par).getTankInfo()[0].fluid != null) - { - if (stack == null) - { - stack = ((INetworkFluidPart) par).getTankInfo()[0].fluid.copy(); - } - else - { - stack.amount += ((INetworkFluidPart) par).getTankInfo()[0].fluid.amount; - } - } - } - } - if (stack != null && stack.amount > 0) - { - this.getNetworkTank().setFluid(stack); - } - else - { - this.getNetworkTank().setFluid(null); - } - this.loadedLiquids = true; - } - - @Override - public boolean removeTile(TileEntity ent) - { - return super.removeTile(ent) || this.connctedFluidHandlers.remove(ent) != null; - } - - /** Checks too see if the tileEntity is part of or connected too the network */ - public boolean isConnected(TileEntity tileEntity) - { - return this.connctedFluidHandlers.containsKey(tileEntity); - } - - public void addTank(ForgeDirection side, IFluidHandler tank) - { - if (this.connctedFluidHandlers.containsKey(tank)) - { - EnumSet d = this.connctedFluidHandlers.get(tank); - d.add(side); - this.connctedFluidHandlers.put(tank, d); - } - else - { - EnumSet d = EnumSet.noneOf(ForgeDirection.class); - d.add(side); - this.connctedFluidHandlers.put(tank, d); - } - } - - @Override - public boolean preMergeProcessing(ITileNetwork mergingNetwork, INetworkPart mergePoint) - { - if (mergingNetwork instanceof NetworkFluidTiles) - { - if (!((NetworkFluidTiles) mergingNetwork).loadedLiquids) - { - ((NetworkFluidTiles) mergingNetwork).load(); - } - if (!this.loadedLiquids) - { - this.load(); - } - } - return super.preMergeProcessing(mergingNetwork, mergePoint); - - } - - @Override - protected void mergeDo(ITileNetwork network) - { - ITileNetwork newNetwork = NetworkUpdateHandler.createNewNetwork(NetworkUpdateHandler.getID(this.getClass())); - if (newNetwork != null) - { - if (newNetwork instanceof NetworkFluidTiles) - { - FluidStack one = this.getNetworkTank().getFluid(); - FluidStack two = ((NetworkFluidTiles) network).getNetworkTank().getFluid(); - - this.getNetworkTank().setFluid(null); - ((NetworkFluidTiles) network).getNetworkTank().setFluid(null); - - ((NetworkFluidTiles) newNetwork).getNetworkTank().setFluid(FluidCraftingHandler.mergeFluidStacks(one, two)); - ((NetworkFluidTiles) newNetwork).sharedTankInfo = ((NetworkFluidTiles) newNetwork).getNetworkTank().getInfo(); - } - newNetwork.getMembers().addAll(this.getMembers()); - newNetwork.getMembers().addAll(network.getMembers()); - newNetwork.onCreated(); - newNetwork.save(); - } - else - { - System.out.println("[NetworkFluidTiles] Failed to merge network due to the new network returned null"); - } - } - - @Override - public void cleanUpMembers() - { - Iterator it = this.getMembers().iterator(); - int capacity = 0; - while (it.hasNext()) - { - INetworkPart part = it.next(); - if (!this.isValidMember(part)) - { - it.remove(); - } - else - { - part.setTileNetwork(this); - if (part instanceof INetworkFluidPart && ((INetworkFluidPart) part).getTankInfo()[0] != null) - { - capacity += ((INetworkFluidPart) part).getTankInfo()[0].capacity; - } - } - } - this.getNetworkTank().setCapacity(capacity); - this.sharedTankInfo = this.getNetworkTank().getInfo(); - } - - @Override - public boolean isValidMember(INetworkPart part) - { - return super.isValidMember(part) && part instanceof INetworkFluidPart; - } - - @Override - public String toString() - { - return "FluidNetwork[" + this.hashCode() + "|parts:" + this.getMembers().size() + "]"; - } - - public String getNetworkFluid() - { - if (this.getNetworkTank() != null && this.getNetworkTank().getFluid() != null && this.getNetworkTank().getFluid().getFluid() != null) - { - int cap = this.getNetworkTank().getCapacity() / FluidContainerRegistry.BUCKET_VOLUME; - int vol = this.getNetworkTank().getFluid() != null ? (this.getNetworkTank().getFluid().amount / FluidContainerRegistry.BUCKET_VOLUME) : 0; - String name = this.getNetworkTank().getFluid().getFluid().getLocalizedName(); - return String.format("%d/%d %S Stored", vol, cap, name); - } - return ("Empty"); - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/network/NetworkPipes.java b/archive/java/resonantinduction/mechanical/fluid/network/NetworkPipes.java deleted file mode 100644 index e9806f94..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/network/NetworkPipes.java +++ /dev/null @@ -1,144 +0,0 @@ -package resonantinduction.mechanical.fluid.network; - -import java.util.EnumSet; -import java.util.Map.Entry; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.core.tilenetwork.INetworkPart; -import resonantinduction.core.tilenetwork.prefab.NetworkUpdateHandler; -import resonantinduction.old.api.fluid.INetworkPipe; -import calclavia.lib.utility.FluidHelper; - -/** - * Extension on the fluid container network to provide a more advanced reaction to fluid passing - * threw each pipe. As well this doubled as a pressure network for those machines that support the - * use of pressure. - * - * @author Rseifert - */ -public class NetworkPipes extends NetworkFluidTiles -{ - private boolean processingRequest; - public float pressureProduced; - - static - { - NetworkUpdateHandler.registerNetworkClass("FluidPipes", NetworkPipes.class); - } - - public NetworkPipes() - { - super(); - } - - public NetworkPipes(INetworkPart... parts) - { - super(parts); - } - - @Override - public int fillNetworkTank(TileEntity source, FluidStack stack, boolean doFill) - { - int netFill = this.addFluidToNetwork(source, stack, doFill); - if (netFill > 0) - { - return netFill; - } - return super.fillNetworkTank(source, stack, doFill); - } - - /** - * Adds FLuid to this network from one of the connected Pipes - * - * @param source - Were this liquid came from - * @param stack - LiquidStack to be sent - * @param doFill - actually fill the tank or just check numbers - * @return the amount of liquid consumed from the init stack - */ - public int addFluidToNetwork(TileEntity source, FluidStack stack, boolean doFill) - { - return this.addFluidToNetwork(source, stack, doFill, false); - } - - /** - * Adds FLuid to this network from one of the connected Pipes - * - * @param source - Were this liquid came from - * @param stack - LiquidStack to be sent - * @param doFill - actually fill the tank or just check numbers - * @param allowStore - allows the network to store this liquid in the pipes - * @return the amount of liquid consumed from the init stack - */ - public int addFluidToNetwork(TileEntity source, FluidStack sta, boolean doFill, boolean allowStore) - { - int used = 0; - FluidStack stack = sta.copy(); - - if (!this.processingRequest && stack != null) - { - this.processingRequest = true; - if (stack.amount > this.getMaxFlow(stack)) - { - stack = FluidHelper.getStack(stack, this.getMaxFlow(stack)); - } - - /* Secondary fill target if the main target is not found */ - IFluidHandler tankToFill = null; - int mostFill = 0; - ForgeDirection fillDir = ForgeDirection.UNKNOWN; - - boolean found = false; - - /* FIND THE FILL TARGET FROM THE LIST OF FLUID RECIEVERS */ - for (Entry> entry : this.connctedFluidHandlers.entrySet()) - { - IFluidHandler tankContainer = entry.getKey(); - if (tankContainer instanceof TileEntity && tankContainer != source && !(tankContainer instanceof INetworkPipe)) - { - for (ForgeDirection dir : entry.getValue()) - { - if (tankContainer.canFill(dir, sta.getFluid())) - { - int fill = tankContainer.fill(dir, stack, false); - - if (fill > mostFill) - { - tankToFill = tankContainer; - mostFill = fill; - fillDir = dir; - } - } - } - } - if (found) - { - break; - } - }// End of tank finder - if (tankToFill != null) - { - // TODO set up a list of tanks to actually fill rather than one at a time - used = tankToFill.fill(fillDir, stack, doFill); - // System.out.println("Seconday Target " + used + doFill); - } - } - this.processingRequest = false; - return used; - } - - /** Gets the flow rate of the system using the lowest flow rate */ - public int getMaxFlow(FluidStack stack) - { - return 1000; - } - - /** Updates after the pressure has changed a good bit */ - public void onPresureChange() - { - this.cleanUpMembers(); - } - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pipes/BlockPipe.java b/archive/java/resonantinduction/mechanical/fluid/pipes/BlockPipe.java deleted file mode 100644 index b671cc6f..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pipes/BlockPipe.java +++ /dev/null @@ -1,174 +0,0 @@ -package resonantinduction.mechanical.fluid.pipes; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.FluidTankInfo; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.block.BlockMachine; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.FluidHelper; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.helpers.ColorCode; -import dark.lib.helpers.ColorCode.IColorCoded; - -public class BlockPipe extends BlockMachine -{ - - public static int waterFlowRate = 3000; - - public BlockPipe() - { - super(Settings.CONFIGURATION, "FluidPipe", Material.iron); - this.setBlockBounds(0.30F, 0.30F, 0.30F, 0.70F, 0.70F, 0.70F); - this.setHardness(1f); - this.setResistance(3f); - - } - - @Override - public void fillWithRain(World world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - if (meta == FluidPartsMaterial.WOOD.ordinal() || meta == FluidPartsMaterial.STONE.ordinal()) - { - // TODO fill pipe since it will have an open top and can gather rain - } - } - - @Override - public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) - { - ArrayList ret = new ArrayList(); - TileEntity entity = world.getBlockTileEntity(x, y, z); - if (entity instanceof TileEntityPipe) - { - ret.add(new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z))); - } - return ret; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderType() - { - return -1; - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityPipe(); - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - return new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z)); - } - - @Override - public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) - { - return false; - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) - { - if (world.getBlockMetadata(x, y, z) == FluidPartsMaterial.HELL.ordinal()) - { - return 5; - } - return super.getLightValue(world, x, y, z); - } - - @Override - public boolean isLadder(World world, int x, int y, int z, EntityLivingBase entity) - { - return true; - } - - @Override - public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (FluidPartsMaterial data : FluidPartsMaterial.values()) - { - par3List.add(data.getStack()); - } - } - - @Override - public void breakBlock(World world, int x, int y, int z, int par5, int par6) - { - TileEntity entity = world.getBlockTileEntity(x, y, z); - if (entity instanceof TileEntityPipe) - { - FluidTankInfo tank = ((TileEntityPipe) entity).getTankInfo()[0]; - if (tank != null && tank.fluid != null && tank.fluid.getFluid() != null && tank.fluid.amount > 0) - { - ((TileEntityPipe) entity).getTileNetwork().drainNetworkTank(world, FluidHelper.fillBlock(world, new Vector3(x, y, z), tank.fluid, true), true); - } - } - super.breakBlock(world, x, y, z, par5, par6); - - } - - @Override - public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) - { - if (world.getBlockTileEntity(x, y, z) instanceof IColorCoded) - { - return ((IColorCoded) world.getBlockTileEntity(x, y, z)).setColor(ColorCode.get(colour)); - } - return false; - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("FluidPipe", TileEntityPipe.class)); - list.add(new Pair>("ColoredPipe", TileEntityPipe.class)); - } - - @Override - public boolean hasExtraConfigs() - { - return true; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - BlockPipe.waterFlowRate = config.get("settings", "FlowRate", BlockPipe.waterFlowRate, "Base value for flow rate is based off of water. It is in milibuckets so 1000 equals one bucket of fluid").getInt(); - - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pipes/EnumPipeType.java b/archive/java/resonantinduction/mechanical/fluid/pipes/EnumPipeType.java deleted file mode 100644 index 24c9304d..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pipes/EnumPipeType.java +++ /dev/null @@ -1,110 +0,0 @@ -package resonantinduction.mechanical.fluid.pipes; - -import dark.lib.helpers.ColorCode; -import dark.lib.helpers.ColorCode.IColoredId; - -public enum EnumPipeType implements IColoredId -{ - Base(0, 0, true), COLOR(new IPipeType() - { - @Override - public ColorCode getColor(int meta) - { - return ColorCode.get(meta); - } - - @Override - public String getName(int pipeID) - { - if (pipeID < 16 && pipeID > 0) - { - return ColorCode.get(pipeID - 1).name; - } - return ""; - } - }, 1, 16, true); - - private IPipeType type; - public int metaStart = 1; - public int metaEnd = 16; - public boolean canColor = false; - - private EnumPipeType() - { - this.metaStart = this.ordinal() * 16; - this.metaEnd = this.metaStart + 15; - } - - private EnumPipeType(int metaStart, int metaEnd, boolean canColor) - { - - } - - private EnumPipeType(IPipeType type, int metaStart, int metaEnd, boolean canColor) - { - this.type = type; - this.metaStart = metaStart; - this.metaEnd = metaEnd; - this.canColor = canColor; - } - - public static EnumPipeType get(int meta) - { - for (EnumPipeType type : EnumPipeType.values()) - { - if (meta >= type.metaStart && meta <= type.metaEnd) - { - return type; - } - } - return null; - } - - public static boolean canColor(int meta) - { - EnumPipeType type = get(meta); - if (type != null) - { - return type.canColor; - } - return false; - } - - public static int getUpdatedID(int pipeID, ColorCode newColor) - { - if (pipeID == 0) - { - return 1 + newColor.ordinal(); - } - return pipeID; - } - - public static ColorCode getColorCode(int meta) - { - EnumPipeType type = get(meta); - if (type != null) - { - return type.getColor(meta); - } - return ColorCode.UNKOWN; - } - - @Override - public ColorCode getColor(int meta) - { - if (type != null) - { - return type.getColor(meta); - } - return ColorCode.UNKOWN; - } - - public String getName(int pipeID) - { - if (type != null) - { - return type.getName(pipeID); - } - return ""; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pipes/EnumTankTypes.java b/archive/java/resonantinduction/mechanical/fluid/pipes/EnumTankTypes.java deleted file mode 100644 index 44f1c8e6..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pipes/EnumTankTypes.java +++ /dev/null @@ -1,110 +0,0 @@ -package resonantinduction.mechanical.fluid.pipes; - -import dark.lib.helpers.ColorCode; -import dark.lib.helpers.ColorCode.IColoredId; - -public enum EnumTankTypes implements IColoredId -{ - Base(0, 0, true), COLOR(new IPipeType() - { - @Override - public ColorCode getColor(int meta) - { - return ColorCode.get(meta); - } - - @Override - public String getName(int pipeID) - { - if (pipeID < 16 && pipeID > 0) - { - return ColorCode.get(pipeID - 1).name; - } - return ""; - } - }, 1, 16, true); - - private IPipeType type; - public int metaStart = 1; - public int metaEnd = 16; - public boolean canColor = false; - - private EnumTankTypes() - { - this.metaStart = this.ordinal() * 16; - this.metaEnd = this.metaStart + 15; - } - - private EnumTankTypes(int metaStart, int metaEnd, boolean canColor) - { - - } - - private EnumTankTypes(IPipeType type, int metaStart, int metaEnd, boolean canColor) - { - this.type = type; - this.metaStart = metaStart; - this.metaEnd = metaEnd; - this.canColor = canColor; - } - - public static EnumPipeType get(int meta) - { - for (EnumPipeType type : EnumPipeType.values()) - { - if (meta >= type.metaStart && meta <= type.metaEnd) - { - return type; - } - } - return null; - } - - public static boolean canColor(int meta) - { - EnumPipeType type = get(meta); - if (type != null) - { - return type.canColor; - } - return false; - } - - public static int getUpdatedID(int pipeID, ColorCode newColor) - { - if (pipeID == 0) - { - return 1 + newColor.ordinal(); - } - return pipeID; - } - - public static ColorCode getColorCode(int meta) - { - EnumPipeType type = get(meta); - if (type != null) - { - return type.getColor(meta); - } - return ColorCode.UNKOWN; - } - - @Override - public ColorCode getColor(int meta) - { - if (type != null) - { - return type.getColor(meta); - } - return ColorCode.UNKOWN; - } - - public String getName(int pipeID) - { - if (type != null) - { - return type.getName(pipeID); - } - return ""; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pipes/FluidPartsMaterial.java b/archive/java/resonantinduction/mechanical/fluid/pipes/FluidPartsMaterial.java deleted file mode 100644 index da40f37d..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pipes/FluidPartsMaterial.java +++ /dev/null @@ -1,185 +0,0 @@ -package resonantinduction.mechanical.fluid.pipes; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; -import resonantinduction.mechanical.fluid.prefab.TileEntityFluidNetworkTile; -import resonantinduction.old.core.recipe.RecipeLoader; -import dark.lib.helpers.ColorCode; - -/** - * Enum to hold info about each pipe material. Values are by default and some can change with pipe - * upgrades. - * - * @Note unsupportedFluids should only be used by filters. All pipes should allow all fluid types. - * However, pipes that can't support the fluid should have an effect. Eg no gas support should cause - * the pipe to leak. No molten support should cause the pipe to take damage. - * - * @author DarkGuardsman - */ -public enum FluidPartsMaterial -{ - /** Simple water only pipe. Should render open toped when it can */ - WOOD("wood", false, true, false, -1, 200), - /** Gas only pipe */ - GLASS("glass", true, false, false, 100, 300), - /** Another version of the wooden pipe */ - STONE("stone", false, true, false, -1, 1000), - /** Cheap fluid pipe */ - TIN("tin", false, true, false, 300, 1000), - /** Cheap fluid pipe */ - COPPER("copper", false, true, false, 400, 1000), - /** First duel gas and fluid pipe */ - IRON("iron", true, true, false, 500, 1000), - /** Fluid movement pipe that doesn't work well with pressure */ - GOLD("gold", true, true, false, 200, 2000), - /** Cheap molten metal pipe */ - OBBY("obby", false, true, true, 1000, 1000), - /** - * Very strong fluid and gas support pipe. Should also support molten metal as long as they - * don't stay in the pipe too long. - */ - STEEL("steel", true, true, false, 10000, 3000), - /** Weaker equal to steel pipes. Should also support steam very well */ - BRONZE("bronze", true, true, false, 6000, 2000), - /** - * Hell fluids only. Meaning lava, and molten metals. Water should turn to steam, fuel and oil - * should cause an explosion around the pipe - */ - HELL("hell", true, true, true, 10000, 5000, "water", "fuel", "oil"); - public String matName = "material"; - List unsupportedFluids = new ArrayList(); - public boolean canSupportGas = false; - public boolean canSupportFluids = false; - public boolean canSupportMoltenFluids = false; - public int maxPressure = 1000; - public int maxVolume = 2000; - /** - * Materials are stored as meta were there sub types are stored by NBT. Item versions of the - * pipes are still meta so there is a set spacing to allow for a large but defined range of sub - * pipes - */ - public static int spacing = 1000; - - private FluidPartsMaterial() - { - this.canSupportGas = true; - this.canSupportFluids = true; - canSupportMoltenFluids = true; - } - - private FluidPartsMaterial(String name, boolean gas, boolean fluid, boolean molten, String... strings) - { - this.matName = name; - this.canSupportGas = gas; - this.canSupportFluids = fluid; - this.canSupportMoltenFluids = molten; - } - - private FluidPartsMaterial(String name, boolean gas, boolean fluid, boolean molten, int pressure, int volume, String... strings) - { - this(name, gas, fluid, molten, strings); - this.maxPressure = pressure; - this.maxVolume = volume; - } - - public static FluidPartsMaterial get(World world, int x, int y, int z) - { - return get(world.getBlockMetadata(x, y, z)); - } - - public static FluidPartsMaterial get(int i) - { - if (i < FluidPartsMaterial.values().length) - { - return FluidPartsMaterial.values()[i]; - } - return null; - } - - public static FluidPartsMaterial get(ItemStack stack) - { - if (stack != null) - { - return getFromItemMeta(stack.getItemDamage()); - } - return null; - } - - public static FluidPartsMaterial getFromItemMeta(int meta) - { - meta = meta / spacing; - if (meta < FluidPartsMaterial.values().length) - { - return FluidPartsMaterial.values()[meta]; - } - return FluidPartsMaterial.WOOD; - } - - public ItemStack getStack() - { - return getStack(1); - } - - public ItemStack getStack(ColorCode color) - { - return getStack(1, color); - } - - public ItemStack getStack(int s) - { - return new ItemStack(RecipeLoader.blockPipe, s, (this.ordinal() * spacing)); - } - - public ItemStack getStack(int s, ColorCode color) - { - return new ItemStack(RecipeLoader.blockPipe, s, (this.ordinal() * spacing) + color.ordinal() + 1); - } - - public int getMeta(int typeID) - { - return (this.ordinal() * spacing) + typeID; - } - - public int getMeta() - { - return this.getMeta(0); - } - - public static int getType(int meta) - { - return meta / spacing; - } - - public static int getDropItemMeta(World world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - TileEntity ent = world.getBlockTileEntity(x, y, z); - meta *= spacing; - if (ent instanceof TileEntityFluidNetworkTile) - { - meta += ((TileEntityFluidNetworkTile) ent).getSubID(); - } - return meta; - } - - public boolean canSupport(FluidStack fluid) - { - if (fluid != null && fluid.getFluid() != null) - { - if (fluid.getFluid().isGaseous(fluid) && this.canSupportGas) - { - return true; - } - else if (!fluid.getFluid().isGaseous(fluid) && this.canSupportFluids) - { - return true; - } - } - return false; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pipes/IPipeType.java b/archive/java/resonantinduction/mechanical/fluid/pipes/IPipeType.java deleted file mode 100644 index f8b4a7b1..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pipes/IPipeType.java +++ /dev/null @@ -1,8 +0,0 @@ -package resonantinduction.mechanical.fluid.pipes; - -import dark.lib.helpers.ColorCode.IColoredId; - -public interface IPipeType extends IColoredId -{ - public String getName(int pipeID); -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pipes/ItemBlockPipe.java b/archive/java/resonantinduction/mechanical/fluid/pipes/ItemBlockPipe.java deleted file mode 100644 index 731a1198..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pipes/ItemBlockPipe.java +++ /dev/null @@ -1,122 +0,0 @@ -package resonantinduction.mechanical.fluid.pipes; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import resonantinduction.mechanical.fluid.TileEntityTank; -import resonantinduction.mechanical.fluid.prefab.TileEntityFluidNetworkTile; -import resonantinduction.old.core.recipe.RecipeLoader; -import universalelectricity.api.vector.Vector3; - -public class ItemBlockPipe extends ItemBlock -{ - - public ItemBlockPipe(int id) - { - super(id); - this.setMaxDamage(0); - this.setHasSubtypes(true); - } - - @Override - public int getMetadata(int damage) - { - return 0; - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) - { - if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("fluid")) - { - FluidStack fluid = FluidStack.loadFluidStackFromNBT(stack.getTagCompound().getCompoundTag("fluid")); - if (fluid != null) - { - list.add("Fluid: " + fluid.getFluid().getName()); - list.add("Vol: " + fluid.amount); - } - } - } - - public static ItemStack getWrenchedItem(World world, Vector3 vec) - { - TileEntity entity = vec.getTileEntity(world); - if (entity instanceof TileEntityTank && ((TileEntityTank) entity).getTankInfo() != null && ((TileEntityTank) entity).getTankInfo()[0] != null) - { - ItemStack itemStack = new ItemStack(RecipeLoader.blockTank); - FluidStack stack = ((TileEntityTank) entity).getTankInfo()[0].fluid; - - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - if (stack != null) - { - ((TileEntityTank) entity).drain(ForgeDirection.UNKNOWN, stack.amount, true); - itemStack.getTagCompound().setCompoundTag("fluid", stack.writeToNBT(new NBTTagCompound())); - } - return itemStack; - } - return null; - } - - @Override - public void onUpdate(ItemStack itemStack, World par2World, Entity entity, int par4, boolean par5) - { - if (entity instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer) entity; - - if (itemStack.getTagCompound() != null && !player.capabilities.isCreativeMode && itemStack.getTagCompound().hasKey("fluid")) - { - player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5, 0)); - } - } - } - - @Override - public int getItemStackLimit(ItemStack stack) - { - if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("fluid")) - { - return 1; - } - return this.getItemStackLimit(); - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) - { - return Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage(); - } - - @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) - { - if (super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, (stack.getItemDamage() / FluidPartsMaterial.spacing))) - { - TileEntity tile = world.getBlockTileEntity(x, y, z); - if (tile instanceof TileEntityFluidNetworkTile) - { - ((TileEntityFluidNetworkTile) tile).setSubID(stack.getItemDamage()); - if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("fluid")) - { - ((TileEntityFluidNetworkTile) tile).fill(ForgeDirection.UNKNOWN, FluidStack.loadFluidStackFromNBT(stack.getTagCompound().getCompoundTag("fluid")), true); - } - } - return true; - } - return false; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pipes/TileEntityPipe.java b/archive/java/resonantinduction/mechanical/fluid/pipes/TileEntityPipe.java deleted file mode 100644 index af9138cc..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pipes/TileEntityPipe.java +++ /dev/null @@ -1,199 +0,0 @@ -package resonantinduction.mechanical.fluid.pipes; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.core.tilenetwork.ITileConnector; -import resonantinduction.core.tilenetwork.ITileNetwork; -import resonantinduction.mechanical.fluid.network.NetworkPipes; -import resonantinduction.mechanical.fluid.prefab.TileEntityFluidNetworkTile; -import resonantinduction.old.api.fluid.INetworkPipe; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.FluidHelper; -import dark.lib.helpers.ColorCode; -import dark.lib.helpers.ColorCode.IColorCoded; - -public class TileEntityPipe extends TileEntityFluidNetworkTile implements IColorCoded, INetworkPipe -{ - /** gets the current color mark of the pipe */ - @Override - public ColorCode getColor() - { - return EnumPipeType.getColorCode(this.subID); - } - - /** sets the current color mark of the pipe */ - @Override - public boolean setColor(Object cc) - { - if (!worldObj.isRemote) - { - int p = this.subID; - this.subID = EnumPipeType.getUpdatedID(subID, ColorCode.get(cc)); - return p != this.subID; - } - return false; - } - - @Override - public void validateConnectionSide(TileEntity tileEntity, ForgeDirection side) - { - int meta = new Vector3(this).getBlockMetadata(this.worldObj); - if (meta < FluidPartsMaterial.values().length) - { - FluidPartsMaterial pipeMat = FluidPartsMaterial.values()[meta]; - if (pipeMat == FluidPartsMaterial.WOOD || pipeMat == FluidPartsMaterial.STONE) - { - if (side == ForgeDirection.UP) - { - return; - } - } - } - if (tileEntity instanceof TileEntityPipe) - { - int metaOther = new Vector3(tileEntity).getBlockMetadata(this.worldObj); - if (meta < FluidPartsMaterial.values().length && metaOther < FluidPartsMaterial.values().length) - { - FluidPartsMaterial pipeMat = FluidPartsMaterial.values()[meta]; - FluidPartsMaterial pipeMatOther = FluidPartsMaterial.values()[metaOther]; - // Same pipe types can connect - if (pipeMat == pipeMatOther) - { - this.getTileNetwork().mergeNetwork(((INetworkPipe) tileEntity).getTileNetwork(), this); - connectedBlocks.add(tileEntity); - this.renderConnection[side.ordinal()] = true; - }// Wood and stone pipes can connect to each other but not other pipe types since - // they are more like a trough than a pipe - else if ((pipeMat == FluidPartsMaterial.WOOD || pipeMat == FluidPartsMaterial.STONE) && (pipeMatOther == FluidPartsMaterial.WOOD || pipeMatOther == FluidPartsMaterial.STONE)) - { - this.getTileNetwork().mergeNetwork(((INetworkPipe) tileEntity).getTileNetwork(), this); - connectedBlocks.add(tileEntity); - this.renderConnection[side.ordinal()] = true; - }// Any other pipe can connect to each other as long as the color matches except for - // glass which only works with itself at the moment - else if (pipeMat != FluidPartsMaterial.WOOD && pipeMat != FluidPartsMaterial.STONE && pipeMatOther != FluidPartsMaterial.WOOD && pipeMatOther != FluidPartsMaterial.STONE && pipeMat != FluidPartsMaterial.GLASS && pipeMatOther != FluidPartsMaterial.GLASS) - { - this.getTileNetwork().mergeNetwork(((INetworkPipe) tileEntity).getTileNetwork(), this); - connectedBlocks.add(tileEntity); - this.renderConnection[side.ordinal()] = true; - } - } - } - else if (tileEntity instanceof IFluidHandler) - { - connectedBlocks.add(tileEntity); - this.renderConnection[side.ordinal()] = true; - this.getTileNetwork().addTank(side.getOpposite(), (IFluidHandler) tileEntity); - } - else if (tileEntity instanceof ITileConnector && ((ITileConnector) tileEntity).canTileConnect(Connection.FLUIDS, side.getOpposite())) - { - connectedBlocks.add(tileEntity); - this.renderConnection[side.ordinal()] = true; - } - - } - - @Override - public boolean onPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to) - { - // TODO do checks for molten pipe so that fluids like water turn into steam, oils and fuels - // burn - return super.onPassThrew(fluid, from, to); - } - - @Override - public double getMaxPressure(ForgeDirection side) - { - int meta = this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord); - if (meta < FluidPartsMaterial.values().length) - { - return FluidPartsMaterial.values()[meta].maxPressure; - } - return 350; - } - - @Override - public NetworkPipes getTileNetwork() - { - if (!(this.network instanceof NetworkPipes)) - { - this.setTileNetwork(new NetworkPipes(this)); - } - return (NetworkPipes) this.network; - } - - @Override - public void setTileNetwork(ITileNetwork network) - { - if (network instanceof NetworkPipes) - { - this.network = (NetworkPipes) network; - } - } - - @Override - public int getMaxFlowRate(FluidStack stack, ForgeDirection side) - { - if (stack != null) - { - return this.calculateFlowRate(stack, 40, 20); - } - return BlockPipe.waterFlowRate; - } - - /** - * Calculates flow rate based on viscosity & temp of the fluid as all other factors are know - * - * @param fluid - fluidStack - * @param temp = tempature of the fluid - * @param pressure - pressure difference of were the fluid is flowing too. - * @return flow rate in mili-Buckets - */ - public int calculateFlowRate(FluidStack fluid, float pressure, float temp) - { - // TODO recalculate this based on pipe material for friction - if (fluid != null & fluid.getFluid() != null) - { - float f = .012772f * pressure; - f = f / (8 * (fluid.getFluid().getViscosity() / 1000)); - return (int) (f * 1000); - } - return BlockPipe.waterFlowRate; - } - - @Override - public boolean onOverPressure(Boolean damageAllowed) - { - if (damageAllowed) - { - if (this.tank.getFluid() != null && this.tank.getFluid() != null) - { - this.getTileNetwork().drainNetworkTank(this.worldObj, FluidHelper.fillBlock(this.worldObj, new Vector3(this), this.tank.getFluid(), true), true); - } - else - { - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, yCoord, 0, 0); - } - return true; - } - return false; - } - - @Override - public void sendTankUpdate(int index) - { - if (this.getBlockMetadata() == FluidPartsMaterial.WOOD.ordinal() || this.getBlockMetadata() == FluidPartsMaterial.STONE.ordinal()) - { - super.sendTankUpdate(index); - } - } - - @Override - public boolean canDrain(ForgeDirection from, Fluid fluid) - { - return false; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidDevice.java b/archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidDevice.java deleted file mode 100644 index 1e2b36e4..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidDevice.java +++ /dev/null @@ -1,32 +0,0 @@ -package resonantinduction.mechanical.fluid.prefab; - -import java.util.Random; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.tilenetwork.ITileConnector; -import resonantinduction.core.tilenetwork.prefab.NetworkTileEntities; -import calclavia.lib.prefab.tile.TileAdvanced; -import dark.lib.interfaces.IReadOut; - -public abstract class TileEntityFluidDevice extends TileAdvanced implements IReadOut, ITileConnector -{ - public Random random = new Random(); - - @Override - public void invalidate() - { - super.invalidate(); - NetworkTileEntities.invalidate(this); - } - - @Override - public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) - { - if (tool != null && tool == EnumTools.PIPE_GUAGE) - { - return " IndirectlyPower:" + this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); - } - return null; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidNetworkTile.java b/archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidNetworkTile.java deleted file mode 100644 index b1f9d119..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidNetworkTile.java +++ /dev/null @@ -1,493 +0,0 @@ -package resonantinduction.mechanical.fluid.prefab; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -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 org.bouncycastle.util.Arrays; - -import resonantinduction.core.network.ISimplePacketReceiver; -import resonantinduction.core.tilenetwork.INetworkPart; -import resonantinduction.core.tilenetwork.ITileNetwork; -import resonantinduction.mechanical.fluid.network.NetworkFluidTiles; -import resonantinduction.mechanical.fluid.pipes.FluidPartsMaterial; -import resonantinduction.old.api.fluid.FluidMasterList; -import resonantinduction.old.api.fluid.INetworkFluidPart; -import resonantinduction.old.transport.ResonantInductionTransport; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.network.PacketHandler; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class TileEntityFluidNetworkTile extends TileEntityFluidDevice implements INetworkFluidPart, ISimplePacketReceiver -{ - private int updateTick = 1; - public static int refreshRate = 10; - protected FluidTank tank; - protected FluidTankInfo[] internalTanksInfo = new FluidTankInfo[1]; - protected List connectedBlocks = new ArrayList(); - public boolean[] renderConnection = new boolean[6]; - protected int heat = 0, maxHeat = 20000; - protected int damage = 0, maxDamage = 1000; - protected int subID = 0; - protected int tankCap; - protected FluidStack prevStack = null; - - protected NetworkFluidTiles network; - - public TileEntityFluidNetworkTile() - { - this(1); - } - - public TileEntityFluidNetworkTile(int tankCap) - { - if (tankCap <= 0) - { - tankCap = 1; - } - this.tankCap = tankCap; - this.tank = new FluidTank(this.tankCap * FluidContainerRegistry.BUCKET_VOLUME); - this.internalTanksInfo[0] = this.tank.getInfo(); - } - - public FluidTank getTank() - { - if (tank == null) - { - this.tank = new FluidTank(this.tankCap * FluidContainerRegistry.BUCKET_VOLUME); - this.internalTanksInfo[0] = this.tank.getInfo(); - } - return tank; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if (!worldObj.isRemote) - { - if (ticks % this.updateTick == 0) - { - this.updateTick = this.worldObj.rand.nextInt(5) * 40 + 20; - this.refresh(); - } - if (ticks % TileEntityFluidNetworkTile.refreshRate == 0) - { - if (this.getTank().getFluid() == null && this.prevStack == null) - { - // Do nothing - } - else if ((this.getTank().getFluid() == null && this.prevStack != null) || (this.getTank().getFluid() != null && this.prevStack == null) || (this.getTank().getFluid().amount != this.prevStack.amount)) - { - this.sendTankUpdate(0); - } - this.prevStack = this.tank.getFluid(); - } - } - } - - @Override - public void invalidate() - { - this.getTileNetwork().splitNetwork(this); - super.invalidate(); - } - - @Override - public int fill(ForgeDirection from, FluidStack resource, boolean doFill) - { - if (this.getTileNetwork() != null && resource != null) - { - return this.getTileNetwork().fillNetworkTank(this, resource, doFill); - } - return 0; - } - - @Override - public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) - { - if (this.getTileNetwork() != null && resource != null) - { - if (this.getTileNetwork().getNetworkTank() != null && this.getTileNetwork().getNetworkTank().getFluid() != null && this.getTileNetwork().getNetworkTank().getFluid().isFluidEqual(resource)) - { - return this.getTileNetwork().drainNetworkTank(this.worldObj, resource.amount, doDrain); - } - - } - return null; - } - - @Override - public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) - { - if (this.getTileNetwork() != null) - { - return this.getTileNetwork().drainNetworkTank(this.worldObj, maxDrain, doDrain); - } - return null; - } - - @Override - public boolean canFill(ForgeDirection from, Fluid fluid) - { - return true; - } - - @Override - public boolean canDrain(ForgeDirection from, Fluid fluid) - { - return true; - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection from) - { - return new FluidTankInfo[] { this.getTileNetwork().getNetworkTankInfo() }; - } - - @Override - public List getNetworkConnections() - { - return this.connectedBlocks; - } - - @Override - public void refresh() - { - if (this.worldObj != null && !this.worldObj.isRemote) - { - boolean[] previousConnections = this.renderConnection.clone(); - this.connectedBlocks.clear(); - this.renderConnection = new boolean[6]; - - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - this.validateConnectionSide(new Vector3(this).modifyPositionFromSide(dir).getTileEntity(this.worldObj), dir); - - } - /** Only send packet updates if visuallyConnected changed. */ - if (!Arrays.areEqual(previousConnections, this.renderConnection)) - { - this.sendRenderUpdate(); - } - } - - } - - /** - * Checks to make sure the connection is valid to the tileEntity - * - * @param tileEntity - the tileEntity being checked - * @param side - side the connection is too - */ - public void validateConnectionSide(TileEntity tileEntity, ForgeDirection side) - { - if (!this.worldObj.isRemote) - { - if (tileEntity instanceof INetworkFluidPart) - { - if (this.canTileConnect(Connection.NETWORK, side.getOpposite())) - { - this.getTileNetwork().mergeNetwork(((INetworkFluidPart) tileEntity).getTileNetwork(), (INetworkPart) tileEntity); - this.renderConnection[side.ordinal()] = true; - connectedBlocks.add(tileEntity); - } - } - } - } - - @Override - public NetworkFluidTiles getTileNetwork() - { - if (!(this.network instanceof NetworkFluidTiles)) - { - this.network = new NetworkFluidTiles(this); - } - return this.network; - } - - @Override - public void setTileNetwork(ITileNetwork fluidNetwork) - { - if (fluidNetwork instanceof NetworkFluidTiles) - { - this.network = (NetworkFluidTiles) fluidNetwork; - } - - } - - @Override - public FluidTankInfo[] getTankInfo() - { - if (this.internalTanksInfo == null) - { - this.internalTanksInfo = new FluidTankInfo[] { this.getTank().getInfo() }; - } - return this.internalTanksInfo; - } - - @Override - public int fillTankContent(int index, FluidStack stack, boolean doFill) - { - if (index == 0) - { - int p = this.getTank().getFluid() != null ? this.getTank().getFluid().amount : 0; - int fill = this.getTank().fill(stack, doFill); - if (p != fill && doFill) - { - this.internalTanksInfo[index] = this.getTank().getInfo(); - } - return fill; - } - return 0; - } - - @Override - public FluidStack drainTankContent(int index, int volume, boolean doDrain) - { - if (index == 0) - { - FluidStack prev = this.getTank().getFluid(); - FluidStack stack = this.getTank().drain(volume, doDrain); - if (prev != null && (stack == null || prev.amount != stack.amount) && doDrain) - { - this.internalTanksInfo[index] = this.getTank().getInfo(); - } - return stack; - } - return null; - } - - @Override - public boolean canTileConnect(Connection type, ForgeDirection dir) - { - if (this.damage >= this.maxDamage) - { - return false; - } - return type == Connection.FLUIDS || type == Connection.NETWORK; - } - - @Override - public boolean canPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to) - { - return this.connectedBlocks.get(from.ordinal()) != null && this.connectedBlocks.get(to.ordinal()) != null && this.damage < this.maxDamage; - } - - @Override - public boolean onPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to) - { - FluidPartsMaterial mat = FluidPartsMaterial.get(this.getBlockMetadata()); - if (fluid != null && fluid.getFluid() != null && mat != null) - { - if (fluid.getFluid().isGaseous(fluid) && !mat.canSupportGas) - { - // TODO lose 25% of the gas, and render the escaping gas as a particle effect - this.getTileNetwork().drainNetworkTank(this.worldObj, (int) (fluid.amount * .05), true); - } - else if (FluidMasterList.isMolten(fluid.getFluid()) && !mat.canSupportMoltenFluids) - { - // TODO start to heat up the pipe to melting point. When it hits melting point turn - // the pipe to its molten metal equal - // TODO also once it reaches a set heat level start burning up blocks around the - // pipe such as wood - // this.heat += FluidMasterList.getHeatPerPass(fluid.getFluid()); - if (heat >= this.maxHeat) - { - this.worldObj.setBlock(xCoord, yCoord, zCoord, Block.fire.blockID); - return true; - } - } - else if (!fluid.getFluid().isGaseous(fluid) && !mat.canSupportFluids) - { - this.damage += 1; - if (this.damage >= this.maxDamage) - { - // TODO test this and make sure its right, as well black fluid block in some - // cases - this.getBlockType().dropBlockAsItem(worldObj, xCoord, yCoord, zCoord, 0, 0); - this.worldObj.setBlock(xCoord, yCoord, zCoord, 0); - return true; - } - } - } - return false; - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.damage = nbt.getInteger("damage"); - this.heat = nbt.getInteger("heat"); - this.subID = nbt.getInteger("subID"); - if (nbt.hasKey("stored")) - { - NBTTagCompound tag = nbt.getCompoundTag("stored"); - String name = tag.getString("LiquidName"); - int amount = nbt.getInteger("Amount"); - Fluid fluid = FluidRegistry.getFluid(name); - if (fluid != null) - { - FluidStack liquid = new FluidStack(fluid, amount); - this.getTank().setFluid(liquid); - internalTanksInfo[0] = this.getTank().getInfo(); - } - } - else - { - this.getTank().readFromNBT(nbt.getCompoundTag("FluidTank")); - internalTanksInfo[0] = this.getTank().getInfo(); - } - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("damage", this.damage); - nbt.setInteger("heat", this.heat); - nbt.setInteger("subID", this.subID); - nbt.setCompoundTag("FluidTank", this.getTank().writeToNBT(new NBTTagCompound())); - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput data, Player player) - { - try - { - if (this.worldObj.isRemote) - { - if (id.equalsIgnoreCase("DescriptionPacket")) - { - this.subID = data.readInt(); - this.renderConnection[0] = data.readBoolean(); - this.renderConnection[1] = data.readBoolean(); - this.renderConnection[2] = data.readBoolean(); - this.renderConnection[3] = data.readBoolean(); - this.renderConnection[4] = data.readBoolean(); - this.renderConnection[5] = data.readBoolean(); - this.tank = new FluidTank(data.readInt()); - this.getTank().readFromNBT(PacketHandler.readNBTTagCompound(data)); - this.internalTanksInfo[0] = this.getTank().getInfo(); - return true; - } - else if (id.equalsIgnoreCase("RenderPacket")) - { - this.subID = data.readInt(); - this.renderConnection[0] = data.readBoolean(); - this.renderConnection[1] = data.readBoolean(); - this.renderConnection[2] = data.readBoolean(); - this.renderConnection[3] = data.readBoolean(); - this.renderConnection[4] = data.readBoolean(); - this.renderConnection[5] = data.readBoolean(); - return true; - } - else if (id.equalsIgnoreCase("SingleTank")) - { - this.tank = new FluidTank(data.readInt()); - this.getTank().readFromNBT(PacketHandler.readNBTTagCompound(data)); - this.internalTanksInfo[0] = this.getTank().getInfo(); - return true; - } - } - } - catch (IOException e) - { - System.out.println("// Fluid Mechanics Tank packet read error"); - e.printStackTrace(); - return true; - } - return false; - } - - @Override - public Packet getDescriptionPacket() - { - Object[] data = new Object[9]; - data[0] = this.subID; - data[1] = this.renderConnection[0]; - data[2] = this.renderConnection[1]; - data[3] = this.renderConnection[2]; - data[4] = this.renderConnection[3]; - data[5] = this.renderConnection[4]; - data[6] = this.renderConnection[5]; - data[7] = this.getTank().getCapacity(); - data[8] = this.getTank().writeToNBT(new NBTTagCompound()); - return ResonantInductionTransport.getTilePacket().getPacket(this, "DescriptionPacket", data); - } - - public void sendRenderUpdate() - { - Object[] data = new Object[7]; - data[0] = this.subID; - data[1] = this.renderConnection[0]; - data[2] = this.renderConnection[1]; - data[3] = this.renderConnection[2]; - data[4] = this.renderConnection[3]; - data[5] = this.renderConnection[4]; - data[6] = this.renderConnection[5]; - PacketHandler.sendPacketToClients(ResonantInductionTransport.getTilePacket().getPacket(this, "RenderPacket", data)); - } - - public void sendTankUpdate(int index) - { - if (this.getTank() != null && index == 0) - { - PacketHandler.sendPacketToClients(ResonantInductionTransport.getTilePacket().getPacket(this, "SingleTank", this.getTank().getCapacity(), this.getTank().writeToNBT(new NBTTagCompound())), this.worldObj, new Vector3(this), 60); - } - } - - @Override - public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) - { - if (tool == EnumTools.PIPE_GUAGE) - { - String out = "Debug: " + this.getTileNetwork().toString(); - out += " "; - for (boolean b : this.renderConnection) - { - out += "|" + (b ? "T" : "F"); - } - return out + " Vol: " + this.getTileNetwork().getNetworkTank().getFluidAmount(); - } - return null; - } - - @Override - @SideOnly(Side.CLIENT) - public AxisAlignedBB getRenderBoundingBox() - { - return AxisAlignedBB.getAABBPool().getAABB(this.xCoord, this.yCoord, this.zCoord, this.xCoord + 1, this.yCoord + 1, this.zCoord + 1); - } - - public int getSubID() - { - return this.subID; - } - - public void setSubID(int id) - { - this.subID = id; - } - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidStorage.java b/archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidStorage.java deleted file mode 100644 index 4fd1efb6..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/prefab/TileEntityFluidStorage.java +++ /dev/null @@ -1,137 +0,0 @@ -package resonantinduction.mechanical.fluid.prefab; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -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 calclavia.lib.utility.FluidHelper; -import dark.lib.helpers.ColorCode.IColorCoded; - -public abstract class TileEntityFluidStorage extends TileEntityFluidDevice implements IFluidHandler, IColorCoded -{ - - public FluidTank fluidTank; - - @Override - public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) - { - if (tool != EnumTools.PIPE_GUAGE) - { - return null; - } - if (this.getTank().getFluid() == null) - { - return "Empty"; - } - return String.format("%d/%d %S Stored", getTank().getFluid().amount / FluidContainerRegistry.BUCKET_VOLUME, this.getTank().getCapacity() / FluidContainerRegistry.BUCKET_VOLUME, getTank().getFluid().getFluid().getLocalizedName()); - } - - @Override - public boolean canTileConnect(Connection type, ForgeDirection dir) - { - return type == Connection.FLUIDS; - } - - @Override - public int fill(ForgeDirection from, FluidStack resource, boolean doFill) - { - if (resource == null || resource.getFluid() == null) - { - return 0; - } - else if (this.getTank().getFluid() != null && !resource.isFluidEqual(this.getTank().getFluid())) - { - return 0; - } - return this.getTank().fill(resource, doFill); - } - - @Override - public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) - { - if (this.getTank().getFluid() == null) - { - return null; - } - FluidStack stack = this.getTank().getFluid(); - if (maxDrain < stack.amount) - { - stack = FluidHelper.getStack(stack, maxDrain); - } - return this.getTank().drain(maxDrain, doDrain); - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection from) - { - if (this.getTank() != null) - { - return new FluidTankInfo[] { new FluidTankInfo(this.getTank()) }; - } - return new FluidTankInfo[1]; - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - if (nbt.hasKey("stored")) - { - NBTTagCompound tag = nbt.getCompoundTag("stored"); - String name = tag.getString("LiquidName"); - int amount = nbt.getInteger("Amount"); - Fluid fluid = FluidRegistry.getFluid(name); - if (fluid != null) - { - FluidStack liquid = new FluidStack(fluid, amount); - getTank().setFluid(liquid); - } - } - else - { - // System.out.println("Loading fluid tank"); - getTank().readFromNBT(nbt.getCompoundTag("FluidTank")); - // System.out.println("Tank: "+ (getTank().getFluid() != null ? - // getTank().getFluid().fluidID +"@"+getTank().getFluid().amount+"mb" : "Empty")); - - } - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - if (this.getTank() != null) - { - // System.out.println("Saving fluid tank"); - // System.out.println("Tank: "+ (getTank().getFluid() != null ? - // getTank().getFluid().fluidID +"@"+getTank().getFluid().amount+"mb" : "Empty")); - nbt.setCompoundTag("FluidTank", this.getTank().writeToNBT(new NBTTagCompound())); - } - } - - /** Is the internal tank full */ - public boolean isFull() - { - return this.getTank().getFluidAmount() >= this.getTank().getCapacity(); - } - - public FluidTank getTank() - { - if (this.fluidTank == null) - { - this.fluidTank = new FluidTank(this.getTankSize()); - } - return this.fluidTank; - } - - /** gets the max storage limit of the tank */ - public abstract int getTankSize(); - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pump/BlockConstructionPump.java b/archive/java/resonantinduction/mechanical/fluid/pump/BlockConstructionPump.java deleted file mode 100644 index f2b3d3b8..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pump/BlockConstructionPump.java +++ /dev/null @@ -1,130 +0,0 @@ -package resonantinduction.mechanical.fluid.pump; - -import java.util.List; -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import resonantinduction.core.Reference; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.core.tilenetwork.prefab.NetworkTileEntities; -import resonantinduction.old.client.render.BlockRenderHelper; -import resonantinduction.old.core.recipe.RecipeLoader; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockConstructionPump extends BlockMachine -{ - - public BlockConstructionPump() - { - super(Settings.CONFIGURATION, "ConstructionPump", Material.iron); - this.setHardness(1f); - this.setResistance(5f); - - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon(Reference.PREFIX + "ironMachineSide"); - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public int damageDropped(int meta) - { - return 0; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderType() - { - return BlockRenderHelper.renderID; - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - return new ItemStack(RecipeLoader.blockConPump, 1, 0); - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase p, ItemStack itemStack) - { - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityConstructionPump(); - } - - @Override - public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - par3List.add(new ItemStack(par1, 1, 0)); - } - - @Override - public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (!world.isRemote) - { - int meta = world.getBlockMetadata(x, y, z); - int angle = MathHelper.floor_double((entityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - - TileEntity entity = world.getBlockTileEntity(x, y, z); - if (entity instanceof TileEntityConstructionPump) - { - NetworkTileEntities.invalidate(entity); - } - - if (meta == 3) - { - world.setBlockMetadataWithNotify(x, y, z, 0, 3); - } - else - { - world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3); - } - - return true; - } - return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("ConstructionPump", TileEntityConstructionPump.class)); - - } - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pump/BlockDrain.java b/archive/java/resonantinduction/mechanical/fluid/pump/BlockDrain.java deleted file mode 100644 index e49734ae..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pump/BlockDrain.java +++ /dev/null @@ -1,135 +0,0 @@ -package resonantinduction.mechanical.fluid.pump; - -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatMessageComponent; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.Reference; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.block.BlockMachine; - -import com.builtbroken.common.Pair; - -public class BlockDrain extends BlockMachine -{ - private Icon blockIcon; - private Icon drainIcon; - private Icon fillIcon; - - public BlockDrain() - { - super(Settings.CONFIGURATION, "FluidDrain", Material.iron); - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityDrain(); - } - - @Override - public void registerIcons(IconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon(Reference.PREFIX + "ironMachineSide"); - this.drainIcon = par1IconRegister.registerIcon(Reference.PREFIX + "drain"); - this.fillIcon = par1IconRegister.registerIcon(Reference.PREFIX + "drain2"); - } - - @Override - public Icon getIcon(int par1, int par2) - { - return par1 != 1 && par1 != 0 ? this.blockIcon : this.drainIcon; - } - - @Override - public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) - { - TileEntity entity = world.getBlockTileEntity(x, y, z); - ForgeDirection dir = ForgeDirection.getOrientation(side); - if (entity instanceof TileEntityDrain) - { - - if (dir == ((TileEntityDrain) entity).getDirection()) - { - if (((TileEntityDrain) entity).canDrain()) - { - return this.drainIcon; - } - else - { - return this.fillIcon; - } - - } - } - return this.blockIcon; - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase p, ItemStack itemStack) - { - int angle = MathHelper.floor_double((p.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - world.setBlockMetadataWithNotify(x, y, z, angle, 3); - TileEntity entity = world.getBlockTileEntity(x, y, z); - } - - @Override - public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (!world.isRemote) - { - int meta = world.getBlockMetadata(x, y, z); - if (world.getBlockMetadata(x, y, z) < 6) - { - meta += 6; - } - else - { - meta -= 6; - } - world.setBlockMetadataWithNotify(x, y, z, meta, 3); - TileEntity entity = world.getBlockTileEntity(x, y, z); - if (entity instanceof TileEntityDrain) - { - entityPlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Draining Sources? " + ((TileEntityDrain) entity).canDrain())); - - } - return true; - } - return true; - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (!world.isRemote) - { - int meta = side; - if (world.getBlockMetadata(x, y, z) > 5) - { - meta += 6; - } - world.setBlockMetadataWithNotify(x, y, z, meta, 3); - return true; - } - return true; - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("FluidDrain", TileEntityDrain.class)); - - } - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pump/BlockPumpMachine.java b/archive/java/resonantinduction/mechanical/fluid/pump/BlockPumpMachine.java deleted file mode 100644 index ecd3e515..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pump/BlockPumpMachine.java +++ /dev/null @@ -1,97 +0,0 @@ -package resonantinduction.mechanical.fluid.pump; - -import java.util.List; -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -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 resonantinduction.core.Settings; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.client.render.BlockRenderHelper; -import resonantinduction.old.core.recipe.RecipeLoader; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockPumpMachine extends BlockMachine -{ - - public BlockPumpMachine() - { - super(Settings.CONFIGURATION, "StarterPump", Material.iron); - this.setHardness(1f); - this.setResistance(5f); - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderType() - { - return BlockRenderHelper.renderID; - } - - @Override - public int damageDropped(int meta) - { - return 0; - } - - @Override - public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) - { - return side != ForgeDirection.DOWN; - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - TileEntity ent = world.getBlockTileEntity(x, y, z); - - if (meta < 4) - { - return new ItemStack(RecipeLoader.blockPumpMachine, 1, 0); - } - - return null; - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntityStarterPump(); - } - - @Override - public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - par3List.add(new ItemStack(par1, 1, 0)); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("starterPump", TileEntityStarterPump.class)); - - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pump/LiquidPathFinder.java b/archive/java/resonantinduction/mechanical/fluid/pump/LiquidPathFinder.java deleted file mode 100644 index e3b8f006..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pump/LiquidPathFinder.java +++ /dev/null @@ -1,344 +0,0 @@ -package resonantinduction.mechanical.fluid.pump; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.api.vector.Vector2; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.FluidHelper; - -/** - * A simpler path Finder used to find drainable or fillable tiles - * - * @author DarkGuardsman - */ -public class LiquidPathFinder -{ - /** Curent world this pathfinder will operate in */ - private World world; - /** List of all nodes traveled by the path finder */ - public Set nodeList = new HashSet(); - /** List of all nodes that match the search parms */ - public Set results = new HashSet(); - /** Are we looking for liquid fillable blocks */ - private boolean fill = false; - /** priority search direction either up or down only */ - private ForgeDirection priority; - /** Limit on the searched nodes per run */ - private int resultLimit = 200; - private int resultsFound = 0; - private int resultRun = resultLimit; - private int runs = 0; - /** Start location of the pathfinder used for range calculations */ - private Vector3 Start; - /** Range to limit the search to */ - private double range; - /** List of forgeDirection to use that are shuffled to prevent strait lines */ - List shuffledDirections = new ArrayList(); - - public LiquidPathFinder(final World world, final int resultLimit, final double range) - { - this.range = range; - this.world = world; - if (fill) - { - priority = ForgeDirection.DOWN; - } - else - { - priority = ForgeDirection.UP; - } - this.resultLimit = resultLimit; - this.reset(); - shuffledDirections.add(ForgeDirection.EAST); - shuffledDirections.add(ForgeDirection.WEST); - shuffledDirections.add(ForgeDirection.NORTH); - shuffledDirections.add(ForgeDirection.SOUTH); - } - - public void addNode(Vector3 vec) - { - if (!this.nodeList.contains(vec)) - { - this.nodeList.add(vec); - } - } - - public void addResult(Vector3 vec) - { - if (!this.results.contains(vec)) - { - this.resultsFound++; - this.results.add(vec); - } - } - - /** - * Searches for nodes attached to the given node - * - * @return True on success finding, false on failure. - */ - public boolean findNodes(Vector3 node) - { - if (node == null) - { - return false; - } - try - { - this.addNode(node); - - if (this.isValidResult(node)) - { - this.addResult(node); - } - - if (this.isDone(node.clone())) - { - return false; - } - - if (find(this.priority, node.clone())) - { - return true; - } - - Collections.shuffle(shuffledDirections); - Collections.shuffle(shuffledDirections); - - for (ForgeDirection direction : shuffledDirections) - { - if (find(direction, node.clone())) - { - return true; - } - } - - if (find(this.priority.getOpposite(), node.clone())) - { - return true; - } - } - catch (Exception e) - { - e.printStackTrace(); - } - - return false; - } - - /** - * Find all node attached to the origin mode in the given direction - * - * Note: Calls findNode if the next code is valid - */ - public boolean find(ForgeDirection direction, Vector3 origin) - { - this.runs++; - Vector3 vec = origin.clone().modifyPositionFromSide(direction); - double distance = vec.toVector2().distance(this.Start.toVector2()); - if (distance <= this.range && this.isValidNode(vec)) - { - if (this.fill && FluidHelper.drainBlock(world, vec, false) != null || FluidHelper.isFillableFluid(world, vec)) - { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - Vector3 veb = vec.clone().modifyPositionFromSide(dir); - if (FluidHelper.isFillableBlock(world, veb)) - { - this.addNode(veb); - if (this.isValidResult(veb)) - { - this.addResult(veb); - } - } - } - } - if (this.findNodes(vec)) - { - return true; - } - } - return false; - } - - /** Checks to see if this node is valid to path find threw */ - public boolean isValidNode(Vector3 pos) - { - if (pos == null) - { - return false; - } - /* Check if the chunk is loaded to prevent action outside of the loaded area */ - Chunk chunk = this.world.getChunkFromBlockCoords(pos.intX(), pos.intZ()); - if (chunk == null || !chunk.isChunkLoaded) - { - return false; - } - return FluidHelper.drainBlock(world, pos, false) != null || FluidHelper.isFillableFluid(world, pos); - } - - public boolean isValidResult(Vector3 node) - { - if (this.fill) - { - return FluidHelper.isFillableBlock(world, node) || FluidHelper.isFillableFluid(world, node); - } - else - { - return FluidHelper.drainBlock(world, node, false) != null; - } - } - - /** Checks to see if we are done pathfinding */ - public boolean isDone(Vector3 vec) - { - if (this.runs > 1000) - { - return true; - } - if (this.resultsFound >= this.resultRun) - if (this.results.size() >= this.resultLimit || this.nodeList.size() >= 10000) - { - return true; - } - return false; - } - - /** Called to execute the pathfinding operation. */ - public LiquidPathFinder start(final Vector3 startNode, int runCount, final boolean fill) - { - this.Start = startNode; - this.fill = fill; - this.runs = 0; - this.resultsFound = 0; - this.resultRun = runCount; - this.find(ForgeDirection.UNKNOWN, startNode); - - this.refresh(); - this.sortBlockList(Start, results, !fill, fill); - return this; - } - - public LiquidPathFinder reset() - { - this.nodeList.clear(); - this.results.clear(); - return this; - } - - public LiquidPathFinder refresh() - { - Iterator it = this.nodeList.iterator(); - while (it.hasNext()) - { - Vector3 vec = it.next(); - if (!this.isValidNode(vec)) - { - it.remove(); - } - if (this.isValidResult(vec)) - { - this.addResult(vec); - } - } - it = this.results.iterator(); - while (it.hasNext()) - { - Vector3 vec = it.next(); - if (!this.isValidResult(vec)) - { - it.remove(); - } - if (this.isValidNode(vec)) - { - this.addNode(vec); - } - } - return this; - } - - /** - * Used to sort a list of vector3 locations using the vector3's distance from one point and - * elevation in the y axis - * - * @param start - start location to measure distance from - * @param results2 - list of vectors to sort - * @param closest - sort closest distance to the top - * @param highest - sort highest y value to the top. - * - * Note: highest takes priority over closest - */ - public void sortBlockList(final Vector3 start, final Set set, final boolean closest, final boolean highest) - { - try - { - List list = new ArrayList(); - list.addAll(set); - Collections.sort(list, new Comparator() - { - @Override - public int compare(Vector3 vecA, Vector3 vecB) - { - // Though unlikely always return zero for equal vectors - if (vecA.equals(vecB)) - { - return 0; - } - // Check y value fist as this is the primary search area - if (Integer.compare(vecA.intY(), vecB.intY()) != 0) - { - if (highest) - { - return vecA.intY() > vecB.intY() ? -1 : 1; - } - else - { - return vecA.intY() > vecB.intY() ? 1 : -1; - } - } - // Check distance after that - double distanceA = Vector2.distance(vecA.toVector2(), start.toVector2()); - double distanceB = Vector2.distance(vecB.toVector2(), start.toVector2()); - if (Double.compare(distanceA, distanceB) != 0) - { - if (closest) - { - return distanceA > distanceB ? 1 : -1; - } - else - { - return distanceA > distanceB ? -1 : 1; - } - } - return Double.compare(distanceA, distanceB); - } - }); - set.clear(); - set.addAll(list); - } - catch (Exception e) - { - System.out.println("FluidMech>>>BlockDrain>>FillArea>>Error>>CollectionSorter"); - e.printStackTrace(); - } - } - - public LiquidPathFinder setWorld(World world2) - { - if (world2 != this.world) - { - this.reset(); - this.world = world2; - } - return this; - } -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pump/TileEntityConstructionPump.java b/archive/java/resonantinduction/mechanical/fluid/pump/TileEntityConstructionPump.java deleted file mode 100644 index e4135905..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pump/TileEntityConstructionPump.java +++ /dev/null @@ -1,194 +0,0 @@ -package resonantinduction.mechanical.fluid.pump; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.core.tilenetwork.ITileConnector; -import resonantinduction.mechanical.fluid.network.NetworkFluidTiles; -import resonantinduction.old.api.fluid.IDrain; -import resonantinduction.old.api.fluid.INetworkPipe; -import universalelectricity.api.vector.Vector3; -import universalelectricity.api.vector.VectorHelper; - -import com.builtbroken.common.Pair; - -public class TileEntityConstructionPump extends TileEntityStarterPump implements IFluidHandler, ITileConnector -{ - /* LIQUID FLOW CONNECTION SIDES */ - /** Internal tank for interaction but not real storage */ - private FluidTank fakeTank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); - - List drainsUsed = new ArrayList(); - - public TileEntityConstructionPump() - { - super(50, 50, 30); - } - - /** - * Gets the facing direction - * - * @param input true for input side, false for output side - * @return - */ - public ForgeDirection getFacing(boolean input) - { - - return input ? this.getDirection() : this.getDirection().getOpposite(); - } - - @Override - public Pair getDrainOrigin() - { - TileEntity inputTile = VectorHelper.getTileEntityFromSide(worldObj, new Vector3(this), getFacing(true)); - TileEntity outputTile = VectorHelper.getTileEntityFromSide(worldObj, new Vector3(this), getFacing(false)); - IDrain drain = this.getNextDrain(inputTile, outputTile, drainsUsed); - if (drain == null) - { - this.drainsUsed.clear(); - drain = this.getNextDrain(inputTile, outputTile, drainsUsed); - } - - if (drain instanceof TileEntity) - { - this.drainsUsed.add(drain); - return new Pair(((TileEntity) drain).worldObj, new Vector3(((TileEntity) drain))); - } - return null; - } - - /** - * Gets the nextDrain in the list - * - * @param inputTile - input tile must be an instance of INetworkPipe - * @param outputTile - output tile must be an instance of IFluidHandler - * @param ignoreList - list of drains to ignore so that the next one is selected - * @return the next drain it finds or null if it went threw the entire list. Its suggested to - * clear the ignoreList after getting null - */ - public IDrain getNextDrain(TileEntity inputTile, TileEntity outputTile, List ignoreList) - { - IDrain drain = null; - if (ignoreList == null) - { - ignoreList = new ArrayList(); - } - - if (inputTile instanceof INetworkPipe && ((INetworkPipe) inputTile).getTileNetwork() instanceof NetworkFluidTiles) - { - if (outputTile instanceof IFluidHandler) - { - for (Entry> entry : ((NetworkFluidTiles) ((INetworkPipe) inputTile).getTileNetwork()).connctedFluidHandlers.entrySet()) - { - - if (entry.getKey() instanceof IDrain && !ignoreList.contains(entry.getKey())) - { - drain = (IDrain) entry.getKey(); - break; - } - } - } - } - return drain; - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return direction != getFacing(true) && direction != getFacing(false); - } - - @Override - public int fill(ForgeDirection from, FluidStack resource, boolean doFill) - { - TileEntity entity = VectorHelper.getTileEntityFromSide(this.worldObj, new Vector3(this), getFacing(false)); - if (entity instanceof IFluidHandler) - { - return ((IFluidHandler) entity).fill(getFacing(false).getOpposite(), resource, doFill); - } - return 0; - } - - @Override - public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) - { - return null; - } - - @Override - public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) - { - // TODO Auto-generated method stub - return null; - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection direction) - { - if (direction == this.getFacing(false) && this.fakeTank != null) - { - return new FluidTankInfo[] { new FluidTankInfo(fakeTank.getFluid(), fakeTank.getCapacity()) }; - } - return null; - } - - @Override - public boolean canFill(ForgeDirection from, Fluid fluid) - { - return from != getFacing(true); - } - - @Override - public boolean canDrain(ForgeDirection from, Fluid fluid) - { - return false; - } - - @Override - public boolean canTileConnect(Connection type, ForgeDirection dir) - { - TileEntity entity = new Vector3(this).modifyPositionFromSide(dir).getTileEntity(this.worldObj); - return entity instanceof IFluidHandler && (dir == this.getFacing(false) || dir == this.getFacing(true)); - } - - @Override - public void invalidate() - { - super.invalidate(); - } - - @Override - public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) - { - if (tool == EnumTools.PIPE_GUAGE) - { - TileEntity inputTile = VectorHelper.getTileEntityFromSide(worldObj, new Vector3(this), getFacing(true)); - if (inputTile instanceof INetworkPipe && ((INetworkPipe) inputTile).getTileNetwork() instanceof NetworkFluidTiles) - { - int count = 0; - for (Entry> entry : ((NetworkFluidTiles) ((INetworkPipe) inputTile).getTileNetwork()).connctedFluidHandlers.entrySet()) - { - if (entry.getKey() instanceof IDrain) - { - count++; - } - } - return "Drains conencted to input : " + count; - } - } - return null; - } - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pump/TileEntityDrain.java b/archive/java/resonantinduction/mechanical/fluid/pump/TileEntityDrain.java deleted file mode 100644 index 302084b8..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pump/TileEntityDrain.java +++ /dev/null @@ -1,288 +0,0 @@ -package resonantinduction.mechanical.fluid.pump; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.mechanical.fluid.prefab.TileEntityFluidDevice; -import resonantinduction.old.api.fluid.IDrain; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.FluidHelper; - -import com.builtbroken.common.Pair; - -public class TileEntityDrain extends TileEntityFluidDevice implements IFluidHandler, IDrain -{ - /* MAX BLOCKS DRAINED PER 1/2 SECOND */ - public static int MAX_WORLD_EDITS_PER_PROCESS = 50; - private int currentWorldEdits = 0; - - /* LIST OF PUMPS AND THERE REQUESTS FOR THIS DRAIN */ - private HashMap> requestMap = new HashMap>(); - - private List updateQue = new ArrayList(); - private LiquidPathFinder pathDrain; - private LiquidPathFinder pathFill; - - public boolean canDrain() - { - return this.getBlockMetadata() < 6; - } - - public LiquidPathFinder getFillFinder() - { - if (pathFill == null) - { - pathFill = new LiquidPathFinder(this.worldObj, 100, 100); - } - return pathFill; - } - - @Override - public Set getFillList() - { - return this.getFillFinder().refresh().results; - } - - public LiquidPathFinder getLiquidFinder() - { - if (pathDrain == null) - { - pathDrain = new LiquidPathFinder(this.worldObj, 1000, 100); - } - return pathDrain; - } - - @Override - public Set getFluidList() - { - return this.getLiquidFinder().refresh().results; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - - /* MAIN LOGIC PATH FOR DRAINING BODIES OF LIQUID */ - if (!this.worldObj.isRemote && this.ticks % 20 == 0 && !this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) - { - this.currentWorldEdits = 0; - - /* ONLY FIND NEW SOURCES IF OUR CURRENT LIST RUNS DRY */ - if (this.getLiquidFinder().results.size() < TileEntityDrain.MAX_WORLD_EDITS_PER_PROCESS + 10) - { - this.getLiquidFinder().refresh().start(new Vector3(this).modifyPositionFromSide(this.getDirection()), TileEntityDrain.MAX_WORLD_EDITS_PER_PROCESS, false); - } - - if (this.getFillFinder().results.size() < TileEntityDrain.MAX_WORLD_EDITS_PER_PROCESS + 10) - { - this.getFillFinder().refresh().start(new Vector3(this).modifyPositionFromSide(this.getDirection()), TileEntityDrain.MAX_WORLD_EDITS_PER_PROCESS, true); - } - - } - } - - public int fillArea(FluidStack resource, boolean doFill) - { - int fillVolume = 0; - - if (this.currentWorldEdits < MAX_WORLD_EDITS_PER_PROCESS) - { - /* ID LIQUID BLOCK AND SET VARS FOR BLOCK PLACEMENT */ - if (resource == null || resource.amount < FluidContainerRegistry.BUCKET_VOLUME) - { - return 0; - } - - fillVolume = resource.amount; - - // System.out.println("Drain>>FillArea>>Targets>> " + getFillFinder().results.size()); - - List fluids = new ArrayList(); - List blocks = new ArrayList(); - List filled = new ArrayList(); - /* Sort results out into two groups and clear the rest out of the result list */ - Iterator it = this.getFillFinder().refresh().results.iterator(); - while (it.hasNext()) - { - Vector3 vec = it.next(); - if (FluidHelper.isFillableFluid(worldObj, vec) && !fluids.contains(vec) && !blocks.contains(vec)) - { - fluids.add(vec); - } - else if (FluidHelper.isFillableBlock(worldObj, vec) && !blocks.contains(vec) && !fluids.contains(vec)) - { - blocks.add(vec); - } - else - { - it.remove(); - } - } - /* Fill non-full fluids first */ - for (Vector3 loc : fluids) - { - if (fillVolume <= 0) - { - break; - } - if (FluidHelper.isFillableFluid(worldObj, loc)) - { - - fillVolume -= FluidHelper.fillBlock(worldObj, loc, FluidHelper.getStack(resource, fillVolume), doFill); - // System.out.println("Drain>>FillArea>>Filling>>" + (doFill ? "" : "Sim>>") + - // ">>Fluid>" + loc.toString()); - - if (doFill) - { - filled.add(loc); - this.currentWorldEdits++; - if (!this.updateQue.contains(loc)) - { - this.updateQue.add(loc); - } - } - - } - - } - /* Fill air or replaceable blocks after non-full fluids */ - for (Vector3 loc : blocks) - { - if (fillVolume <= 0) - { - break; - } - if (FluidHelper.isFillableBlock(worldObj, loc)) - { - fillVolume -= FluidHelper.fillBlock(worldObj, loc, FluidHelper.getStack(resource, fillVolume), doFill); - System.out.println("Drain>>FillArea>>Filling>>" + (doFill ? "" : "Sim>>") + ">>Block>" + loc.toString()); - - if (doFill) - { - filled.add(loc); - this.currentWorldEdits++; - if (!this.updateQue.contains(loc)) - { - this.updateQue.add(loc); - } - } - - } - } - this.getLiquidFinder().results.removeAll(filled); - // System.out.println("Drain>>FillArea>>Filling>>Filled>>" + (doFill ? "" : "Sim>>") + - // (resource.amount - fillVolume) + "mb"); - return Math.max(resource.amount - fillVolume, 0); - } - return 0; - } - - @Override - public boolean canTileConnect(Connection type, ForgeDirection dir) - { - return dir != this.getDirection(); - } - - @Override - public ForgeDirection getDirection() - { - int meta = 0; - if (worldObj != null) - { - meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord) % 6; - } - return ForgeDirection.getOrientation(meta); - } - - @Override - public void setDirection(ForgeDirection direction) - { - if (direction != null && direction != this.getDirection()) - { - this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, direction.ordinal(), 3); - } - } - - @Override - public boolean canFill(ForgeDirection from, Fluid fluid) - { - return this.getDirection() != from && !this.canDrain(); - } - - @Override - public int fill(ForgeDirection from, FluidStack resource, boolean doFill) - { - if (resource == null || this.canDrain()) - { - return 0; - } - return this.fillArea(resource, doFill); - } - - @Override - public boolean canDrain(ForgeDirection from, Fluid fluid) - { - return false; - } - - @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) - { - return null; - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection from) - { - return new FluidTankInfo[] { new FluidTank(this.getLiquidFinder().results.size() * FluidContainerRegistry.BUCKET_VOLUME).getInfo() }; - } - - @Override - public boolean canDrain(ForgeDirection direction) - { - return direction == this.getDirection() && !this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord) && this.canDrain(); - } - - @Override - public boolean canFill(ForgeDirection direction) - { - return direction == this.getDirection() && !this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord) && !this.canDrain(); - } - - @Override - public void onUse(Vector3 vec) - { - this.currentWorldEdits++; - } - - @Override - public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) - { - if (tool != null && tool == EnumTools.PIPE_GUAGE) - { - return " F:" + this.getFillList().size() + " D:" + this.getFluidList().size(); - } - return super.getMeterReading(user, side, tool); - } - -} diff --git a/archive/java/resonantinduction/mechanical/fluid/pump/TileEntityStarterPump.java b/archive/java/resonantinduction/mechanical/fluid/pump/TileEntityStarterPump.java deleted file mode 100644 index 53d76257..00000000 --- a/archive/java/resonantinduction/mechanical/fluid/pump/TileEntityStarterPump.java +++ /dev/null @@ -1,234 +0,0 @@ -package resonantinduction.mechanical.fluid.pump; - -import java.util.Iterator; -import java.util.Set; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.core.prefab.tile.TileEntityEnergyMachine; -import resonantinduction.core.tilenetwork.ITileConnector; -import resonantinduction.old.api.fluid.IDrain; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.FluidHelper; - -import com.builtbroken.common.Pair; - -import dark.lib.interfaces.IReadOut; - -public class TileEntityStarterPump extends TileEntityEnergyMachine implements IReadOut, ITileConnector -{ - private int currentWorldEdits, MAX_WORLD_EDITS_PER_PROCESS; - - public long ENERGY_PER_DRAIN = 50; - - private LiquidPathFinder pathLiquid; - private Vector3 lastDrainOrigin; - - public int rotation = 0; - - public TileEntityStarterPump() - { - this(10, 50, 5); - } - - /** - * @param wattTick - cost in watts per tick to run the tile - * @param wattDrain - cost in watts to drain or fill one block - * @param maxEdits - max world edits per update (1/2 second) - */ - public TileEntityStarterPump(long wattTick, long wattDrain, int maxEdits) - { - // Power calculation for max power (worldEdits * watts per edit) + (watts per tick * one - // second) - super(wattTick, (maxEdits * wattDrain) + (wattTick * 20)); - this.MAX_WORLD_EDITS_PER_PROCESS = maxEdits; - this.ENERGY_PER_DRAIN = wattDrain; - } - - /** Liquid path finder used by this tile. Retrieve the path finder if using IDrain block */ - public LiquidPathFinder getLiquidFinder() - { - if (pathLiquid == null) - { - pathLiquid = new LiquidPathFinder(this.worldObj, 100, 20); - } - return pathLiquid; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - - if (this.ticks % 10 == 0) - { - this.currentWorldEdits = 0; - - if (this.isFunctioning()) - { - this.rotation = Math.max(Math.min(this.rotation + 1, 7), 0); - - if (!this.worldObj.isRemote) - { - Pair pair = this.getDrainOrigin(); - if (pair != null && pair.left() != null && pair.right() != null) - { - this.drainAroundArea(pair.left(), pair.right(), 3); - } - } - } - - } - - } - - /** Gets the origin the path finder starts on */ - public Pair getDrainOrigin() - { - // TODO change this to lower by the amount of air between the pump and bottom - return new Pair(this.worldObj, new Vector3(this).modifyPositionFromSide(ForgeDirection.DOWN)); - } - - /** - * Drains an area starting at the given location - * - * @param world - world to drain in, most cases will be the TileEntities world - * @param loc - origin to start the path finder with. If this is an instance of IDrain this - * method will act different - */ - public void drainAroundArea(World world, Vector3 vec, int update) - { - Vector3 origin = vec.clone(); - if (origin == null) - { - return; - } - - /* Update last drain origin to prevent failed path finding */ - if (this.lastDrainOrigin == null || !this.lastDrainOrigin.equals(origin)) - { - this.lastDrainOrigin = origin.clone(); - this.getLiquidFinder().reset(); - } - - TileEntity drain = vec.clone().getTileEntity(world); - TileEntity entity = null; - - Set drainList = null; - if (drain instanceof IDrain) - { - if (!((IDrain) drain).canDrain(((IDrain) drain).getDirection())) - { - return; - } - origin = vec.modifyPositionFromSide(((IDrain) drain).getDirection()); - entity = origin.getTileEntity(world); - if (entity instanceof IFluidHandler) - { - FluidStack draStack = ((IFluidHandler) entity).drain(ForgeDirection.UP, MAX_WORLD_EDITS_PER_PROCESS * FluidContainerRegistry.BUCKET_VOLUME, false); - - if (draStack != null && FluidHelper.fillTanksAllSides(worldObj, new Vector3(this), draStack, false, ForgeDirection.DOWN) > 0) - { - ((IFluidHandler) entity).drain(ForgeDirection.UP, FluidHelper.fillTanksAllSides(worldObj, new Vector3(this), draStack, true, ForgeDirection.DOWN), true); - - } - return;// TODO check why return is here - } - else - { - drainList = ((IDrain) drain).getFluidList(); - } - } - - if (drainList == null) - { - if (this.getLiquidFinder().results.size() < MAX_WORLD_EDITS_PER_PROCESS + 10) - { - this.getLiquidFinder().setWorld(world).refresh().start(origin, MAX_WORLD_EDITS_PER_PROCESS, false); - } - drainList = this.getLiquidFinder().refresh().results; - } - - if (entity == null && drainList != null && drainList.size() > 0) - { - // System.out.println("StartPump>>DrainArea>>Targets>" + - // this.getLiquidFinder().results.size()); - - Iterator fluidList = drainList.iterator(); - - while (fluidList.hasNext() && this.consumePower(ENERGY_PER_DRAIN, false)) - { - if (this.currentWorldEdits >= MAX_WORLD_EDITS_PER_PROCESS) - { - break; - } - - Vector3 drainLocation = fluidList.next(); - FluidStack drainStack = FluidHelper.drainBlock(world, drainLocation, false, 3); - // System.out.println("StartPump>>DrainArea>>Draining>>NextFluidBlock>" + - // (drainStack == null ? "Null" : drainStack.amount + "mb of " + - // drainStack.getFluid().getName())); - - // int fillV = FluidHelper.fillTanksAllSides(worldObj, new Vector3(this), - // drainStack, false, ForgeDirection.DOWN); - // System.out.println("StartPump>>DrainArea>>Draining>>NextFluidBlock>Filled>" + - // fillV + "mb"); - - if (drainStack != null && this.fill(drainStack, false) >= drainStack.amount && this.consumePower(ENERGY_PER_DRAIN, true)) - { - // System.out.println("StartPump>>DrainArea>>Draining>>Fluid>" + - // drainLocation.toString()); - /* REMOVE BLOCK */ - FluidHelper.drainBlock(this.worldObj, drainLocation, true, update); - this.fill(drainStack, true); - this.currentWorldEdits++; - fluidList.remove(); - - if (drain instanceof IDrain) - { - ((IDrain) drain).onUse(drainLocation); - } - } - } - } - } - - public int fill(FluidStack stack, boolean doFill) - { - return FluidHelper.fillTanksAllSides(worldObj, new Vector3(this), stack, doFill, ForgeDirection.DOWN); - } - - @Override - public boolean canFunction() - { - return super.canFunction() && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); - } - - @Override - public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) - { - if (tool == EnumTools.PIPE_GUAGE) - { - return "Source Blocks: " + this.getLiquidFinder().results.size(); - } - return null; - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return direction != ForgeDirection.DOWN; - } - - @Override - public boolean canTileConnect(Connection type, ForgeDirection direction) - { - return direction != ForgeDirection.DOWN; - } - -} diff --git a/archive/java/resonantinduction/mechanical/grinder/BlockGrinderWheel.java b/archive/java/resonantinduction/mechanical/grinder/BlockGrinderWheel.java deleted file mode 100644 index 1fcccacc..00000000 --- a/archive/java/resonantinduction/mechanical/grinder/BlockGrinderWheel.java +++ /dev/null @@ -1,121 +0,0 @@ -package resonantinduction.mechanical.grinder; - -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.block.BlockRotatableBase; -import universalelectricity.api.vector.VectorWorld; - -/** - * A block used to build machines. - * - * @author Calclavia - * - */ -public class BlockGrinderWheel extends BlockRotatableBase implements ITileEntityProvider -{ - public BlockGrinderWheel(int id) - { - super("grindingWheel", id); - this.setBlockBounds(0.05f, 0.05f, 0.05f, 0.95f, 0.95f, 0.95f); - } - - @Override - public void onBlockAdded(World world, int x, int y, int z) - { - this.checkConflicts(world, x, y, z); - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, int par5) - { - this.checkConflicts(world, x, y, z); - } - - /** - * Checks for any conflicting directions with other grinders. - */ - private void checkConflicts(World world, int x, int y, int z) - { - ForgeDirection facing = this.getDirection(world, x, y, z); - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir == facing || dir == facing.getOpposite()) - { - VectorWorld checkPos = (VectorWorld) new VectorWorld(world, x, y, z).modifyPositionFromSide(dir); - TileEntity tileEntity = checkPos.getTileEntity(); - - if (tileEntity instanceof TileGrinderWheel) - { - if (this.getDirection(world, checkPos.intX(), checkPos.intY(), checkPos.intZ()) == facing) - { - this.dropBlockAsItem(world, x, y, z, 0, 0); - world.setBlockToAir(x, y, z); - } - } - } - } - } - - @Override - public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) - { - TileGrinderWheel tile = (TileGrinderWheel) world.getBlockTileEntity(x, y, z); - - if (tile.canWork()) - { - if (entity instanceof EntityItem) - { - if (tile.canGrind(((EntityItem) entity).getEntityItem())) - { - if (tile.grindingItem == null) - { - tile.grindingItem = (EntityItem) entity; - } - - if (!TileGrinderWheel.getTimer().containsKey(entity)) - { - TileGrinderWheel.getTimer().put((EntityItem) entity, TileGrinderWheel.DEFAULT_TIME); - } - } - else - { - entity.setPosition(entity.posX, entity.posY - 1.2, entity.posZ); - } - } - else - { - entity.attackEntityFrom(DamageSource.cactus, 2); - } - - // Move entity based on the direction of the block. - ForgeDirection dir = this.getDirection(world, x, y, z); - entity.motionX += dir.offsetX * 0.1; - entity.motionZ += dir.offsetZ * 0.1; - entity.motionY += 0.1; - entity.isAirBorne = true; - } - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileGrinderWheel(); - } -} diff --git a/archive/java/resonantinduction/mechanical/grinder/TileGrinderWheel.java b/archive/java/resonantinduction/mechanical/grinder/TileGrinderWheel.java deleted file mode 100644 index 567ebd7d..00000000 --- a/archive/java/resonantinduction/mechanical/grinder/TileGrinderWheel.java +++ /dev/null @@ -1,151 +0,0 @@ -package resonantinduction.mechanical.grinder; - -import java.util.HashMap; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import resonantinduction.api.recipe.MachineRecipes; -import resonantinduction.api.recipe.MachineRecipes.RecipeType; -import resonantinduction.api.recipe.RecipeUtils.ItemStackResource; -import resonantinduction.api.recipe.RecipeUtils.Resource; -import resonantinduction.core.Reference; -import universalelectricity.api.energy.EnergyStorageHandler; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.prefab.tile.TileElectrical; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; - -/** - * @author Calclavia - * - */ -public class TileGrinderWheel extends TileElectrical -{ - public static final long POWER = 500000; - public static final int DEFAULT_TIME = 20 * 20; - /** A map of ItemStacks and their remaining grind-time left. */ - private static final HashMap clientTimer = new HashMap(); - private static final HashMap serverTimer = new HashMap(); - - public EntityItem grindingItem = null; - - public TileGrinderWheel() - { - this.energy = new EnergyStorageHandler(POWER * 2); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - // TODO: Add electricity support. - doWork(); - } - - /** - * Can this machine work this tick? - * - * @return - */ - public boolean canWork() - { - return true; - } - - public void doWork() - { - boolean didWork = false; - - if (grindingItem != null) - { - if (getTimer().containsKey(grindingItem) && !grindingItem.isDead && new Vector3(this).add(0.5).distance(grindingItem) < 1) - { - int timeLeft = getTimer().get(grindingItem) - 1; - getTimer().put(grindingItem, timeLeft); - - if (timeLeft <= 0) - { - if (this.doGrind(grindingItem)) - { - if (--grindingItem.getEntityItem().stackSize <= 0) - { - grindingItem.setDead(); - getTimer().remove(grindingItem); - grindingItem = null; - } - else - { - grindingItem.setEntityItemStack(grindingItem.getEntityItem()); - // Reset timer - getTimer().put(grindingItem, DEFAULT_TIME); - } - } - } - else - { - grindingItem.delayBeforeCanPickup = 20; - this.worldObj.spawnParticle("crit", grindingItem.posX, grindingItem.posY, grindingItem.posZ, (Math.random() - 0.5f) * 3, (Math.random() - 0.5f) * 3, (Math.random() - 0.5f) * 3); - } - - didWork = true; - } - else - { - getTimer().remove(grindingItem); - grindingItem = null; - } - } - - if (didWork) - { - if (this.ticks % 20 == 0) - { - this.worldObj.playSoundEffect(this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, Reference.PREFIX + "grinder", 0.5f, 1); - } - - this.energy.extractEnergy(POWER / 20, true); - } - } - - public boolean canGrind(ItemStack itemStack) - { - return MachineRecipes.INSTANCE.getRecipe(RecipeType.GRINDER, itemStack) == null ? false : MachineRecipes.INSTANCE.getRecipe(RecipeType.GRINDER, itemStack).length > 0; - } - - private boolean doGrind(EntityItem entity) - { - ItemStack itemStack = entity.getEntityItem(); - - Resource[] results = MachineRecipes.INSTANCE.getRecipe(RecipeType.GRINDER, itemStack); - - for (Resource resource : results) - { - if (resource instanceof ItemStackResource) - { - if (!this.worldObj.isRemote) - { - EntityItem entityItem = new EntityItem(this.worldObj, entity.posX, entity.posY, entity.posZ, ((ItemStackResource) resource).itemStack.copy()); - entityItem.delayBeforeCanPickup = 20; - entityItem.motionX = 0; - entityItem.motionY = 0; - entityItem.motionZ = 0; - this.worldObj.spawnEntityInWorld(entityItem); - } - - return true; - } - } - - return false; - } - - public static HashMap getTimer() - { - if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) - { - return serverTimer; - } - - return clientTimer; - } -} diff --git a/archive/java/resonantinduction/mechanical/grinder/TilePurifier.java b/archive/java/resonantinduction/mechanical/grinder/TilePurifier.java deleted file mode 100644 index f04e0d02..00000000 --- a/archive/java/resonantinduction/mechanical/grinder/TilePurifier.java +++ /dev/null @@ -1,155 +0,0 @@ -package resonantinduction.mechanical.grinder; - -import java.util.HashMap; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import resonantinduction.core.Reference; -import resonantinduction.core.resource.item.ItemDust; -import universalelectricity.api.energy.EnergyStorageHandler; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.prefab.tile.TileElectrical; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; - -/** - * @author Calclavia - * - */ -public class TilePurifier extends TileElectrical -{ - public static final long POWER = 500000; - public static final int DEFAULT_TIME = 10 * 20; - /** A map of ItemStacks and their remaining grind-time left. */ - private static final HashMap clientTimer = new HashMap(); - private static final HashMap serverTimer = new HashMap(); - - public EntityItem processingItem = null; - - public TilePurifier() - { - this.energy = new EnergyStorageHandler(POWER * 2); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - - if (canWork()) - { - doWork(); - } - } - - /** - * Can this machine work this tick? - * - * @return - */ - public boolean canWork() - { - // TODO: Add electricity support. - return true; - } - - public void doWork() - { - boolean didWork = false; - - // Search for an item to "process" - AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(this.xCoord - 1, this.yCoord, this.zCoord - 1, this.xCoord + 1, this.yCoord, this.zCoord + 1); - List entities = this.worldObj.getEntitiesWithinAABB(Entity.class, aabb); - - for (Entity entity : entities) - { - /** - * Rotate entities around purifier - */ - double speed = 0.1; - - Vector3 originalPosition = new Vector3(this); - Vector3 relativePosition = originalPosition.clone().subtract(new Vector3(this)); - relativePosition.rotate(speed, 0, 0); - Vector3 newPosition = new Vector3(this).add(relativePosition); - - if (this.processingItem == null && entity instanceof EntityItem) - { - if (((EntityItem) entity).getEntityItem().getItem() instanceof ItemDust) - { - this.processingItem = (EntityItem) entity; - } - } - } - - if (processingItem != null) - { - if (getTimer().containsKey(processingItem) && !processingItem.isDead && new Vector3(this).add(0.5).distance(processingItem) < 1) - { - int timeLeft = getTimer().get(processingItem) - 1; - getTimer().put(processingItem, timeLeft); - - if (timeLeft <= 0) - { - if (this.doneWork(processingItem)) - { - if (--processingItem.getEntityItem().stackSize <= 0) - { - processingItem.setDead(); - getTimer().remove(processingItem); - processingItem = null; - } - else - { - processingItem.setEntityItemStack(processingItem.getEntityItem()); - // Reset timer - getTimer().put(processingItem, DEFAULT_TIME); - } - } - } - else - { - processingItem.delayBeforeCanPickup = 20; - this.worldObj.spawnParticle("bubble", processingItem.posX, processingItem.posY, processingItem.posZ, (Math.random() - 0.5f) * 3, (Math.random() - 0.5f) * 3, (Math.random() - 0.5f) * 3); - } - - didWork = true; - } - else - { - getTimer().remove(processingItem); - processingItem = null; - } - } - - if (didWork) - { - if (this.ticks % 20 == 0) - { - this.worldObj.playSoundEffect(this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, Reference.PREFIX + "grinder", 0.5f, 1); - } - - this.energy.extractEnergy(POWER / 20, true); - } - } - - private boolean doneWork(EntityItem entity) - { - ItemStack itemStack = entity.getEntityItem(); - entity.setDead(); - return false; - } - - public static HashMap getTimer() - { - if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) - { - return serverTimer; - } - - return clientTimer; - } -} diff --git a/archive/java/resonantinduction/mechanical/render/MechanicalBlockRenderingHandler.java b/archive/java/resonantinduction/mechanical/render/MechanicalBlockRenderingHandler.java deleted file mode 100644 index 2731106a..00000000 --- a/archive/java/resonantinduction/mechanical/render/MechanicalBlockRenderingHandler.java +++ /dev/null @@ -1,133 +0,0 @@ -package resonantinduction.mechanical.render; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.mechanical.Mechanical; -import resonantinduction.old.client.model.ModelConveyorBelt; -import resonantinduction.old.client.model.ModelCrusher; -import resonantinduction.old.client.model.ModelGrinder; -import resonantinduction.old.client.model.ModelManipulator; -import resonantinduction.old.client.model.ModelRejectorPiston; -import resonantinduction.old.core.recipe.RecipeLoader; -import resonantinduction.old.transport.hopper.BlockAdvancedHopper; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class MechanicalBlockRenderingHandler implements ISimpleBlockRenderingHandler -{ - public static MechanicalBlockRenderingHandler INSTANCE = new MechanicalBlockRenderingHandler(); - public static final int BLOCK_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - private ModelConveyorBelt modelConveyorBelt = new ModelConveyorBelt(); - private ModelRejectorPiston modelEjector = new ModelRejectorPiston(); - private ModelManipulator modelInjector = new ModelManipulator(); - private ModelCrusher modelCrushor = new ModelCrusher(); - private ModelGrinder grinderModel = new ModelGrinder(); - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) - { - if (block == Mechanical.blockConveyorBelt) - { - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 1.3F, 0.0F); - GL11.glRotatef(180f, 0f, 0f, 1f); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "belt/frame0.png")); - modelConveyorBelt.render(0.0625F, 0, false, false, false, false); - GL11.glPopMatrix(); - } - else if (RecipeLoader.blockRejector != null && block.blockID == RecipeLoader.blockRejector.blockID) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "rejector.png")); - GL11.glPushMatrix(); - GL11.glTranslatef(0.6F, 1.5F, 0.6F); - GL11.glRotatef(180f, 0f, 0f, 1f); - GL11.glRotatef(-90f, 0f, 1f, 0f); - modelEjector.render(0.0625F); - modelEjector.renderPiston(0.0625F, 1); - GL11.glPopMatrix(); - } - else if (RecipeLoader.blockManipulator != null && block.blockID == RecipeLoader.blockManipulator.blockID) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "manipulator1.png")); - GL11.glPushMatrix(); - GL11.glTranslatef(0.6F, 1.5F, 0.6F); - GL11.glRotatef(180f, 0f, 0f, 1f); - GL11.glRotatef(-90f, 0f, 1f, 0f); - modelInjector.render(0.0625F, true, 0); - GL11.glPopMatrix(); - } - /*else if (RecipeLoader.blockArmbot != null && block.blockID == RecipeLoader.blockArmbot.blockID) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + RenderArmbot.TEXTURE)); - GL11.glPushMatrix(); - GL11.glTranslatef(0.4f, 0.8f, 0f); - GL11.glScalef(0.7f, 0.7f, 0.7f); - GL11.glRotatef(180f, 0f, 0f, 1f); - GL11.glRotatef(-90f, 0f, 1f, 0f); - RenderArmbot.MODEL.render(0.0625F, 0, 0); - GL11.glPopMatrix(); - }*/ - else if (RecipeLoader.processorMachine != null && block.blockID == RecipeLoader.processorMachine.blockID && metadata == 0) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "CrusherBlock.png")); - GL11.glPushMatrix(); - GL11.glTranslatef(0f, 1f, 0f); - GL11.glRotatef(180f, 0f, 0f, 1f); - GL11.glRotatef(-90f, 0f, 1f, 0f); - this.modelCrushor.renderBody(0.0625f); - this.modelCrushor.renderPiston(0.0625f, 4); - GL11.glPopMatrix(); - } - else if (RecipeLoader.processorMachine != null && block.blockID == RecipeLoader.processorMachine.blockID && metadata == 4) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "GrinderBlock.png")); - GL11.glPushMatrix(); - GL11.glTranslatef(0f, 1f, 0f); - GL11.glRotatef(180f, 0f, 0f, 1f); - GL11.glRotatef(-90f, 0f, 1f, 0f); - this.grinderModel.renderBody(0.0625f); - this.grinderModel.renderRotation(0.0625f, 0); - GL11.glPopMatrix(); - } - /*else if (RecipeLoader.blockSteamGen != null && block.blockID == RecipeLoader.blockSteamGen.blockID) - { - ModelMachine model = RenderSteamGen.getModel(metadata); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderSteamGen.getTexture(metadata)); - GL11.glTranslatef(0.0F, 1.1F, 0.0F); - GL11.glRotatef(180f, 0f, 0f, 1f); - model.render(0.0625F); - }*/ - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) - { - if (block instanceof BlockAdvancedHopper) - { - return true; - } - return false; - } - - @Override - public boolean shouldRender3DInInventory() - { - return true; - } - - @Override - public int getRenderId() - { - return BLOCK_RENDER_ID; - } -} diff --git a/archive/java/resonantinduction/old/api/EntityDictionary.java b/archive/java/resonantinduction/old/api/EntityDictionary.java deleted file mode 100644 index 000da137..00000000 --- a/archive/java/resonantinduction/old/api/EntityDictionary.java +++ /dev/null @@ -1,193 +0,0 @@ -package resonantinduction.old.api; - -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 EntityDictionary -{ - public static HashMap> entityMap = new HashMap(); - public static HashMap, 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 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, 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 clazz) - { - if (grabMap.containsKey(clazz)) - { - return grabMap.get(clazz); - } - else - { - for (Entry, Boolean> entry : grabMap.entrySet()) - { - if (entry.getKey().isAssignableFrom(clazz)) - { - return entry.getValue(); - } - } - return true; - } - } - - public static void setCanNotBeGrabbed(Class clazz) - { - grabMap.put(clazz, false); - } - - public static void setCanBeGrabbed(Class clazz) - { - grabMap.put(clazz, true); - } - - public static void addName(Class clazz, String name) - { - entityMap.put(name, clazz); - } - - public static void addName(String name, Class clazz) - { - addName(clazz, name); - } - - public static List> getList() - { - // TODO Auto-generated method stub - return null; - } - - public static String get(Class entityToInclude) - { - for (Entry> entry : entityMap.entrySet()) - { - if (entry.getClass() != null && entry.getClass().equals(entityToInclude)) - { - return entry.getKey(); - } - } - return null; - } -} diff --git a/archive/java/resonantinduction/old/api/IArmbot.java b/archive/java/resonantinduction/old/api/IArmbot.java deleted file mode 100644 index 272e234c..00000000 --- a/archive/java/resonantinduction/old/api/IArmbot.java +++ /dev/null @@ -1,55 +0,0 @@ -package resonantinduction.old.api; - -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.old.api.coding.IProgrammableMachine; -import universalelectricity.api.vector.Vector2; -import universalelectricity.api.vector.Vector3; - -/** Should be used to interact with the armbot and not to create a new armbot */ -public interface IArmbot extends Cloneable, IProgrammableMachine -{ - /** Location of the hand, or working location of the object */ - public Vector3 getHandPos(); - - /** Gets the rotation as a Vector2 (X - Yaw, Y - pitch) */ - public Vector2 getRotation(); - - /** Forces the rotation to the two angles */ - public void setRotation(int yaw, int pitch); - - /** - * Ask the armbot to rotate to face the given direction. Some bots may not support all angles - * - * @return true if the bot will comply. May return false if it can't - */ - public boolean moveArmTo(int yaw, int pitch); - - /** - * Ask the armbot to rotate to face the given direction. Some bots may not support up and down - * - * @param direction - direction - * @return true if the bot will comply. May return false if it can't - */ - public boolean moveTo(ForgeDirection direction); - - /** - * Object currently held. In some cases this can be a list or array but is suggest to only be - * one object - */ - public Object getHeldObject(); - - /** - * Adds an entity to the Armbot's grab list. Entity or ItemStack - * - * @entity - object to grab, can be anything though is suggest to be an entity or itemstack - * @return - true if the bot has grabbed the object - */ - public boolean grabObject(Object entity); - - /** Drops the current held object. Use getGrabbedObject to make sure this is the object to drop. */ - public boolean dropHeldObject(); - - /** Same as deleting the object */ - public boolean clear(Object object); - -} diff --git a/archive/java/resonantinduction/old/api/IArmbotUseable.java b/archive/java/resonantinduction/old/api/IArmbotUseable.java deleted file mode 100644 index dc3c7691..00000000 --- a/archive/java/resonantinduction/old/api/IArmbotUseable.java +++ /dev/null @@ -1,26 +0,0 @@ -package resonantinduction.old.api; - -import java.util.List; - -import resonantinduction.old.api.coding.args.ArgumentData; - -/** - * The IUseable inteface is used by the ArmBot so that it may interact with Tile Entities. onUse - * will be called on the block an ArmBot is touching whenever the USE command is run on it. - * - * @author Briman0094 - */ -public interface IArmbotUseable -{ - - /** - * Called when the ArmBot command "USE" is run. This is called on any IUseable the ArmBot is - * touching. - * - * @param armbot - The Armbot instance. - * - * @return true if the use was completed correctly - */ - public boolean onUse(IArmbot armbot, List list); - -} diff --git a/archive/java/resonantinduction/old/api/IBelt.java b/archive/java/resonantinduction/old/api/IBelt.java deleted file mode 100644 index 448846b7..00000000 --- a/archive/java/resonantinduction/old/api/IBelt.java +++ /dev/null @@ -1,23 +0,0 @@ -package resonantinduction.old.api; - -import java.util.List; - -import net.minecraft.entity.Entity; - -/** An interface applied to the tile entity of a conveyor belt */ -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 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); -} diff --git a/archive/java/resonantinduction/old/api/IFilterable.java b/archive/java/resonantinduction/old/api/IFilterable.java deleted file mode 100644 index ac0d78a2..00000000 --- a/archive/java/resonantinduction/old/api/IFilterable.java +++ /dev/null @@ -1,15 +0,0 @@ -package resonantinduction.old.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(); -} diff --git a/archive/java/resonantinduction/old/api/IManipulator.java b/archive/java/resonantinduction/old/api/IManipulator.java deleted file mode 100644 index ee16fac5..00000000 --- a/archive/java/resonantinduction/old/api/IManipulator.java +++ /dev/null @@ -1,18 +0,0 @@ -package resonantinduction.old.api; - -/** - * 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(); -} diff --git a/archive/java/resonantinduction/old/api/IProcessable.java b/archive/java/resonantinduction/old/api/IProcessable.java deleted file mode 100644 index fed58fbb..00000000 --- a/archive/java/resonantinduction/old/api/IProcessable.java +++ /dev/null @@ -1,27 +0,0 @@ -package resonantinduction.old.api; - -import net.minecraft.item.ItemStack; -import dark.lib.recipes.ProcessorType; - -/** - * Simple interface that allows an item to control how its salvaged, processed, or refined by a - * processor. This is 100% optional as the processor by default can break down most items. The only - * reason to use this is for more complex processing or were the item was created with NBT. - * - * @author Darkgaurdsman - */ -public interface IProcessable -{ - /** Can this item be Processed by the machine */ - public boolean canProcess(ProcessorType type, ItemStack stack); - - /** - * Gets the output array of items when this item is processed by a processor machine - * - * @param type - type of machine see ProcessorTypes enum for info - * @param stack - ItemStack of this item or block - * @return Array of all item outputed, Make sure to return less than or equal to the amount of - * items it takes to craft only one of this item - */ - public ItemStack[] getProcesserOutput(ProcessorType type, ItemStack stack); -} diff --git a/archive/java/resonantinduction/old/api/coding/IDataItem.java b/archive/java/resonantinduction/old/api/coding/IDataItem.java deleted file mode 100644 index 1380a7c8..00000000 --- a/archive/java/resonantinduction/old/api/coding/IDataItem.java +++ /dev/null @@ -1,17 +0,0 @@ -package resonantinduction.old.api.coding; - -import net.minecraft.nbt.NBTTagCompound; - -/** - * Used to ID that an item can support saving data to it NBT - * - * @author DarkGuardsman - */ -public interface IDataItem -{ - /** Saves the data to the item */ - public NBTTagCompound saveData(NBTTagCompound nbt); - - /** Gets the data from the item */ - public NBTTagCompound getData(); -} diff --git a/archive/java/resonantinduction/old/api/coding/ILogicTask.java b/archive/java/resonantinduction/old/api/coding/ILogicTask.java deleted file mode 100644 index 3d67680a..00000000 --- a/archive/java/resonantinduction/old/api/coding/ILogicTask.java +++ /dev/null @@ -1,32 +0,0 @@ -package resonantinduction.old.api.coding; - -import java.util.List; - -import universalelectricity.api.vector.Vector2; - -/** - * Task in which it doesn't go right to the next task in the row. In this case the task will store - * the entry point, and exit points. As well handle anything in between. Examples are IF statements - * and loops. Do your logic in the refresh method as it should be called each time a new task is - * selected. - * - * @author DarkGuardsman - */ -public interface ILogicTask extends ITask -{ - /** - * There is always only one exit though you can do logic to pick from all your exit points. Exit - * is the next task rather than the exit of the statement. Use #IRedirectTask to force the logic - * back to this task. - */ - public ITask getExitPoint(); - - public List getExits(); - - /** Mainly used by the encoder to understand the limit on connections */ - public int getMaxExitPoints(); - - /** Adds a possible exit point to the split off */ - public void setExitPoint(int i, ITask task); - -} diff --git a/archive/java/resonantinduction/old/api/coding/IMemorySlot.java b/archive/java/resonantinduction/old/api/coding/IMemorySlot.java deleted file mode 100644 index e459bac8..00000000 --- a/archive/java/resonantinduction/old/api/coding/IMemorySlot.java +++ /dev/null @@ -1,35 +0,0 @@ -package resonantinduction.old.api.coding; - -import java.util.HashMap; - -/** - * Used by task to tell the program it needs to remember a value outside the task. Should only be - * used by task that really need to save values beyond there local values. Cases were this is used - * should be is loops, items counts, and run conditions. - * - * @author DarkGuardsman - */ -public interface IMemorySlot -{ - /** - * Called per update to store the changes in memory. If return is null the memory location will - * be released. Make sure to do this if the value is no longer needed. Memory is limited to - * basic java variables, and will not accept arrays, or collections - */ - public Object getMemory(String name); - - /** - * All memory locations needed by this task with there names, data types, and starting/current - * values. Take care that this is designed to keep data over several program cycles. This is not - * used to save local data. As well machines have limited memory of only a few active vars. - */ - public HashMap getMemory(); - - /** - * Any memory location that needs to be saved to the machines hard disk. Should only do this for - * information that must be saved. Treat this as real world memory to hard drive saving. As well - * if the machine is running between world saves its active memory will be save. However, if it - * turns off its active memory will clear. Called as the task is terminated. - */ - public HashMap getSavedData(); -} diff --git a/archive/java/resonantinduction/old/api/coding/IProcessTask.java b/archive/java/resonantinduction/old/api/coding/IProcessTask.java deleted file mode 100644 index e6077bc3..00000000 --- a/archive/java/resonantinduction/old/api/coding/IProcessTask.java +++ /dev/null @@ -1,57 +0,0 @@ -package resonantinduction.old.api.coding; - -import dan200.computer.api.IComputerAccess; -import dan200.computer.api.ILuaContext; - -/** - * Use to construct a basic task that can be used in any device that supports this interface. - * - * @Note - there are several methods that look a like. GetArgs is used to get the programs arguments - * that were set by the encoder. GetEncoderParms should be a constant set of arguments that the - * device can support. GetMemory is a list of variables that the program needs to store outside of - * the task. That way it can save values after the task has been refreshed or even deleted. - * - * @author DarkGuardsman - */ -public interface IProcessTask extends ITask -{ - /** - * Passed in from the device to the program manager then here after a Computer craft machine - * calls a this commands method name. {@IPeripheral #callMethod()} - */ - public Object[] onCCMethodCalled(IComputerAccess computer, ILuaContext context) throws Exception; - - /** - * Called when the task is being run by the devices program manager. Used mainly to setup the - * task before actually doing the task. - * - * @param world - current world - * @param location - current location - * @param armbot - armbot instance - * @param arguments - arguments for command - * @return false to stop the task here. - */ - public ProcessReturn onMethodCalled(); - - /** Update the current segment of the task */ - public ProcessReturn onUpdate(); - - /** Called when the task is finish and then cleared */ - public void terminated(); - - public static enum ProcessReturn - { - CONTINUE("Continue", "Running"), DONE("Done", "Done"), - GENERAL_ERROR("General Error", "Error program failure"), - SYNTAX_ERROR("Syntax Error", "Error incorrect syntax"), - ARGUMENT_ERROR("Arument error", "Error incorrect arguments"); - public String name, userOutput; - - private ProcessReturn(String name, String userOutput) - { - this.name = name; - this.userOutput = userOutput; - } - } - -} diff --git a/archive/java/resonantinduction/old/api/coding/IProgram.java b/archive/java/resonantinduction/old/api/coding/IProgram.java deleted file mode 100644 index a8e9e13d..00000000 --- a/archive/java/resonantinduction/old/api/coding/IProgram.java +++ /dev/null @@ -1,61 +0,0 @@ -package resonantinduction.old.api.coding; - -import java.util.HashMap; - -import net.minecraft.nbt.NBTTagCompound; -import universalelectricity.api.vector.Vector2; - -/** - * Flow chart style program. Each command in the program needs to have a stored location so it can - * be saved and loaded with its correct connections. Though the location only need to be a simple - * Column and row based system. - * - * @author DarkGuardsman - */ -public interface IProgram extends Cloneable -{ - /** Called when the program is added to an encoder, machine, or devices. */ - public void init(IProgrammableMachine machine); - - public IProgrammableMachine getMachine(); - - /** - * Variables this program has to operate. Is still limited by the actual machine. String is the - * name, Object is the starting value and data type - */ - public HashMap getDeclairedVarables(); - - /** Next task in the set. Its up to the program to increment down the list */ - public ITask getNextTask(); - - /** Gets a task at the given x y location in the program */ - public ITask getTaskAt(int col, int row); - - /** Returns the entire program as a map as grid locations and tasks. */ - public HashMap getTaskMap(); - - /** - * Sets the task at the point overriding what was there. If the task is null remove it and shift - * everything up one - */ - public void setTaskAt(int col, int row, ITask task); - - /** Inserts a task at the point. If a task is already there everything should shift down 1 */ - public void insertTask(int col, int row, ITask task); - - /** Return this program to its starting conditions */ - public void reset(); - - /** Sets the declared variable */ - public void setVar(String name, Object object); - - /** Gets a declared variable */ - public Object getVar(String name); - - /** return size in commands high and wide */ - public Vector2 getSize(); - - public NBTTagCompound save(NBTTagCompound nbt); - - public void load(NBTTagCompound nbt); -} diff --git a/archive/java/resonantinduction/old/api/coding/IProgramItem.java b/archive/java/resonantinduction/old/api/coding/IProgramItem.java deleted file mode 100644 index faccaf96..00000000 --- a/archive/java/resonantinduction/old/api/coding/IProgramItem.java +++ /dev/null @@ -1,15 +0,0 @@ -package resonantinduction.old.api.coding; - -/** - * IDs that an item can load/save a program - * - * @author Darkguardsman - */ -public interface IProgramItem -{ - /** Sets the program into the item */ - public void setProgram(IProgram program); - - /** Gets the program from the item */ - public IProgram getProgram(); -} diff --git a/archive/java/resonantinduction/old/api/coding/IProgrammableMachine.java b/archive/java/resonantinduction/old/api/coding/IProgrammableMachine.java deleted file mode 100644 index 95d586d0..00000000 --- a/archive/java/resonantinduction/old/api/coding/IProgrammableMachine.java +++ /dev/null @@ -1,27 +0,0 @@ -package resonantinduction.old.api.coding; - -import net.minecraft.world.World; -import universalelectricity.api.vector.Vector3; - -import com.builtbroken.common.Pair; - -/** - * Simple interface too say an object is programmable - * - * @author DarkGuardsman - */ -public interface IProgrammableMachine -{ - /** Current program in use */ - public IProgram getCurrentProgram(); - - /** Sets the current program */ - public void setCurrentProgram(IProgram program); - - /** - * Gets the machine location as a pair containing both the world and xyz vector. - * - * @return try to avoid returning null as every object but a fake one has a location - */ - public Pair getLocation(); -} diff --git a/archive/java/resonantinduction/old/api/coding/IRedirectTask.java b/archive/java/resonantinduction/old/api/coding/IRedirectTask.java deleted file mode 100644 index 91837347..00000000 --- a/archive/java/resonantinduction/old/api/coding/IRedirectTask.java +++ /dev/null @@ -1,14 +0,0 @@ -package resonantinduction.old.api.coding; - -/** - * Used to tell the program that this task is used to tell the program were to go next. Used by - * things like LOOP, IF, and GOTO statement's end catches. Not actually used by the statement itself - * other than to help control the flow of the program - * - * @author DarkGuardsman - */ -public interface IRedirectTask extends ILogicTask -{ - /** Should we show this in the encoder. Useful if your using a task as part of another task */ - public boolean render(); -} diff --git a/archive/java/resonantinduction/old/api/coding/ITask.java b/archive/java/resonantinduction/old/api/coding/ITask.java deleted file mode 100644 index 4e286514..00000000 --- a/archive/java/resonantinduction/old/api/coding/ITask.java +++ /dev/null @@ -1,101 +0,0 @@ -package resonantinduction.old.api.coding; - -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import resonantinduction.old.api.coding.args.ArgumentData; -import universalelectricity.api.vector.Vector2; -import calclavia.lib.utility.ISaveObj; - -/** @author DarkGuardsman */ -public interface ITask extends Cloneable, ISaveObj -{ - /** Called each time the program is loaded or changed */ - public void refresh(); - - /** Called when this task is asked to return to default */ - public void reset(); - - /** Sets the task's program reference letting it know what it is part of */ - public void setProgram(IProgram program); - - /** Location in the program */ - public int getRow(); - - public int getCol(); - - /** Sets the tasks position in the program */ - public void setPosition(int col, int row); - - /** - * Method name or rather command name this will be called. Uses both to ID this command, and do - * basic command structuring. - */ - public String getMethodName(); - - /** Type of task used mainly for GUI displays */ - public TaskType getType(); - - /** Get an argument by a given name */ - public Object getArg(String name); - - /** Get all given arguments */ - public List getArgs(); - - public void setArg(String arg, Object data); - - /** Reads the progress of the command if it was saved mid process */ - public ITask loadProgress(NBTTagCompound nbt); - - /** Saves the current progress of the current command */ - public NBTTagCompound saveProgress(NBTTagCompound nbt); - - /** - * Can this task function for this machine. Only do basic checks here as its only used to make - * sure the machine, or task will not crash while running. - */ - public boolean canUseTask(IProgrammableMachine device); - - /** - * Used to create a new task from this task. Make sure to return a fresh copy without anything. - * This includes no arguments, progress, variables, etc. As this is used to make new tasks from - * the TaskRegistry - */ - public ITask clone(); - - /** - * Texture used by encoder's to render the icon for the task. Make sure not to create a new - * instance of the resource location each call. Doing so will cause the client to experience - * increase RAM usage - */ - public ResourceLocation getTextureSheet(); - - /** Location of the texture in the sheet */ - public Vector2 getTextureUV(); - - /** Passes in a list so that the task can add to the tool tip render */ - public void getToolTips(List list); - - /** Used mainly for display purposes in the encoder */ - public static enum TaskType - { - DATA("Data", 120, 40), DEFINEDPROCESS("Defined Process", 40, 40), - PROCESS("Process", 60, 40), DECISION("Decision", 80, 40), START("Start", 20, 40), - END("End", 100, 40); - public final String name; - public final Vector2 UV; - - /** - * This is only loaded when assembly line is installed, and only used as a backup if tasks - * don't return textures - */ - public static final ResourceLocation TEXTURE = new ResourceLocation("al", "textures/gui/gui_coder_icons.png"); - - private TaskType(String name, int uu, int vv) - { - this.name = name; - this.UV = new Vector2(uu, vv); - } - } -} diff --git a/archive/java/resonantinduction/old/api/coding/ProgramHelper.java b/archive/java/resonantinduction/old/api/coding/ProgramHelper.java deleted file mode 100644 index ea934672..00000000 --- a/archive/java/resonantinduction/old/api/coding/ProgramHelper.java +++ /dev/null @@ -1,182 +0,0 @@ -package resonantinduction.old.api.coding; - -import java.util.HashMap; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import resonantinduction.old.api.coding.IProcessTask.ProcessReturn; -import universalelectricity.api.vector.Vector3; - -/** - * Basic class to handle a machine like programs for any object that uses the IProgramable - * interface. Doesn't actually do much then tell the program to function, and stores the programs - * active run time memory. - * - * @author DarkGuardsman - */ -public class ProgramHelper -{ - /** Current Program */ - protected IProgram program; - protected IProgrammableMachine bot; - /** Current task in program */ - protected ITask currentTask; - /** Do we have a memory to store values */ - boolean hasMemory = false; - boolean hasTaskBeenCalled = false, nextTask = false; - /** Max memorySize */ - protected int memorySize = 0; - /** Array of values to remember between commands */ - protected HashMap taskMemory = new HashMap(); - - public ProgramHelper(IProgrammableMachine bot) - { - this.bot = bot; - } - - /** - * Needs to be called by the armbot per tick. - * - * @return true if it is doing something - */ - public ProcessReturn onUpdate(World world, Vector3 botLocation) - { - ProcessReturn re = ProcessReturn.DONE; - if (program != null) - { - if (this.currentTask == null || this.nextTask) - { - this.nextTask(); - } - if (this.currentTask != null) - { - if (!this.hasTaskBeenCalled) - { - this.hasTaskBeenCalled = true; - if (this.currentTask instanceof IProcessTask) - { - re = ((IProcessTask) this.currentTask).onMethodCalled(); - if (re == ProcessReturn.DONE) - { - this.nextTask = true; - } - else if (re != ProcessReturn.CONTINUE) - { - return re; - } - } - } - if (this.currentTask instanceof IProcessTask) - { - re = ((IProcessTask) this.currentTask).onUpdate(); - if (re == ProcessReturn.DONE) - { - this.nextTask = true; - } - } - else - { - re = ProcessReturn.CONTINUE; - } - return re; - } - } - return re; - } - - /** Gets the next task from the program */ - public void nextTask() - { - this.hasTaskBeenCalled = false; - this.nextTask = false; - this.currentTask = program.getNextTask(); - } - - public ProgramHelper setMemoryLimit(int varableLimit) - { - if (varableLimit > 0) - { - this.memorySize = varableLimit; - this.hasMemory = true; - } - else - { - this.taskMemory = null; - } - return this; - } - - public ProgramHelper setProgram(IProgram program) - { - this.program = program; - this.onProgramChanged(); - return this; - } - - public IProgram getProgram() - { - return this.program; - } - - public void onProgramChanged() - { - this.taskMemory.clear(); - if (this.program != null) - { - HashMap memory = this.program.getDeclairedVarables(); - if (memory.size() <= memorySize) - { - // TODO load in memory and throw error stopping machine if there is not enough - } - this.program.init(this.bot); - } - } - - /** Gets the memory location */ - public Object getMemoryLocation(String var) - { - return this.taskMemory.get(var); - } - - /** Sets the memory location at the give spot. */ - public boolean setMemoryLocation(String var, Object object) - { - if (var != null) - { - if (this.taskMemory.containsKey(var)) - { - if (object == null) - { - this.taskMemory.remove(var); - } - return this.addMemory(var, object); - - } - else if (object != null && this.taskMemory.size() < this.memorySize) - { - return this.addMemory(var, object); - } - } - return false; - } - - protected boolean addMemory(String var, Object object) - { - // We don't want cheat methods to bypass the variable memory limit - if (!(object instanceof java.util.Arrays && object instanceof java.util.ArrayList && object instanceof java.util.List && object instanceof java.util.Set)) - { - return this.taskMemory.put(var, object) != null; - } - return false; - } - - public NBTTagCompound save(NBTTagCompound nbt) - { - return nbt; - } - - public void load(NBTTagCompound nbt) - { - - } -} diff --git a/archive/java/resonantinduction/old/api/coding/TaskRegistry.java b/archive/java/resonantinduction/old/api/coding/TaskRegistry.java deleted file mode 100644 index b07957c3..00000000 --- a/archive/java/resonantinduction/old/api/coding/TaskRegistry.java +++ /dev/null @@ -1,97 +0,0 @@ -package resonantinduction.old.api.coding; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import resonantinduction.old.api.IArmbot; - -/** - * Used to both register task and fake machines for the encoder to use to create new programs. - * - * @author DarkGuardsman - */ -public class TaskRegistry -{ - /** - * A class of all available commands. - * - * String - Command name. Command - The actual command class. - */ - private static final HashMap COMMANDS = new HashMap(); - - private static final HashMap SUDO_BOTS = new HashMap(); - - /** Registers a command and tells armbots that it exists */ - public static void registerCommand(ITask task) - { - if (!COMMANDS.containsKey(task.getMethodName())) - { - COMMANDS.put(task.getMethodName(), task); - } - } - - public static void registerCommand(String registryName, IProcessTask task) - { - if (!COMMANDS.containsKey(registryName)) - { - COMMANDS.put(registryName, task); - } - } - - /** returns the first command with the same name */ - public static ITask getCommand(String name) - { - for (Entry command : COMMANDS.entrySet()) - { - if (command.getKey().equalsIgnoreCase(name)) - { - return command.getValue(); - } - } - return null; - } - - /** Gets all commands with the given name though there should only be one */ - public static List getCommands(String name) - { - List tasks = new ArrayList(); - for (Entry command : COMMANDS.entrySet()) - { - if (command.getValue().getMethodName().equalsIgnoreCase(name)) - { - tasks.add(command.getValue()); - } - } - return tasks; - } - - /** - * Don't actually register the real machine. Register a fake version so that a code can use it - * for simulations - */ - public static void registerMachine(String name, IArmbot bot) - { - if (!SUDO_BOTS.containsKey(name)) - { - SUDO_BOTS.put(name, bot); - } - } - - /** - * Do not edit the return or you will change the behavior of all machine that use this list - * - * @return The list of registered sudo machines for the encoder to check against - */ - public static HashMap getSudoMachines() - { - return SUDO_BOTS; - } - - /** Get one of the sudo bots in the hashmap. Make sure to clone before editing */ - public static IArmbot getBot(String string) - { - return SUDO_BOTS.get(string); - } -} diff --git a/archive/java/resonantinduction/old/api/coding/args/ArgumentData.java b/archive/java/resonantinduction/old/api/coding/args/ArgumentData.java deleted file mode 100644 index 35e1d599..00000000 --- a/archive/java/resonantinduction/old/api/coding/args/ArgumentData.java +++ /dev/null @@ -1,80 +0,0 @@ -package resonantinduction.old.api.coding.args; - -import net.minecraft.nbt.NBTTagCompound; -import calclavia.lib.utility.ISaveObj; -import calclavia.lib.utility.NBTUtility; - -/** - * Used to store arguments in a way that can be easier to read, limit, and understand - * - * @author DarkGuardsman - */ -public class ArgumentData implements ISaveObj -{ - protected String name; - protected Object currentValue; - protected final Object defaultValue; - - public ArgumentData(String name, Object defaultValue) - { - this.name = name; - this.defaultValue = defaultValue; - this.currentValue = defaultValue; - } - - /** - * Sets the value - * - * @return true if the value was accepted - */ - public boolean setData(Object object) - { - if (this.isValid(object)) - { - this.currentValue = object; - return true; - } - return false; - } - - /** Gets the value of the stored data */ - public Object getData() - { - return this.currentValue; - } - - public String getName() - { - return this.name; - } - - public boolean isValid(Object object) - { - return object != null; - } - - /** Is this argument valid. */ - public boolean isValid() - { - return true; - } - - /** Used by things like a gui to give a warning such as limits of data this can accept */ - public String warning() - { - return ""; - } - - @Override - public void save(NBTTagCompound nbt) - { - NBTUtility.saveObject(nbt, "ObjectData", this.currentValue); - } - - @Override - public void load(NBTTagCompound nbt) - { - this.currentValue = NBTUtility.loadObject(nbt, "ObjectData"); - - } -} diff --git a/archive/java/resonantinduction/old/api/coding/args/ArgumentDoubleData.java b/archive/java/resonantinduction/old/api/coding/args/ArgumentDoubleData.java deleted file mode 100644 index 1a237da6..00000000 --- a/archive/java/resonantinduction/old/api/coding/args/ArgumentDoubleData.java +++ /dev/null @@ -1,39 +0,0 @@ -package resonantinduction.old.api.coding.args; - -import net.minecraft.util.MathHelper; -import universalelectricity.api.energy.UnitDisplay; - -/** - * Used to create argument data for the encoder. Should only be used if the value needs to be - * clearly limited inside the encoder display. - * - * @author DarkGuardsman - */ -public class ArgumentDoubleData extends ArgumentData -{ - protected double max, min; - - public ArgumentDoubleData(String name, double value, double max, double min) - { - super(name, value); - this.max = max; - this.min = min; - } - - @Override - public boolean isValid(Object object) - { - if (super.isValid()) - { - double value = MathHelper.parseDoubleWithDefault("" + object, min - 100); - return value != min - 100 && value >= min && value <= max; - } - return false; - } - - @Override - public String warning() - { - return "" + UnitDisplay.roundDecimals(min, 2) + " - " + UnitDisplay.roundDecimals(max, 2); - } -} diff --git a/archive/java/resonantinduction/old/api/coding/args/ArgumentEntityList.java b/archive/java/resonantinduction/old/api/coding/args/ArgumentEntityList.java deleted file mode 100644 index 177a9d93..00000000 --- a/archive/java/resonantinduction/old/api/coding/args/ArgumentEntityList.java +++ /dev/null @@ -1,13 +0,0 @@ -package resonantinduction.old.api.coding.args; - -import net.minecraft.entity.Entity; - -public class ArgumentEntityList extends ArgumentListData> -{ - - public ArgumentEntityList(String name, Object defaultvalue, Class... object) - { - super(name, defaultvalue, object); - } - -} diff --git a/archive/java/resonantinduction/old/api/coding/args/ArgumentFloatData.java b/archive/java/resonantinduction/old/api/coding/args/ArgumentFloatData.java deleted file mode 100644 index ebe317ca..00000000 --- a/archive/java/resonantinduction/old/api/coding/args/ArgumentFloatData.java +++ /dev/null @@ -1,39 +0,0 @@ -package resonantinduction.old.api.coding.args; - -import net.minecraft.util.MathHelper; -import universalelectricity.api.energy.UnitDisplay; - -/** - * Used to create argument data for the encoder. Should only be used if the value needs to be - * clearly limited inside the encoder display. - * - * @author DarkGuardsman - */ -public class ArgumentFloatData extends ArgumentData -{ - protected float max, min; - - public ArgumentFloatData(String name, float value, float max, float min) - { - super(name, value); - this.max = max; - this.min = min; - } - - @Override - public boolean isValid(Object object) - { - if (super.isValid()) - { - float value = (float) MathHelper.parseDoubleWithDefault("" + object, min - 100); - return value != min - 100 && value >= min && value <= max; - } - return false; - } - - @Override - public String warning() - { - return "" + UnitDisplay.roundDecimals(min, 2) + " - " + UnitDisplay.roundDecimals(max, 2); - } -} diff --git a/archive/java/resonantinduction/old/api/coding/args/ArgumentIntData.java b/archive/java/resonantinduction/old/api/coding/args/ArgumentIntData.java deleted file mode 100644 index 8af7767f..00000000 --- a/archive/java/resonantinduction/old/api/coding/args/ArgumentIntData.java +++ /dev/null @@ -1,38 +0,0 @@ -package resonantinduction.old.api.coding.args; - -import net.minecraft.util.MathHelper; - -/** - * Used to create argument data for the encoder. Should only be used if the value needs to be - * clearly limited inside the encoder display. - * - * @author DarkGuardsman - */ -public class ArgumentIntData extends ArgumentData -{ - protected int max, min; - - public ArgumentIntData(String name, int value, int max, int min) - { - super(name, value); - this.max = max; - this.min = min; - } - - @Override - public boolean isValid(Object object) - { - if (super.isValid()) - { - int value = MathHelper.parseIntWithDefault("" + object, min - 100); - return value != min - 100 && value >= min && value <= max; - } - return false; - } - - @Override - public String warning() - { - return "" + min + " - " + max; - } -} diff --git a/archive/java/resonantinduction/old/api/coding/args/ArgumentListData.java b/archive/java/resonantinduction/old/api/coding/args/ArgumentListData.java deleted file mode 100644 index 57e9beca..00000000 --- a/archive/java/resonantinduction/old/api/coding/args/ArgumentListData.java +++ /dev/null @@ -1,22 +0,0 @@ -package resonantinduction.old.api.coding.args; - -/** - * Used to store lists of data that the user can scroll threw to select one. - * - * @author DarkGuardsman - */ -public class ArgumentListData extends ArgumentData -{ - protected O[] options; - - public ArgumentListData(String name, Object defaultvalue, O... object) - { - super(name, defaultvalue); - this.options = object; - } - - public O[] getOptions() - { - return options; - } -} diff --git a/archive/java/resonantinduction/old/api/fluid/FluidMasterList.java b/archive/java/resonantinduction/old/api/fluid/FluidMasterList.java deleted file mode 100644 index e366115a..00000000 --- a/archive/java/resonantinduction/old/api/fluid/FluidMasterList.java +++ /dev/null @@ -1,71 +0,0 @@ -package resonantinduction.old.api.fluid; - -import java.util.HashMap; - -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -import com.builtbroken.common.Pair; - -public class FluidMasterList -{ - public static HashMap moltenFluids = new HashMap(); - /** - * Map containing items to FluidStack for melting down. Anything not in the list will be turned - * into slag. - */ - public static HashMap, FluidStack> meltDownMap = new HashMap(); - - public static final Fluid WATER = FluidRegistry.WATER; - public static final Fluid LAVA = FluidRegistry.LAVA; - - static - { - // http://www.engineeringtoolbox.com/melting-temperature-metals-d_860.html - moltenFluids.put("lava", 1200f); - moltenFluids.put("molten-iron", 1200f); - moltenFluids.put("molten-gold", 1063f); - moltenFluids.put("molten-silver", 1000f); - } - - /** - * Registers a fluid, by fluid name, as a molten fluids so pipes will interact with it different - * - * @param name - fluid name - * @param heatValue - temperature of the fluid - */ - public static void registerMoltenFluid(String name, float heatValue) - { - if (name != null && heatValue > 0) - { - moltenFluids.put(name, heatValue); - } - } - - /** - * Try to only register very simple items as a reverse recipe system will be used to get to the - * items used to craft the object - * - * @param id - item id - * @param meta - item meta - * @param stack - fluid stack to return - */ - public static void registerMeltDown(int id, int meta, FluidStack stack) - { - if (id > 0 && stack != null) - { - meltDownMap.put(new Pair(id, meta), stack); - } - } - - public static boolean isMolten(Fluid fluid) - { - return fluid != null && moltenFluids.containsKey(fluid.getName()); - } - - public static float getHeatPerPass(Fluid fluid) - { - return moltenFluids.get(fluid.getName()); - } -} diff --git a/archive/java/resonantinduction/old/api/fluid/FluidMixingEvent.java b/archive/java/resonantinduction/old/api/fluid/FluidMixingEvent.java deleted file mode 100644 index ba3a0807..00000000 --- a/archive/java/resonantinduction/old/api/fluid/FluidMixingEvent.java +++ /dev/null @@ -1,72 +0,0 @@ -package resonantinduction.old.api.fluid; - -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); - } - -} diff --git a/archive/java/resonantinduction/old/api/fluid/IDrain.java b/archive/java/resonantinduction/old/api/fluid/IDrain.java deleted file mode 100644 index da21c3db..00000000 --- a/archive/java/resonantinduction/old/api/fluid/IDrain.java +++ /dev/null @@ -1,44 +0,0 @@ -package resonantinduction.old.api.fluid; - -import java.util.Set; - -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.IFluidHandler; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.prefab.tile.IRotatable; - -/** - * Interface to make or use the TileEntityDrain. This is mostly a dummy interface to help the - * construction pump use the TileEntity as the center of drain location - * - * The use of ITankContainer is optional but is need for the drain to be added to a Fluid Network - * Same goes for IRotatable but make sure to return direction as the direction the drain faces - */ -public interface IDrain extends IFluidHandler, IRotatable -{ - /** - * Can the pump drain in the area in the given direction - * - * @param direction - not the side of the block but rather the direction the block is facing - * @return true if it can - */ - public boolean canDrain(ForgeDirection direction); - - /** - * Can the pump fill in the area in the given direction - * - * @param direction - not the side of the block but rather the direction the block is facing - * @return true if it can - */ - public boolean canFill(ForgeDirection direction); - - /** Gets the list of fillable blocks */ - public Set getFillList(); - - /** Gets the list of drainable blocks */ - public Set getFluidList(); - - /** Call this after the drain was used to edit a block at the location */ - public void onUse(Vector3 vec); - -} diff --git a/archive/java/resonantinduction/old/api/fluid/INetworkFluidPart.java b/archive/java/resonantinduction/old/api/fluid/INetworkFluidPart.java deleted file mode 100644 index 4f4ed1c7..00000000 --- a/archive/java/resonantinduction/old/api/fluid/INetworkFluidPart.java +++ /dev/null @@ -1,59 +0,0 @@ -package resonantinduction.old.api.fluid; - -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.core.tilenetwork.INetworkPart; - -/** - * Interface used by part that are members of a fluid tile network. Parts in the network will act as - * one entity and will be controlled by the network. This means the network need the part to access - * the parts in a set way to function correctly - * - * @author DarkGuardsman - */ -public interface INetworkFluidPart extends IFluidHandler, INetworkPart -{ - - /** Gets information about the tanks internal storage that the network has access to. */ - public FluidTankInfo[] getTankInfo(); - - /** - * Fills the pipe in the same way that fill method is called in IFluidHandler. This is used so - * the network has a direct method to access the pipes internal fluid storage - */ - public int fillTankContent(int index, FluidStack stack, boolean doFill); - - /** - * Removes from from the pipe in the same way that drain method is called in IFluidHandler. This - * is used so the network has a direct method to access the pipes internal fluid storage - */ - public FluidStack drainTankContent(int index, int volume, boolean doDrain); - - /** - * Can the fluid pass from one side to the next. Used by path finder to see if the fluid can - * move threw the pipes. - * - * @param fluid - fluid that is trying to pass threw - * @param from - direction the fluid is coming from - * @param to - direction the fluid is going to - * - * @Note only do logic in the method as it may be called many times and expect no change from - * the pipes or world. - * @return true will let the fluid pass. - */ - public boolean canPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to); - - /** - * Called while the fluid is passing threw the pipe. This is the pipes chance to modify the - * fluid or react to the fluid - * - * @param fluid - fluid that is trying to pass threw - * @param from - direction the fluid is coming from - * @param to - direction the fluid is going to - * @return true if something happened to completely stop the fluid from moving. Eg. pipe blew - * up, or jammed - */ - public boolean onPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to); -} diff --git a/archive/java/resonantinduction/old/api/fluid/INetworkPipe.java b/archive/java/resonantinduction/old/api/fluid/INetworkPipe.java deleted file mode 100644 index a664e721..00000000 --- a/archive/java/resonantinduction/old/api/fluid/INetworkPipe.java +++ /dev/null @@ -1,37 +0,0 @@ -package resonantinduction.old.api.fluid; - -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; - -/** - * A machine that acts as one with the liquid network using the networks pressure for some function - * that doesn't change the over all network pressure. So pipes, gauges, tubes, buffers, decor - * blocks. - */ -public interface INetworkPipe extends INetworkFluidPart -{ - /** - * Gets the parts max pressure limit it can handle - * - * Note this is not recommended max limit by rather actual breaking point of the part - */ - public double getMaxPressure(ForgeDirection side); - - /** - * Max flow rate of liquid flow this part from the side for the liquid type that his part will - * allow - * - * @return limit in bucket parts(1/1000 of a bucket) - */ - public int getMaxFlowRate(FluidStack stack, ForgeDirection side); - - /** - * Called when the pressure on the machine goes beyond max limits. Suggest doing random chance - * of damage or break too simulate real chances of pipe going beyond designed limits - * - * @param damageAllowed - can this tileEntity cause grief damage - * @return true if the device over pressured and destroyed itself - */ - public boolean onOverPressure(Boolean damageAllowed); - -} diff --git a/archive/java/resonantinduction/old/client/ClientProxy.java b/archive/java/resonantinduction/old/client/ClientProxy.java deleted file mode 100644 index 25dc6321..00000000 --- a/archive/java/resonantinduction/old/client/ClientProxy.java +++ /dev/null @@ -1,125 +0,0 @@ -package resonantinduction.old.client; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.entity.RenderSnowball; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; -import resonantinduction.mechanical.fluid.TileEntityReleaseValve; -import resonantinduction.mechanical.fluid.TileEntityTank; -import resonantinduction.mechanical.fluid.TileKitchenSink; -import resonantinduction.mechanical.fluid.pipes.TileEntityPipe; -import resonantinduction.mechanical.fluid.pump.TileEntityConstructionPump; -import resonantinduction.mechanical.fluid.pump.TileEntityStarterPump; -import resonantinduction.old.client.gui.GuiEncoderCoder; -import resonantinduction.old.client.gui.GuiEncoderHelp; -import resonantinduction.old.client.gui.GuiEncoderInventory; -import resonantinduction.old.client.gui.GuiImprinter; -import resonantinduction.old.client.gui.GuiProcessor; -import resonantinduction.old.client.render.BlockRenderHelper; -import resonantinduction.old.client.render.MechanicalBlockRenderingHandler; -import resonantinduction.old.client.render.ItemPipeRenderer; -import resonantinduction.old.client.render.ItemRenderFluidCan; -import resonantinduction.old.client.render.ItemTankRenderer; -import resonantinduction.old.client.render.RenderConstructionPump; -import resonantinduction.old.client.render.RenderPipe; -import resonantinduction.old.client.render.RenderPump; -import resonantinduction.old.client.render.RenderReleaseValve; -import resonantinduction.old.client.render.RenderSink; -import resonantinduction.old.client.render.RenderTank; -import resonantinduction.old.client.render.RenderTestCar; -import resonantinduction.old.client.render.RenderTurkey; -import resonantinduction.old.core.misc.EntityFarmEgg; -import resonantinduction.old.core.misc.EntityTurkey; -import resonantinduction.old.core.recipe.RecipeLoader; -import resonantinduction.old.mechanics.processor.TileEntityProcessor; -import resonantinduction.old.transport.encoder.TileEntityEncoder; -import resonantinduction.old.transport.imprinter.TileEntityImprinter; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ClientProxy extends CommonProxy -{ - - @Override - public void preInit() - { - RenderingRegistry.registerBlockHandler(new MechanicalBlockRenderingHandler()); - RenderingRegistry.registerEntityRenderingHandler(EntityTurkey.class, new RenderTurkey()); - RenderingRegistry.registerEntityRenderingHandler(EntityFarmEgg.class, new RenderSnowball(Item.egg)); - RenderingRegistry.registerEntityRenderingHandler(EntityTestCar.class, new RenderTestCar()); - } - - @Override - public void init() - { - super.init(); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPipe.class, new RenderPipe()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStarterPump.class, new RenderPump()); - // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRod.class, new RenderGearRod()); - // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGenerator.class, new - // RenderGenerator()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityReleaseValve.class, new RenderReleaseValve()); - ClientRegistry.bindTileEntitySpecialRenderer(TileKitchenSink.class, new RenderSink()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConstructionPump.class, new RenderConstructionPump()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTank.class, new RenderTank()); - - MinecraftForgeClient.registerItemRenderer(RecipeLoader.blockPipe.blockID, new ItemPipeRenderer()); - MinecraftForgeClient.registerItemRenderer(RecipeLoader.blockTank.blockID, new ItemTankRenderer()); - MinecraftForgeClient.registerItemRenderer(RecipeLoader.blockReleaseValve.blockID, new ItemPipeRenderer()); - - RenderingRegistry.registerBlockHandler(new BlockRenderHelper()); - RenderingRegistry.registerBlockHandler(new MechanicalBlockRenderingHandler()); - if (RecipeLoader.itemFluidCan != null) - MinecraftForgeClient.registerItemRenderer(RecipeLoader.itemFluidCan.itemID, new ItemRenderFluidCan()); - } - - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity != null) - { - switch (ID) - { - case GUI_IMPRINTER: - { - return new GuiImprinter(player.inventory, (TileEntityImprinter) tileEntity); - } - case GUI_ENCODER: - { - return new GuiEncoderInventory(player.inventory, (TileEntityEncoder) tileEntity); - } - case GUI_ENCODER_CODE: - { - return new GuiEncoderCoder(player.inventory, (TileEntityEncoder) tileEntity); - } - case GUI_ENCODER_HELP: - { - return new GuiEncoderHelp(player.inventory, (TileEntityEncoder) tileEntity); - } - case GUI_PROCESSOR: - { - return new GuiProcessor(player.inventory, (TileEntityProcessor) tileEntity); - } - case GUI_BATTERY_BOX: - return new GuiBatteryBox(player.inventory, (TileBatteryBox) tileEntity); - } - } - - return null; - } - - @Override - public boolean isCtrKeyDown() - { - return GuiScreen.isCtrlKeyDown(); - } - -} diff --git a/archive/java/resonantinduction/old/client/gui/EnumTaskIcon.java b/archive/java/resonantinduction/old/client/gui/EnumTaskIcon.java deleted file mode 100644 index 5807a7bf..00000000 --- a/archive/java/resonantinduction/old/client/gui/EnumTaskIcon.java +++ /dev/null @@ -1,29 +0,0 @@ -package resonantinduction.old.client.gui; - -/** Used to reference icons in the gui coder sheet - * - * @author DarkGuardsman */ -public enum EnumTaskIcon -{ - VERT_LINE(0, 0), - HORT_LINE(20, 0), - ARROW_UP(40, 0), - ARROW_RIGHT(60, 0), - ARROW_DOWN(80, 0), - ARROW_LEFT(100, 0), - VERT_LINE_DOT(120, 0), - HORT_LINE_DOT(140, 0), - LEFT_UP_BEND(160, 0), - LEFT_DOWN_BEND(180, 0), - RIGHT_UP_BEND(200, 0), - RIGHT_DOWN_BEND(220, 0); - - int uu, vv; - int sizeX = 20, sizeY = 20; - - private EnumTaskIcon(int uu, int vv) - { - this.uu = uu; - this.vv = vv; - } -} diff --git a/archive/java/resonantinduction/old/client/gui/GuiEditTask.java b/archive/java/resonantinduction/old/client/gui/GuiEditTask.java deleted file mode 100644 index 1302fc2c..00000000 --- a/archive/java/resonantinduction/old/client/gui/GuiEditTask.java +++ /dev/null @@ -1,261 +0,0 @@ -package resonantinduction.old.client.gui; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.api.coding.ITask; -import resonantinduction.old.api.coding.args.ArgumentData; -import universalelectricity.api.vector.Vector2; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.common.FMLCommonHandler; -import dark.lib.prefab.invgui.GuiBase; -import dark.lib.prefab.invgui.GuiMessageBox; -import dark.lib.prefab.invgui.IMessageBoxDialog; - -public class GuiEditTask extends GuiBase implements IMessageBoxDialog -{ - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_task_edit.png"); - - protected GuiEncoderCoder gui; - protected ITask task, editTask; - int ySpacing = 20; - int xStart = 13, yStart = 50; - protected GuiTextField[] argTextBoxes; - int getFocus = -1; - boolean newTask = false; - - public GuiEditTask(GuiEncoderCoder gui, ITask task, boolean newTask) - { - this.newTask = newTask; - this.guiSize.y = 380 / 2; - this.gui = gui; - this.task = task; - this.editTask = task.clone(); - NBTTagCompound nbt = new NBTTagCompound(); - task.save(nbt); - this.editTask.load(nbt); - } - - @Override - public void initGui() - { - super.initGui(); - this.drawButtons(); - Keyboard.enableRepeatEvents(true); - } - - @SuppressWarnings("unchecked") - public void drawButtons() - { - this.buttonList.clear(); - - this.buttonList.add(new GuiButton(0, (this.width - this.guiSize.intX()) / 2 + 13, (this.height - this.guiSize.intY()) / 2 + 135, 50, 20, "Save")); - - this.buttonList.add(new GuiButton(1, (this.width - this.guiSize.intX()) / 2 + 68, (this.height - this.guiSize.intY()) / 2 + 135, 50, 20, "Cancel")); - if (!this.newTask) - this.buttonList.add(new GuiButton(2, (this.width - this.guiSize.intX()) / 2 + 125, (this.height - this.guiSize.intY()) / 2 + 135, 40, 20, "Del")); - - if (task.getArgs() != null) - { - this.argTextBoxes = new GuiTextField[task.getArgs().size()]; - int i = 0; - for (ArgumentData arg : task.getArgs()) - { - this.argTextBoxes[i] = new GuiTextField(this.fontRenderer, (this.width - this.guiSize.intX()) / 2 + 60, (this.height - this.guiSize.intY()) / 2 + 64 + (i * this.ySpacing), 30, 10); - this.argTextBoxes[i].setMaxStringLength(30); - this.argTextBoxes[i].setVisible(true); - this.argTextBoxes[i].setText("" + arg.getData()); - i++; - } - } - - } - - @Override - public void onGuiClosed() - { - super.onGuiClosed(); - Keyboard.enableRepeatEvents(false); - } - - @Override - protected void keyTyped(char character, int keycode) - { - if (keycode == Keyboard.KEY_ESCAPE) - { - this.mc.thePlayer.closeScreen(); - } - else if (keycode == Keyboard.KEY_TAB) - { - if (this.argTextBoxes != null) - { - this.getFocus += 1; - if (this.getFocus >= this.argTextBoxes.length) - { - this.getFocus = 0; - } - } - else - { - this.getFocus = -1; - } - } - else - { - if (this.argTextBoxes != null && this.getFocus > -1 && this.getFocus < this.argTextBoxes.length) - { - if (this.argTextBoxes[this.getFocus] != null) - this.argTextBoxes[this.getFocus].textboxKeyTyped(character, keycode); - } - } - } - - @Override - protected void mouseClicked(int par1, int par2, int par3) - { - super.mouseClicked(par1, par2, par3); - this.getFocus = -1; - if (this.argTextBoxes != null) - { - for (int i = 0; i < this.argTextBoxes.length; i++) - { - GuiTextField box = this.argTextBoxes[i]; - if (box != null && box.getVisible()) - { - box.mouseClicked(par1, par2, par3); - if (box.isFocused()) - { - this.getFocus = i; - } - } - } - } - } - - @Override - protected void actionPerformed(GuiButton button) - { - super.actionPerformed(button); - switch (button.id) - { - case 0: - case 1: - - if (button.id == 0) - { - if (this.argTextBoxes != null) - { - int i = 0; - for (ArgumentData arg : task.getArgs()) - { - if (this.argTextBoxes[i] != null) - { - if (arg.isValid(this.argTextBoxes[i].getText())) - { - editTask.setArg(arg.getName(), this.argTextBoxes[i].getText()); - } - else - { - this.argTextBoxes[i].setText(""); - } - } - i++; - } - } - if (!this.newTask) - { - this.gui.getTile().updateTask(this.editTask); - FMLCommonHandler.instance().showGuiScreen(this.gui); - } - else - { - new GuiMessageBox(this, 1, "Create new Task", "Are you sure?").show(); - } - } - else - { - FMLCommonHandler.instance().showGuiScreen(this.gui); - } - - break; - case 2: - new GuiMessageBox(this, 0, "Remove Task", "Are you sure?").show(); - break; - } - } - - /** Draw the background layer for the GuiContainer (everything behind the items) */ - @Override - protected void drawBackgroundLayer(int x, int y, float var1) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - int containerWidth = (this.width - this.guiSize.intX()) / 2; - int containerHeight = (this.height - this.guiSize.intY()) / 2; - this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.guiSize.intX(), this.guiSize.intY()); - if (this.argTextBoxes != null) - { - for (int i = 0; i < this.argTextBoxes.length; i++) - { - GuiTextField box = this.argTextBoxes[i]; - if (box != null) - { - box.drawTextBox(); - } - } - } - } - - @Override - protected void drawForegroundLayer(int var2, int var3, float var1) - { - this.fontRenderer.drawString("Edit Task", (int) (this.guiSize.intX() / 2 - 7 * 2.5), 5, 4210752); - this.fontRenderer.drawString("Task: " + "\u00a77" + this.task.getMethodName(), ((this.guiSize.intX() / 2) - 70), 20, 4210752); - this.fontRenderer.drawString("----Task Arguments---- ", ((this.guiSize.intX() / 2) - 70), 50, 4210752); - - int i = 0; - if (task.getArgs() != null) - { - for (ArgumentData arg : task.getArgs()) - { - i++; - this.fontRenderer.drawString(arg.getName() + ":", ((this.guiSize.intX() / 2) - 70), 45 + (i * this.ySpacing), 4210752); - this.fontRenderer.drawString(arg.warning(), ((this.guiSize.intX() / 2) + 11), 45 + (i * this.ySpacing), 4210752); - - } - } - else - { - this.fontRenderer.drawString("\u00a77" + " No editable args ", ((this.guiSize.intX() / 2) - 70), 70, 4210752); - - } - - } - - @Override - public void onMessageBoxClosed(int id, boolean yes) - { - if (id == 0 && yes) - { - this.gui.getTile().removeTask(new Vector2(this.editTask.getCol(), this.editTask.getRow())); - FMLCommonHandler.instance().showGuiScreen(this.gui); - } - if (id == 1) - { - if (yes) - { - this.gui.getTile().insertTask(this.editTask); - FMLCommonHandler.instance().showGuiScreen(this.gui); - } - this.gui.insertingTask = false; - } - } -} diff --git a/archive/java/resonantinduction/old/client/gui/GuiEncoderBase.java b/archive/java/resonantinduction/old/client/gui/GuiEncoderBase.java deleted file mode 100644 index a893a41d..00000000 --- a/archive/java/resonantinduction/old/client/gui/GuiEncoderBase.java +++ /dev/null @@ -1,30 +0,0 @@ -package resonantinduction.old.client.gui; - -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import resonantinduction.core.prefab.tile.TileEntityMachine; -import resonantinduction.mechanical.CommonProxy; -import resonantinduction.old.transport.ResonantInductionTransport; -import dark.lib.prefab.invgui.ContainerFake; -import dark.lib.prefab.invgui.GuiMachineContainer; - -public class GuiEncoderBase extends GuiMachineContainer -{ - // - public GuiEncoderBase(InventoryPlayer player, TileEntityMachine tileEntity, Container container) - { - super(ResonantInductionTransport.instance, container, player, tileEntity); - this.guiID = CommonProxy.GUI_ENCODER; - this.guiID2 = CommonProxy.GUI_ENCODER_CODE; - this.guiID3 = CommonProxy.GUI_ENCODER_HELP; - this.invName = "Main"; - this.invName2 = "Coder"; - this.invName3 = "Help"; - } - - public GuiEncoderBase(InventoryPlayer player, TileEntityMachine tileEntity) - { - this(player, tileEntity, new ContainerFake(tileEntity)); - } - -} diff --git a/archive/java/resonantinduction/old/client/gui/GuiEncoderCoder.java b/archive/java/resonantinduction/old/client/gui/GuiEncoderCoder.java deleted file mode 100644 index 07413ece..00000000 --- a/archive/java/resonantinduction/old/client/gui/GuiEncoderCoder.java +++ /dev/null @@ -1,189 +0,0 @@ -package resonantinduction.old.client.gui; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; - -import resonantinduction.old.transport.encoder.TileEntityEncoder; -import dark.lib.prefab.invgui.GuiButtonImage; -import dark.lib.prefab.invgui.GuiButtonImage.ButtonIcon; - -public class GuiEncoderCoder extends GuiEncoderBase -{ - private GuiTaskList taskListGui; - GuiButtonImage left, right, up, down; - GuiButton newTask, newTask2; - String helpMessage = ""; - boolean insertingTask = false; - boolean bellow = true; - - public GuiEncoderCoder(InventoryPlayer player, TileEntityEncoder tileEntity) - { - super(player, tileEntity); - } - - @Override - public void initGui() - { - super.initGui(); - this.getTaskListElement(true); - left = new GuiButtonImage(3, containerWidth + 13, containerHeight + 120, ButtonIcon.ARROW_LEFT); - this.buttonList.add(left); - right = new GuiButtonImage(4, containerWidth + 147, containerHeight + 120, ButtonIcon.ARROW_RIGHT); - this.buttonList.add(right); - up = new GuiButtonImage(5, containerWidth + 147, containerHeight + 30, ButtonIcon.ARROW_UP); - this.buttonList.add(up); - down = new GuiButtonImage(6, containerWidth + 147, containerHeight + 100, ButtonIcon.ARROW_DOWN); - this.buttonList.add(down); - newTask = new GuiButton(7, containerWidth + 15, containerHeight + 135, 70, 10, "Insert bellow"); - this.buttonList.add(newTask); - newTask2 = new GuiButton(8, containerWidth + 90, containerHeight + 135, 70, 10, "Insert Above"); - newTask2.enabled = false; // TODO fix - this.buttonList.add(newTask2); - - } - - @Override - protected void actionPerformed(GuiButton button) - { - super.actionPerformed(button); - if (((TileEntityEncoder) tileEntity).getProgram() != null) - { - switch (button.id) - { - case 3: - getTaskListElement().scrollSide(-1); - break; - case 4: - getTaskListElement().scrollSide(1); - break; - case 5: - getTaskListElement().scroll(-1); - break; - case 6: - getTaskListElement().scroll(1); - break; - case 7: - this.insertingTask = true; - this.bellow = true; - this.helpMessage = "Click a task to create a new task"; - break; - case 8: - this.insertingTask = true; - this.bellow = false; - this.helpMessage = "Click a task to create a new task"; - break; - } - } - } - - protected GuiTaskList getTaskListElement(boolean renew) - { - if (taskListGui == null || renew) - { - if (taskListGui != null) - { - taskListGui.xPos = this.containerWidth + 25; - taskListGui.yPos = this.containerHeight + 15; - } - else - { - taskListGui = new GuiTaskList(this.tileEntity, this, this.containerWidth + 25, this.containerHeight + 15); - } - } - return this.taskListGui; - } - - @Override - public void handleMouseInput() - { - super.handleMouseInput(); - int wheel = Mouse.getEventDWheel(); - if (((TileEntityEncoder) tileEntity).getProgram() != null) - { - if (wheel > 0) - { - this.getTaskListElement().scroll(-2); - } - else if (wheel < 0) - { - this.getTaskListElement().scroll(2); - } - } - } - - @Override - protected void keyTyped(char character, int keycode) - { - if (keycode == Keyboard.KEY_ESCAPE) - { - this.mc.thePlayer.closeScreen(); - } - else if (((TileEntityEncoder) tileEntity).getProgram() != null) - { - - if (keycode == Keyboard.KEY_UP) // PAGE UP (no constant) - { - this.getTaskListElement().scroll(-1); - } - else if (keycode == Keyboard.KEY_DOWN) // PAGE DOWN (no constant) - { - this.getTaskListElement().scroll(1); - } - else if (keycode == Keyboard.KEY_LEFT) // PAGE LEFT (no constant) - { - if (this.getTaskListElement().scrollX > -5) - this.getTaskListElement().scrollSide(-1); - } - else if (keycode == Keyboard.KEY_RIGHT) // PAGE RIGHT (no constant) - { - if (this.getTaskListElement().scrollX < ((TileEntityEncoder) tileEntity).getProgram().getSize().intX()) - this.getTaskListElement().scrollSide(1); - } - } - } - - protected GuiTaskList getTaskListElement() - { - return this.getTaskListElement(false); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) - { - super.drawGuiContainerBackgroundLayer(f, i, j); - getTaskListElement().drawConsole(this.mc); - } - - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) - { - super.drawGuiContainerForegroundLayer(x, y); - taskListGui.drawGuiContainerForegroundLayer(this.mc, x, y); - if (!this.insertingTask) - { - this.helpMessage = ""; - } - this.fontRenderer.drawString(this.helpMessage, (this.xSize / 2 - 82), 150, 4210752); - - } - - @Override - protected void mouseClicked(int par1, int par2, int par3) - { - super.mouseClicked(par1, par2, par3); - if (par3 == 0) - { - this.taskListGui.mousePressed(par1, par2); - } - } - - @Override - public TileEntityEncoder getTile() - { - return (TileEntityEncoder) this.tileEntity; - } - -} diff --git a/archive/java/resonantinduction/old/client/gui/GuiEncoderHelp.java b/archive/java/resonantinduction/old/client/gui/GuiEncoderHelp.java deleted file mode 100644 index 3501ae4d..00000000 --- a/archive/java/resonantinduction/old/client/gui/GuiEncoderHelp.java +++ /dev/null @@ -1,16 +0,0 @@ -package resonantinduction.old.client.gui; - -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import resonantinduction.core.Reference; -import resonantinduction.old.transport.encoder.TileEntityEncoder; - -public class GuiEncoderHelp extends GuiEncoderBase -{ - public static final ResourceLocation TEXTURE_CODE_BACK = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_encoder_coder.png"); - - public GuiEncoderHelp(InventoryPlayer player, TileEntityEncoder tileEntity) - { - super(player, tileEntity); - } -} diff --git a/archive/java/resonantinduction/old/client/gui/GuiEncoderInventory.java b/archive/java/resonantinduction/old/client/gui/GuiEncoderInventory.java deleted file mode 100644 index 650f3409..00000000 --- a/archive/java/resonantinduction/old/client/gui/GuiEncoderInventory.java +++ /dev/null @@ -1,38 +0,0 @@ -package resonantinduction.old.client.gui; - -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.transport.encoder.ContainerEncoder; -import resonantinduction.old.transport.encoder.TileEntityEncoder; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiEncoderInventory extends GuiEncoderBase -{ - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_encoder_slot.png"); - - public GuiEncoderInventory(InventoryPlayer inventoryPlayer, TileEntityEncoder tileEntity) - { - super(inventoryPlayer, tileEntity, new ContainerEncoder(inventoryPlayer, tileEntity)); - } - - /** Draw the background layer for the GuiContainer (everything behind the items) */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int x, int y) - { - super.drawGuiContainerBackgroundLayer(par1, x, y); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - int containerWidth = (this.width - this.xSize) / 2; - int containerHeight = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(containerWidth, containerHeight - 10, 0, 0, this.xSize, this.ySize); - } -} diff --git a/archive/java/resonantinduction/old/client/gui/GuiImprinter.java b/archive/java/resonantinduction/old/client/gui/GuiImprinter.java deleted file mode 100644 index ad7f6912..00000000 --- a/archive/java/resonantinduction/old/client/gui/GuiImprinter.java +++ /dev/null @@ -1,49 +0,0 @@ -package resonantinduction.old.client.gui; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.transport.imprinter.ContainerImprinter; -import resonantinduction.old.transport.imprinter.TileEntityImprinter; -import calclavia.lib.utility.LanguageUtility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiImprinter extends GuiContainer -{ - private int containerWidth; - private int containerHeight; - private TileEntityImprinter tileEntity; - - public GuiImprinter(InventoryPlayer par1InventoryPlayer, TileEntityImprinter tileEntity) - { - super(new ContainerImprinter(par1InventoryPlayer, tileEntity)); - this.tileEntity = tileEntity; - this.ySize = 201; - } - - /** Draw the foreground layer for the GuiContainer (everything in front of the items) */ - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) - { - this.fontRenderer.drawString("Use Inventories:", 70, 58, 4210752); - this.fontRenderer.drawString("" + this.tileEntity.searchInventories, 105, 67, 4210752); - this.fontRenderer.drawString(LanguageUtility.getLocal("tile.imprinter.name"), 68, 6, 4210752); - } - - /** Draw the background layer for the GuiContainer (everything behind the items) */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) - { - this.mc.renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_imprinter.png")); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.containerWidth = (this.width - this.xSize) / 2; - this.containerHeight = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize); - } -} diff --git a/archive/java/resonantinduction/old/client/gui/GuiProcessor.java b/archive/java/resonantinduction/old/client/gui/GuiProcessor.java deleted file mode 100644 index 279062ae..00000000 --- a/archive/java/resonantinduction/old/client/gui/GuiProcessor.java +++ /dev/null @@ -1,49 +0,0 @@ -package resonantinduction.old.client.gui; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.resources.I18n; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.mechanics.processor.ContainerProcessor; -import resonantinduction.old.mechanics.processor.TileEntityProcessor; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiProcessor extends GuiContainer -{ - private static final ResourceLocation gui_texture = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "processor.png"); - private TileEntityProcessor tileEntity; - - public GuiProcessor(InventoryPlayer par1InventoryPlayer, TileEntityProcessor par2TileEntityFurnace) - { - super(new ContainerProcessor(par1InventoryPlayer, par2TileEntityFurnace)); - this.tileEntity = par2TileEntityFurnace; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) - { - String s = this.tileEntity.isInvNameLocalized() ? this.tileEntity.getInvName() : I18n.getString(this.tileEntity.getInvName()); - this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 6, 4210752); - this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(gui_texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int i1; - - i1 = (this.tileEntity.processingTicks / this.tileEntity.processingTime) * 24; - this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16); - } -} diff --git a/archive/java/resonantinduction/old/client/gui/GuiTask.java b/archive/java/resonantinduction/old/client/gui/GuiTask.java deleted file mode 100644 index ee93dbff..00000000 --- a/archive/java/resonantinduction/old/client/gui/GuiTask.java +++ /dev/null @@ -1,142 +0,0 @@ -package resonantinduction.old.client.gui; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.api.coding.IRedirectTask; -import resonantinduction.old.api.coding.ITask; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiTask extends Gui -{ - boolean isLeft = false; - private ResourceLocation gui_pic = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui@.png"); - /** Button width in pixels */ - protected int width; - - /** Button height in pixels */ - protected int height; - - /** The x position of this control. */ - public int xPosition; - - /** The y position of this control. */ - public int yPosition; - ITask task; - - /** True if this control is enabled, false to disable. */ - public boolean enabled; - - /** Hides the button completely if false. */ - public boolean drawButton; - protected boolean field_82253_i; - - public GuiTask(int x, int y, ITask task) - { - this.xPosition = x; - this.yPosition = y; - this.task = task; - this.width = 50; - this.height = 50; - this.drawButton = true; - if (task instanceof IRedirectTask) - { - this.drawButton = ((IRedirectTask) task).render(); - } - switch (task.getType()) - { - case DATA: - gui_pic = new ResourceLocation(Reference.DOMAIN,Reference.GUI_DIRECTORY + "logic/DATA.png"); - break; - case PROCESS: - gui_pic = new ResourceLocation(Reference.DOMAIN,Reference.GUI_DIRECTORY + "logic/PROCESS.png"); - break; - case DEFINEDPROCESS: - gui_pic = new ResourceLocation(Reference.DOMAIN,Reference.GUI_DIRECTORY + "logic/DEFINEDPROCESS.png"); - break; - case DECISION: - gui_pic = new ResourceLocation(Reference.DOMAIN,Reference.GUI_DIRECTORY + "logic/IF.png"); - break; - } - } - - public void drawTask(Minecraft par1Minecraft, int par2, int par3) - { - if (this.drawButton) - { - FontRenderer fontrenderer = par1Minecraft.fontRenderer; - par1Minecraft.getTextureManager().bindTexture(gui_pic); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.field_82253_i = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - int k = this.getHoverState(this.field_82253_i); - this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height); - this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height); - this.mouseDragged(par1Minecraft, par2, par3); - int l = 14737632; - - if (!this.enabled) - { - l = -6250336; - } - else if (this.field_82253_i) - { - l = 16777120; - } - - this.drawCenteredString(fontrenderer, this.task.getMethodName(), this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l); - } - } - - /** Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if - * it IS hovering over this button. */ - protected int getHoverState(boolean par1) - { - byte b0 = 1; - - if (!this.enabled) - { - b0 = 0; - } - else if (par1) - { - b0 = 2; - } - - return b0; - } - - /** Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent - * e). */ - protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) - { - } - - /** Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent - * e). */ - public void mouseReleased(int par1, int par2) - { - } - - /** Returns true if the mouse has been pressed on this control. Equivalent of - * MouseListener.mousePressed(MouseEvent e). */ - public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) - { - return this.enabled && this.drawButton && par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - } - - public boolean func_82252_a() - { - return this.field_82253_i; - } - - public void func_82251_b(int par1, int par2) - { - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/gui/GuiTaskList.java b/archive/java/resonantinduction/old/client/gui/GuiTaskList.java deleted file mode 100644 index 1529ac25..00000000 --- a/archive/java/resonantinduction/old/client/gui/GuiTaskList.java +++ /dev/null @@ -1,201 +0,0 @@ -package resonantinduction.old.client.gui; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.electrical.armbot.command.TaskEnd; -import resonantinduction.electrical.armbot.command.TaskIdle; -import resonantinduction.electrical.armbot.command.TaskStart; -import resonantinduction.old.api.coding.IProgram; -import resonantinduction.old.api.coding.IRedirectTask; -import resonantinduction.old.api.coding.ITask; -import resonantinduction.old.transport.encoder.TileEntityEncoder; -import calclavia.lib.terminal.IScroll; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.common.FMLCommonHandler; - -/** - * Not a gui itself but a component used to display task as a box inside of a gui - * - * @author DarkGuardsman - */ -public class GuiTaskList extends Gui implements IScroll -{ - protected int scrollY = 0, scrollX; - - protected TileEntity entity; - - /** The string displayed on this control. */ - public String displayString; - - int xPos, yPos; - int countX = 6, countY = 6; - GuiEncoderCoder coder; - - public GuiTaskList(TileEntity entity, GuiEncoderCoder coder, int x, int y) - { - this.xPos = x; - this.yPos = y; - this.coder = coder; - this.entity = entity; - - if (this.getProgram() != null) - { - if (this.getProgram().getSize().intX() < (this.countX / 2)) - { - this.scrollX = -2; - } - else - { - this.scrollX = 0; - } - } - else - { - this.scrollX = 0; - this.scrollY = 0; - } - - } - - public IProgram getProgram() - { - if (entity instanceof TileEntityEncoder) - { - return ((TileEntityEncoder) entity).getProgram(); - } - return null; - } - - @Override - public void scroll(int amount) - { - this.scrollY += amount; - } - - public void scrollSide(int i) - { - this.scrollX += i; - } - - @Override - public void setScroll(int length) - { - this.scrollY = length; - } - - @Override - public int getScroll() - { - return this.scrollY; - } - - public void drawConsole(Minecraft mc) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - for (int colume = 0; colume < countX; colume++) - { - int actualCol = colume + this.scrollX; - for (int row = 0; row < countY; row++) - { - int actualRow = row + this.scrollY - 1; - boolean drawnButton = false; - - if (this.getProgram() != null) - { - ITask task = this.getProgram().getTaskAt(actualCol, actualRow); - if (actualRow == -1 && colume + this.scrollX - 1 == -1) - { - task = new TaskStart(); - } - else if (actualRow == this.getProgram().getSize().intY() + 1 && colume + this.scrollX - 1 == -1) - { - task = new TaskEnd(); - } - if (task != null && (!(task instanceof IRedirectTask) || task instanceof IRedirectTask && ((IRedirectTask) task).render())) - { - drawnButton = true; - FMLClientHandler.instance().getClient().renderEngine.bindTexture(task.getTextureSheet()); - this.drawTexturedModalRect(xPos + (20 * colume), yPos + (20 * row), task.getTextureUV().intX(), task.getTextureUV().intY(), 20, 20); - } - } - if (!drawnButton) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(ITask.TaskType.TEXTURE); - this.drawTexturedModalRect(xPos + (20 * colume), yPos + (20 * row), 0, 40, 20, 20); - } - } - - } - } - - protected void drawGuiContainerForegroundLayer(Minecraft mc, int cx, int cy) - { - ITask task = this.getTaskAt(cx, cy); - if (task != null && coder != null) - { - coder.drawTooltip(cx - coder.getGuiLeft(), cy - coder.getGuiTop() + 10, "[" + task.getRow() + "," + task.getCol() + "] " + task.getMethodName()); - } - } - - public void mousePressed(int cx, int cy) - { - ITask task = this.getTaskAt(cx, cy); - if (task != null) - { - if (this.coder.insertingTask) - { - ITask t = new TaskIdle(); - if (this.coder.bellow) - { - if (task instanceof TaskEnd) - { - this.coder.helpMessage = "Can't insert bellow end"; - return; - } - t.setPosition(task.getCol(), task.getRow() + 1); - } - else - { - if (task instanceof TaskStart) - { - this.coder.helpMessage = "Can't insert above start"; - return; - } - t.setPosition(task.getCol(), task.getRow()); - } - - FMLCommonHandler.instance().showGuiScreen(new GuiEditTask(this.coder, t, true)); - } - else - { - FMLCommonHandler.instance().showGuiScreen(new GuiEditTask(this.coder, task, false)); - } - } - } - - public ITask getTaskAt(int cx, int cz) - { - if (cx >= this.xPos && cz >= this.yPos && cx < this.xPos + (this.countX * 20) + 20 && cz < this.yPos + (this.countX * 20) + 20) - { - int col = ((cx - this.xPos) / 20) + this.scrollX; - int row = ((cz - this.yPos) / 20) + this.scrollY; - if (row == 0 && col == 0) - { - return new TaskStart(); - } - else if (row == this.getProgram().getSize().intY() + 2 && col == 0) - { - return new TaskEnd(); - } - else if (this.getProgram() != null) - { - return this.getProgram().getTaskAt(col, row - 1); - } - } - return null; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelAdvancedHopper.java b/archive/java/resonantinduction/old/client/model/ModelAdvancedHopper.java deleted file mode 100644 index 3b6e4cd3..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelAdvancedHopper.java +++ /dev/null @@ -1,140 +0,0 @@ -// Date: 11/13/2013 7:19:55 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraftforge.common.ForgeDirection; - -public class ModelAdvancedHopper extends ModelBase -{ - // fields - ModelRenderer bottomConnection; - ModelRenderer center; - ModelRenderer top; - ModelRenderer top2; - ModelRenderer top3; - ModelRenderer top4; - ModelRenderer top5; - ModelRenderer frontConnection; - ModelRenderer backConnection; - ModelRenderer leftConnection; - ModelRenderer rightConnection; - - public ModelAdvancedHopper() - { - textureWidth = 128; - textureHeight = 128; - - bottomConnection = new ModelRenderer(this, 18, 0); - bottomConnection.addBox(-2F, 0F, -2F, 4, 4, 4); - bottomConnection.setRotationPoint(0F, 20F, 0F); - bottomConnection.setTextureSize(128, 128); - bottomConnection.mirror = true; - setRotation(bottomConnection, 0F, 0.7853982F, 0F); - center = new ModelRenderer(this, 45, 0); - center.addBox(-4F, 0F, -4F, 8, 6, 8); - center.setRotationPoint(0F, 14F, 0F); - center.setTextureSize(128, 128); - center.mirror = true; - setRotation(center, 0F, 0F, 0F); - top = new ModelRenderer(this, 0, 33); - top.addBox(-8F, -4F, -8F, 16, 6, 2); - top.setRotationPoint(0F, 12F, 0F); - top.setTextureSize(128, 128); - top.mirror = true; - setRotation(top, 0F, 0F, 0F); - top2 = new ModelRenderer(this, 0, 62); - top2.addBox(-8F, -4F, 6F, 16, 6, 2); - top2.setRotationPoint(0F, 12F, 0F); - top2.setTextureSize(128, 128); - top2.mirror = true; - setRotation(top2, 0F, 0F, 0F); - top3 = new ModelRenderer(this, 0, 42); - top3.addBox(-8F, -4F, -6F, 2, 6, 12); - top3.setRotationPoint(0F, 12F, 0F); - top3.setTextureSize(128, 128); - top3.mirror = true; - setRotation(top3, 0F, 0F, 0F); - top4 = new ModelRenderer(this, 30, 42); - top4.addBox(6F, -4F, -6F, 2, 6, 12); - top4.setRotationPoint(0F, 12F, 0F); - top4.setTextureSize(128, 128); - top4.mirror = true; - setRotation(top4, 0F, 0F, 0F); - top5 = new ModelRenderer(this, 61, 44); - top5.addBox(-6F, 0F, -6F, 12, 1, 12); - top5.setRotationPoint(0F, 13F, 0F); - top5.setTextureSize(128, 128); - top5.mirror = true; - setRotation(top5, 0F, 0F, 0F); - frontConnection = new ModelRenderer(this, 0, 0); - frontConnection.addBox(-2F, -2F, -4F, 4, 5, 4); - frontConnection.setRotationPoint(0F, 16F, -4F); - frontConnection.setTextureSize(128, 128); - frontConnection.mirror = true; - setRotation(frontConnection, 0F, 0F, 0F); - backConnection = new ModelRenderer(this, 0, 0); - backConnection.addBox(-2F, -2F, 0F, 4, 5, 4); - backConnection.setRotationPoint(0F, 16F, 4F); - backConnection.setTextureSize(128, 128); - backConnection.mirror = true; - setRotation(backConnection, 0F, 0F, 0F); - leftConnection = new ModelRenderer(this, 0, 0); - leftConnection.addBox(0F, -2F, -2F, 4, 5, 4); - leftConnection.setRotationPoint(4F, 16F, 0F); - leftConnection.setTextureSize(128, 128); - leftConnection.mirror = true; - setRotation(leftConnection, 0F, 0F, 0F); - rightConnection = new ModelRenderer(this, 0, 0); - rightConnection.addBox(-4F, -3F, -2F, 4, 5, 4); - rightConnection.setRotationPoint(-4F, 17F, 0F); - rightConnection.setTextureSize(128, 128); - rightConnection.mirror = true; - setRotation(rightConnection, 0F, 0F, 0F); - } - - public void render(float f5) - { - center.render(f5); - top.render(f5); - top2.render(f5); - top3.render(f5); - top4.render(f5); - top5.render(f5); - } - - public void render(float f5, ForgeDirection side) - { - switch (side) - { - case NORTH: - frontConnection.render(f5); - break; - case SOUTH: - backConnection.render(f5); - break; - case EAST: - leftConnection.render(f5); - break; - case WEST: - rightConnection.render(f5); - break; - case DOWN: - bottomConnection.render(f5); - break; - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelAngledBelt.java b/archive/java/resonantinduction/old/client/model/ModelAngledBelt.java deleted file mode 100644 index dd593cc3..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelAngledBelt.java +++ /dev/null @@ -1,81 +0,0 @@ -// Date: 1/9/2013 10:47:12 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelAngledBelt extends ModelBase -{ - // fields - ModelRenderer MRoller1; - ModelRenderer bBELT; - ModelRenderer MRoller2; - ModelRenderer tBELT; - ModelRenderer MRoller3; - - public ModelAngledBelt() - { - textureWidth = 128; - textureHeight = 128; - - MRoller1 = new ModelRenderer(this, 0, 26); - MRoller1.addBox(-7F, -1F, -1F, 14, 2, 2); - MRoller1.setRotationPoint(0F, 14F, 0F); - MRoller1.setTextureSize(128, 128); - MRoller1.mirror = true; - setRotation(MRoller1, 0.7853982F, 0F, 0F); - bBELT = new ModelRenderer(this, 0, 0); - bBELT.addBox(0F, 0F, 0F, 14, 1, 23); - bBELT.setRotationPoint(-7F, 23.5F, -8F); - bBELT.setTextureSize(128, 128); - bBELT.mirror = true; - setRotation(bBELT, 0.7853982F, 0F, 0F); - MRoller2 = new ModelRenderer(this, 0, 26); - MRoller2.addBox(-7F, -1F, -1F, 14, 2, 2); - MRoller2.setRotationPoint(0F, 9F, 5F); - MRoller2.setTextureSize(128, 128); - MRoller2.mirror = true; - setRotation(MRoller2, 0.7853982F, 0F, 0F); - tBELT = new ModelRenderer(this, 0, 0); - tBELT.addBox(0F, 0F, 0F, 14, 1, 23); - tBELT.setRotationPoint(-7F, 19F, -8F); - tBELT.setTextureSize(128, 128); - tBELT.mirror = true; - setRotation(tBELT, 0.7853982F, 0F, 0F); - MRoller3 = new ModelRenderer(this, 0, 26); - MRoller3.addBox(-7F, -1F, -1F, 14, 2, 2); - MRoller3.setRotationPoint(0F, 19F, -5F); - MRoller3.setTextureSize(128, 128); - MRoller3.mirror = true; - setRotation(MRoller3, 0.7853982F, 0F, 0F); - } - - public void render(float f5, boolean slantAdjust) - { - if (slantAdjust) - bBELT.setRotationPoint(-7F, 21.5F, -7F); - else - bBELT.setRotationPoint(-7F, 23.5F, -8F); - - MRoller1.render(f5); - bBELT.render(f5); - MRoller2.render(f5); - tBELT.render(f5); - MRoller3.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelArmbot.java b/archive/java/resonantinduction/old/client/model/ModelArmbot.java deleted file mode 100644 index fa9c4d45..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelArmbot.java +++ /dev/null @@ -1,197 +0,0 @@ -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelArmbot extends ModelBase -{ - // fields - ModelRenderer baseTop; - ModelRenderer base; - ModelRenderer armMountRight; - ModelRenderer armMountLeft; - ModelRenderer armLower; - ModelRenderer armLower2; - ModelRenderer armLower3; - ModelRenderer armUpper; - ModelRenderer baseRotation; - ModelRenderer clampBody; - ModelRenderer clampBody2; - ModelRenderer clampClawLower; - ModelRenderer clampClawLower2; - ModelRenderer clampClawLower3; - - public ModelArmbot() - { - textureWidth = 128; - textureHeight = 128; - - baseTop = new ModelRenderer(this, 0, 94); - baseTop.addBox(-6F, 0F, -6F, 12, 3, 12); - baseTop.setRotationPoint(0F, 18F, 0F); - baseTop.setTextureSize(64, 32); - baseTop.mirror = true; - setRotation(baseTop, 0F, 0F, 0F); - base = new ModelRenderer(this, 0, 109); - base.addBox(-8F, 0F, -8F, 16, 3, 16); - base.setRotationPoint(0F, 21F, 0F); - base.setTextureSize(64, 32); - base.mirror = true; - setRotation(base, 0F, 0F, 0F); - armMountRight = new ModelRenderer(this, 24, 85); - armMountRight.addBox(-3.8F, -5F, -2F, 4, 5, 4); - armMountRight.setRotationPoint(0F, 17F, 0F); - armMountRight.setTextureSize(128, 128); - armMountRight.mirror = true; - setRotation(armMountRight, 0F, 0F, 0F); - armMountLeft = new ModelRenderer(this, 0, 85); - armMountLeft.addBox(2F, -5F, -2F, 2, 5, 4); - armMountLeft.setRotationPoint(0F, 17F, 0F); - armMountLeft.setTextureSize(64, 32); - armMountLeft.mirror = true; - setRotation(armMountLeft, 0F, 0F, 0F); - armLower = new ModelRenderer(this, 116, 0); - armLower.addBox(0.3F, -15F, -1.5F, 2, 16, 4); - armLower.setRotationPoint(0F, 14F, 0F); - armLower.setTextureSize(64, 32); - armLower.mirror = true; - setRotation(armLower, 0.5235988F, 0F, 0F); - armLower2 = new ModelRenderer(this, 104, 0); - armLower2.addBox(-2.3F, -15F, -1.5F, 2, 16, 4); - armLower2.setRotationPoint(0F, 14F, 0F); - armLower2.setTextureSize(64, 32); - armLower2.mirror = true; - setRotation(armLower2, 0.5235988F, 0F, 0F); - armLower3 = new ModelRenderer(this, 92, 0); - armLower3.addBox(-1F, -14F, -2F, 2, 14, 4); - armLower3.setRotationPoint(0F, 14F, 0F); - armLower3.setTextureSize(64, 32); - armLower3.mirror = true; - setRotation(armLower3, 0.5235988F, 0F, 0F); - armUpper = new ModelRenderer(this, 0, 70); - armUpper.addBox(-1F, -10F, -1.5F, 2, 12, 3); - armUpper.setRotationPoint(0F, 2F, -7F); - armUpper.setTextureSize(64, 32); - armUpper.mirror = true; - setRotation(armUpper, 2.513274F, 0F, 0F); - baseRotation = new ModelRenderer(this, 0, 60); - baseRotation.addBox(-4.5F, 0F, -4.5F, 9, 1, 9); - baseRotation.setRotationPoint(0F, 17F, 0F); - baseRotation.setTextureSize(64, 32); - baseRotation.mirror = true; - setRotation(baseRotation, 0F, 0F, 0F); - clampBody = new ModelRenderer(this, 0, 7); - clampBody.addBox(-1.5F, -12F, -2.5F, 3, 2, 5); - clampBody.setRotationPoint(0F, 2F, -7F); - clampBody.setTextureSize(64, 32); - clampBody.mirror = true; - setRotation(clampBody, 2.513274F, 0F, 0F); - clampBody2 = new ModelRenderer(this, 0, 56); - clampBody2.addBox(-1F, -14F, -1F, 2, 2, 2); - clampBody2.setRotationPoint(0F, 2F, -7F); - clampBody2.setTextureSize(64, 32); - clampBody2.mirror = true; - setRotation(clampBody2, 2.513274F, 0F, 0F); - clampClawLower = new ModelRenderer(this, 0, 25); - clampClawLower.addBox(-1F, -4F, -1F, 2, 5, 1); - clampClawLower.setRotationPoint(0F, 13F, -15F); - clampClawLower.setTextureSize(64, 32); - clampClawLower.mirror = true; - setRotation(clampClawLower, 2.9147F, 0F, 0F); - clampClawLower2 = new ModelRenderer(this, 0, 31); - clampClawLower2.addBox(-1.2F, -3.5F, 0F, 1, 6, 1); - clampClawLower2.setRotationPoint(0F, 14F, -16F); - clampClawLower2.setTextureSize(64, 32); - clampClawLower2.mirror = true; - setRotation(clampClawLower2, 2.897247F, 0F, 0F); - clampClawLower3 = new ModelRenderer(this, 0, 0); - clampClawLower3.addBox(0.2F, -3.5F, 0F, 1, 6, 1); - clampClawLower3.setRotationPoint(0F, 14F, -16F); - clampClawLower3.setTextureSize(64, 32); - clampClawLower3.mirror = true; - setRotation(clampClawLower3, 2.897247F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - this.render(f5, entity.rotationYaw, entity.rotationPitch); - } - - public void render(float f5, float rotationYaw, float rotationPitch) - { - - /* - * armMountRight.setRotationPoint(baseRotation.rotationPointX, armMountRight.rotationPointY, - * baseRotation.rotationPointX); armMountLeft.setRotationPoint(baseRotation.rotationPointX, - * armMountLeft.rotationPointY, baseRotation.rotationPointX); - * armLower.setRotationPoint(baseRotation.rotationPointX, armLower.rotationPointY, - * baseRotation.rotationPointX); armUpper.setRotationPoint(baseRotation.rotationPointX, - * armUpper.rotationPointY, baseRotation.rotationPointX); - * baseRotation.setRotationPoint(baseRotation.rotationPointX, baseRotation.rotationPointY, - * baseRotation.rotationPointX); clampBody.setRotationPoint(baseRotation.rotationPointX, - * clampBody.rotationPointY, baseRotation.rotationPointX); - * clampBody2.setRotationPoint(baseRotation.rotationPointX, clampBody2.rotationPointY, - * baseRotation.rotationPointX); - * clampClawLower.setRotationPoint(baseRotation.rotationPointX, - * clampClawLower.rotationPointY, baseRotation.rotationPointX); - * clampClawLower2.setRotationPoint(baseRotation.rotationPointX, - * clampClawLower2.rotationPointY, baseRotation.rotationPointX); - * armMountRight.rotateAngleY = armBot.rotationYaw; armMountLeft.rotateAngleY = - * armBot.rotationYaw; armLower.rotateAngleY = armBot.rotationYaw; armUpper.rotateAngleY = - * armBot.rotationYaw; baseRotation.rotateAngleY = armBot.rotationYaw; - * clampBody.rotateAngleY = armBot.rotationYaw; clampBody2.rotateAngleY = - * armBot.rotationYaw; clampClawLower.rotateAngleY = armBot.rotationYaw; - * clampClawLower2.rotateAngleY = armBot.rotationYaw; - */ - - baseTop.render(f5); - base.render(f5); - GL11.glPushMatrix(); - GL11.glRotatef(rotationYaw, 0, 1, 0); - { - armMountRight.render(f5); - armMountLeft.render(f5); - baseRotation.render(f5); - } - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glRotatef(rotationYaw, 0, 1, 0); - GL11.glTranslatef(0f, 0.9f, 0f); - GL11.glRotatef(-rotationPitch, 1, 0, 0); - GL11.glTranslatef(0f, -0.9f, 0f); - { - armLower.render(f5); - GL11.glPushMatrix(); - GL11.glTranslatef(0f, 0.1f, -0.35f); - GL11.glRotatef(-rotationPitch, 1, 0, 0); - GL11.glTranslatef(0f, -0.05f, 0.35f); - { - armUpper.render(f5); - clampBody.render(f5); - clampBody2.render(f5); - clampClawLower.render(f5); - clampClawLower2.render(f5); - } - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelCenterTank.java b/archive/java/resonantinduction/old/client/model/ModelCenterTank.java deleted file mode 100644 index d32ae2cf..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelCenterTank.java +++ /dev/null @@ -1,45 +0,0 @@ -// Date: 8/14/2012 1:48:41 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelCenterTank extends ModelBase -{ - - ModelRenderer Block; - - public ModelCenterTank(float par1) - { - textureWidth = 128; - textureHeight = 128; - - // block - Block = new ModelRenderer(this, 0, 0); - Block.addBox(0F, 0F, 0F, 16, 16, 16); - Block.setRotationPoint(-8F, 8F, -8F); - Block.setTextureSize(128, 32); - Block.mirror = true; - setRotation(Block, 0F, 0F, 0F); - } - - public void renderBlock(float f5) - { - Block.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelConstructionPump.java b/archive/java/resonantinduction/old/client/model/ModelConstructionPump.java deleted file mode 100644 index 665bf336..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelConstructionPump.java +++ /dev/null @@ -1,94 +0,0 @@ -// Date: 4/15/2013 6:17:44 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelConstructionPump extends ModelBase -{ - // fields - ModelRenderer Side3; - ModelRenderer Motor2; - ModelRenderer Motor; - ModelRenderer side; - ModelRenderer base; - ModelRenderer side2; - ModelRenderer side4; - - public ModelConstructionPump() - { - textureWidth = 128; - textureHeight = 128; - - Side3 = new ModelRenderer(this, 46, 37); - Side3.addBox(-5F, 0F, -3F, 10, 11, 5); - Side3.setRotationPoint(0F, 10F, -4F); - Side3.setTextureSize(64, 32); - Side3.mirror = true; - setRotation(Side3, 0F, 0F, 0F); - Motor2 = new ModelRenderer(this, 10, 23); - Motor2.addBox(-4F, -4F, 0F, 8, 8, 4); - Motor2.setRotationPoint(0F, 15F, -2F); - Motor2.setTextureSize(64, 32); - Motor2.mirror = true; - setRotation(Motor2, 0F, 0F, 0F); - Motor = new ModelRenderer(this, 10, 23); - Motor.addBox(-4F, -4F, 0F, 8, 8, 4); - Motor.setRotationPoint(0F, 15F, -2F); - Motor.setTextureSize(64, 32); - Motor.mirror = true; - setRotation(Motor, 0F, 0F, 0.7853982F); - side = new ModelRenderer(this, 15, 37); - side.addBox(-5F, 0F, -3F, 10, 11, 5); - side.setRotationPoint(0F, 10F, 5F); - side.setTextureSize(64, 32); - side.mirror = true; - setRotation(side, 0F, 0F, 0F); - base = new ModelRenderer(this, 16, 54); - base.addBox(-7F, 0F, -8F, 14, 3, 16); - base.setRotationPoint(0F, 21F, 0F); - base.setTextureSize(64, 32); - base.mirror = true; - setRotation(base, 0F, 0F, 0F); - side2 = new ModelRenderer(this, 0, 37); - side2.addBox(-3F, 0F, 2F, 6, 10, 1); - side2.setRotationPoint(0F, 11F, 5F); - side2.setTextureSize(64, 32); - side2.mirror = true; - setRotation(side2, 0F, 0F, 0F); - side4 = new ModelRenderer(this, 77, 37); - side4.addBox(-3F, 0F, -3F, 6, 10, 1); - side4.setRotationPoint(0F, 11F, -5F); - side4.setTextureSize(64, 32); - side4.mirror = true; - setRotation(side4, 0F, 0F, 0F); - } - - public void render(float f5) - { - Side3.render(f5); - side.render(f5); - base.render(f5); - side2.render(f5); - side4.render(f5); - } - - public void renderMotor(float f5) - { - Motor2.render(f5); - Motor.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelConveyorBelt.java b/archive/java/resonantinduction/old/client/model/ModelConveyorBelt.java deleted file mode 100644 index 8fd11429..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelConveyorBelt.java +++ /dev/null @@ -1,244 +0,0 @@ -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelConveyorBelt extends ModelBase -{ - // fields - ModelRenderer bBELTLong; - ModelRenderer FBELT; - ModelRenderer BacBELT; - ModelRenderer BBelt; - ModelRenderer FRL; - ModelRenderer MRL; - ModelRenderer FLL; - ModelRenderer BLL; - ModelRenderer MRoller; - ModelRenderer BRoller; - ModelRenderer tBELT; - ModelRenderer FRoller; - ModelRenderer BRL; - ModelRenderer BML; - ModelRenderer tBELTLong; - ModelRenderer tBELT15; - ModelRenderer bBELT15; - ModelRenderer c4; - ModelRenderer c3; - ModelRenderer c2; - ModelRenderer c1; - - public ModelConveyorBelt() - { - textureWidth = 128; - textureHeight = 128; - - bBELTLong = new ModelRenderer(this, 0, 66); - bBELTLong.addBox(0F, 0F, 0F, 14, 1, 16); - bBELTLong.setRotationPoint(-7F, 22F, -8F); - bBELTLong.setTextureSize(128, 128); - bBELTLong.mirror = true; - setRotation(bBELTLong, 0F, 0F, 0F); - FBELT = new ModelRenderer(this, 0, 16); - FBELT.addBox(0F, 0F, 0F, 14, 2, 1); - FBELT.setRotationPoint(-7F, 20F, -8F); - FBELT.setTextureSize(128, 128); - FBELT.mirror = true; - setRotation(FBELT, 0F, 0F, 0F); - BacBELT = new ModelRenderer(this, 0, 16); - BacBELT.addBox(0F, 0F, 0F, 14, 2, 1); - BacBELT.setRotationPoint(-7F, 20F, 7F); - BacBELT.setTextureSize(128, 128); - BacBELT.mirror = true; - setRotation(BacBELT, 0F, 0F, 0F); - BBelt = new ModelRenderer(this, 0, 31); - BBelt.addBox(0F, 0F, 0F, 14, 1, 14); - BBelt.setRotationPoint(-7F, 22F, -7F); - BBelt.setTextureSize(128, 128); - BBelt.mirror = true; - setRotation(BBelt, 0F, 0F, 0F); - FRL = new ModelRenderer(this, 0, 20); - FRL.addBox(0F, 0F, 0F, 1, 3, 2); - FRL.setRotationPoint(-8F, 21F, -6F); - FRL.setTextureSize(128, 128); - FRL.mirror = true; - setRotation(FRL, 0F, 0F, 0F); - MRL = new ModelRenderer(this, 0, 20); - MRL.addBox(0F, 0F, 0F, 1, 3, 2); - MRL.setRotationPoint(-8F, 21F, -1F); - MRL.setTextureSize(128, 128); - MRL.mirror = true; - setRotation(MRL, 0F, 0F, 0F); - FLL = new ModelRenderer(this, 0, 20); - FLL.addBox(0F, 0F, 0F, 1, 3, 2); - FLL.setRotationPoint(7F, 21F, -6F); - FLL.setTextureSize(128, 128); - FLL.mirror = true; - setRotation(FLL, 0F, 0F, 0F); - BLL = new ModelRenderer(this, 0, 20); - BLL.addBox(0F, 0F, 0F, 1, 3, 2); - BLL.setRotationPoint(7F, 21F, 4F); - BLL.setTextureSize(128, 128); - BLL.mirror = true; - setRotation(BLL, 0F, 0F, 0F); - MRoller = new ModelRenderer(this, 0, 26); - MRoller.addBox(-7F, -1F, -1F, 14, 2, 2); - MRoller.setRotationPoint(0F, 21F, 0F); - MRoller.setTextureSize(128, 128); - MRoller.mirror = true; - setRotation(MRoller, 0F, 0F, 0F); - BRoller = new ModelRenderer(this, 0, 26); - BRoller.addBox(-7F, -1F, -1F, 14, 2, 2); - BRoller.setRotationPoint(0F, 21F, 5F); - BRoller.setTextureSize(128, 128); - BRoller.mirror = true; - setRotation(BRoller, 0F, 0F, 0F); - tBELT = new ModelRenderer(this, 0, 0); - tBELT.addBox(0F, 0F, 0F, 14, 1, 14); - tBELT.setRotationPoint(-7F, 19F, -7F); - tBELT.setTextureSize(128, 128); - tBELT.mirror = true; - setRotation(tBELT, 0F, 0F, 0F); - FRoller = new ModelRenderer(this, 0, 26); - FRoller.addBox(-7F, -1F, -1F, 14, 2, 2); - FRoller.setRotationPoint(0F, 21F, -5F); - FRoller.setTextureSize(128, 128); - FRoller.mirror = true; - setRotation(FRoller, 0F, 0F, 0F); - BRL = new ModelRenderer(this, 0, 20); - BRL.addBox(0F, 0F, 0F, 1, 3, 2); - BRL.setRotationPoint(-8F, 21F, 4F); - BRL.setTextureSize(128, 128); - BRL.mirror = true; - setRotation(BRL, 0F, 0F, 0F); - BML = new ModelRenderer(this, 0, 20); - BML.addBox(0F, 0F, 0F, 1, 3, 2); - BML.setRotationPoint(7F, 21F, -1F); - BML.setTextureSize(128, 128); - BML.mirror = true; - setRotation(BML, 0F, 0F, 0F); - tBELTLong = new ModelRenderer(this, 0, 48); - tBELTLong.addBox(0F, 0F, 0F, 14, 1, 16); - tBELTLong.setRotationPoint(-7F, 19F, -8F); - tBELTLong.setTextureSize(128, 128); - tBELTLong.mirror = true; - setRotation(tBELTLong, 0F, 0F, 0F); - // 15p long belts for end caps - tBELT15 = new ModelRenderer(this, 0, 84); - tBELT15.addBox(0F, 0F, 0F, 14, 1, 15); - tBELT15.setRotationPoint(-7F, 19F, -8F); - tBELT15.setTextureSize(128, 128); - tBELT15.mirror = true; - setRotation(tBELT15, 0F, 0F, 0F); - bBELT15 = new ModelRenderer(this, 0, 84); - bBELT15.addBox(0F, 0F, 0F, 14, 1, 15); - bBELT15.setRotationPoint(-7F, 22F, -8F); - bBELT15.setTextureSize(128, 128); - bBELT15.mirror = true; - setRotation(bBELT15, 0F, 0F, 0F); - // bracers if connected to machane above - c4 = new ModelRenderer(this, 60, 20); - c4.addBox(0F, 0F, 0F, 1, 16, 1); - c4.setRotationPoint(7F, 8F, 7F); - c4.setTextureSize(128, 128); - c4.mirror = true; - setRotation(c4, 0F, 0F, 0F); - c3 = new ModelRenderer(this, 60, 20); - c3.addBox(0F, 0F, 0F, 1, 16, 1); - c3.setRotationPoint(7F, 8F, -8F); - c3.setTextureSize(128, 128); - c3.mirror = true; - setRotation(c3, 0F, 0F, 0F); - c2 = new ModelRenderer(this, 60, 20); - c2.addBox(0F, 0F, 0F, 1, 16, 1); - c2.setRotationPoint(-8F, 8F, 7F); - c2.setTextureSize(128, 128); - c2.mirror = true; - setRotation(c2, 0F, 0F, 0F); - c1 = new ModelRenderer(this, 60, 20); - c1.addBox(0F, 0F, 0F, 1, 16, 1); - c1.setRotationPoint(-8F, 8F, -8F); - c1.setTextureSize(128, 128); - c1.mirror = true; - setRotation(c1, 0F, 0F, 0F); - } - - public void render(float f5, float radians, boolean front, boolean back, boolean above, boolean legs) - { - boolean mid = front && back ? true : false; - boolean leftCap = !front && back ? true : false; - boolean rightCap = front && !back ? true : false; - if (back || front) - { - // use longer belts if needs to render - // none normal - - if (leftCap) - { - FBELT.render(f5); - tBELT15.setRotationPoint(-7F, 19F, -7F); - bBELT15.setRotationPoint(-7F, 22F, -7F); - tBELT15.render(f5); - bBELT15.render(f5); - } - else if (rightCap) - { - BacBELT.render(f5); - tBELT15.setRotationPoint(-7F, 19F, -8F); - bBELT15.setRotationPoint(-7F, 22F, -8F); - tBELT15.render(f5); - bBELT15.render(f5); - } - else - { - bBELTLong.render(f5); - tBELTLong.render(f5); - } - } - else - { - // render normal if nothing is on - // either side - FBELT.render(f5); - BacBELT.render(f5); - BBelt.render(f5); - tBELT.render(f5); - } - if (above) - { - c1.render(f5); - c2.render(f5); - c3.render(f5); - c4.render(f5); - } - - // rollers - MRoller.rotateAngleX = radians; - BRoller.rotateAngleX = radians; - FRoller.rotateAngleX = radians; - MRoller.render(f5); - BRoller.render(f5); - FRoller.render(f5); - - if (legs) - { - // legs - BRL.render(f5); - BML.render(f5); - FLL.render(f5); - BLL.render(f5); - FRL.render(f5); - MRL.render(f5); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelCopperWire.java b/archive/java/resonantinduction/old/client/model/ModelCopperWire.java deleted file mode 100644 index 77ba8618..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelCopperWire.java +++ /dev/null @@ -1,108 +0,0 @@ -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraftforge.common.ForgeDirection; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelCopperWire extends ModelBase -{ - // fields - ModelRenderer Middle; - ModelRenderer Right; - ModelRenderer Left; - ModelRenderer Back; - ModelRenderer Front; - ModelRenderer Top; - ModelRenderer Bottom; - - public ModelCopperWire() - { - textureWidth = 64; - textureHeight = 32; - Middle = new ModelRenderer(this, 0, 0); - Middle.addBox(-1F, -1F, -1F, 4, 4, 4); - Middle.setRotationPoint(-1F, 15F, -1F); - Middle.setTextureSize(64, 32); - Middle.mirror = true; - setRotation(Middle, 0F, 0F, 0F); - Right = new ModelRenderer(this, 21, 0); - Right.addBox(0F, 0F, 0F, 6, 4, 4); - Right.setRotationPoint(2F, 14F, -2F); - Right.setTextureSize(64, 32); - Right.mirror = true; - setRotation(Right, 0F, 0F, 0F); - Left = new ModelRenderer(this, 21, 0); - Left.addBox(0F, 0F, 0F, 6, 4, 4); - Left.setRotationPoint(-8F, 14F, -2F); - Left.setTextureSize(64, 32); - Left.mirror = true; - setRotation(Left, 0F, 0F, 0F); - Back = new ModelRenderer(this, 0, 11); - Back.addBox(0F, 0F, 0F, 4, 4, 6); - Back.setRotationPoint(-2F, 14F, 2F); - Back.setTextureSize(64, 32); - Back.mirror = true; - setRotation(Back, 0F, 0F, 0F); - Front = new ModelRenderer(this, 0, 11); - Front.addBox(0F, 0F, 0F, 4, 4, 6); - Front.setRotationPoint(-2F, 14F, -8F); - Front.setTextureSize(64, 32); - Front.mirror = true; - setRotation(Front, 0F, 0F, 0F); - Top = new ModelRenderer(this, 21, 11); - Top.addBox(0F, 0F, 0F, 4, 6, 4); - Top.setRotationPoint(-2F, 8F, -2F); - Top.setTextureSize(64, 32); - Top.mirror = true; - setRotation(Top, 0F, 0F, 0F); - Bottom = new ModelRenderer(this, 21, 11); - Bottom.addBox(0F, 0F, 0F, 4, 6, 4); - Bottom.setRotationPoint(-2F, 18F, -2F); - Bottom.setTextureSize(64, 32); - Bottom.mirror = true; - setRotation(Bottom, 0F, 0F, 0F); - } - - public void renderSide(int i) - { - this.renderSide(ForgeDirection.getOrientation(i)); - } - - public void renderSide(ForgeDirection side) - { - switch (side) - { - case UP: - Top.render(0.0625F); - break; - case DOWN: - Bottom.render(0.0625F); - break; - case NORTH: - Back.render(0.0625F); - break; - case SOUTH: - Front.render(0.0625F); - break; - case WEST: - Left.render(0.0625F); - break; - case EAST: - Right.render(0.0625F); - break; - default: - Middle.render(0.0625F); - break; - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelCornerTank.java b/archive/java/resonantinduction/old/client/model/ModelCornerTank.java deleted file mode 100644 index b0c0dcbb..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelCornerTank.java +++ /dev/null @@ -1,86 +0,0 @@ -// Date: 8/14/2012 1:48:41 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelCornerTank extends ModelBase -{ - // Corner - ModelRenderer Shape1; - ModelRenderer Shape2; - ModelRenderer Shape3; - ModelRenderer Shape6; - ModelRenderer Shape7; - ModelRenderer Shape4; - - public ModelCornerTank(float par1) - { - textureWidth = 128; - textureHeight = 128; - - // corner - Shape1 = new ModelRenderer(this, 0, 1); - Shape1.addBox(0F, 0F, 0F, 1, 16, 20); - Shape1.setRotationPoint(7F, 8F, -7F); - Shape1.setTextureSize(128, 128); - Shape1.mirror = true; - setRotation(Shape1, 0F, -0.7853982F, 0F); - Shape2 = new ModelRenderer(this, 44, 0); - Shape2.addBox(0F, 0F, 0F, 2, 16, 2); - Shape2.setRotationPoint(-8F, 8F, 6F); - Shape2.setTextureSize(128, 128); - Shape2.mirror = true; - setRotation(Shape2, 0F, 0F, 0F); - Shape3 = new ModelRenderer(this, 44, 0); - Shape3.addBox(0F, 0F, 0F, 2, 16, 2); - Shape3.setRotationPoint(6F, 8F, -8F); - Shape3.setTextureSize(128, 128); - Shape3.mirror = true; - setRotation(Shape3, 0F, 0F, 0F); - Shape6 = new ModelRenderer(this, 0, 44); - Shape6.addBox(0F, 0F, 0F, 1, 15, 13); - Shape6.setRotationPoint(-8F, 9F, -7F); - Shape6.setTextureSize(128, 128); - Shape6.mirror = true; - setRotation(Shape6, 0F, 0F, 0F); - Shape7 = new ModelRenderer(this, 0, 73); - Shape7.addBox(0F, 0F, 0F, 14, 15, 1); - Shape7.setRotationPoint(-8F, 9F, -8F); - Shape7.setTextureSize(128, 128); - Shape7.mirror = true; - setRotation(Shape7, 0F, 0F, 0F); - Shape4 = new ModelRenderer(this, 0, 92); - Shape4.addBox(0F, 0F, 0F, 16, 1, 16); - Shape4.setRotationPoint(-8F, 8F, -8F); - Shape4.setTextureSize(128, 128); - Shape4.mirror = true; - setRotation(Shape4, 0F, 0F, 0F); - } - - public void renderCorner(float f5) - { - Shape1.render(f5); - Shape2.render(f5); - Shape3.render(f5); - Shape6.render(f5); - Shape7.render(f5); - Shape4.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelCrusher.java b/archive/java/resonantinduction/old/client/model/ModelCrusher.java deleted file mode 100644 index d6913db6..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelCrusher.java +++ /dev/null @@ -1,173 +0,0 @@ -// Date: 9/13/2013 10:47:00 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelCrusher extends ModelBase -{ - // fields - ModelRenderer base; - ModelRenderer front; - ModelRenderer back; - ModelRenderer leftSide; - ModelRenderer leftSide2; - ModelRenderer rightSide; - ModelRenderer rightSide2; - ModelRenderer leftCrusher; - ModelRenderer rightCrusher; - ModelRenderer leftPiston; - ModelRenderer rightPiston; - ModelRenderer buttonA; - ModelRenderer buttonB; - ModelRenderer top; - - public ModelCrusher() - { - textureWidth = 128; - textureHeight = 128; - - base = new ModelRenderer(this, 0, 110); - base.addBox(-8F, 0F, -8F, 16, 2, 16); - base.setRotationPoint(0F, 22F, 0F); - base.setTextureSize(128, 128); - base.mirror = true; - setRotation(base, 0F, 0F, 0F); - front = new ModelRenderer(this, 0, 30); - front.addBox(0F, 0F, 0F, 14, 5, 2); - front.setRotationPoint(-7F, 17F, -7F); - front.setTextureSize(128, 128); - front.mirror = true; - setRotation(front, 0F, 0F, 0F); - back = new ModelRenderer(this, 0, 50); - back.addBox(0F, 0F, 0F, 14, 5, 2); - back.setRotationPoint(-7F, 17F, 5F); - back.setTextureSize(128, 128); - back.mirror = true; - setRotation(back, 0F, 0F, 0F); - leftSide = new ModelRenderer(this, 104, 0); - leftSide.addBox(0F, 0F, 0F, 2, 12, 8); - leftSide.setRotationPoint(-7F, 10F, -4F); - leftSide.setTextureSize(128, 128); - leftSide.mirror = true; - setRotation(leftSide, 0F, 0F, 0F); - leftSide2 = new ModelRenderer(this, 104, 23); - leftSide2.addBox(0F, 0F, 0F, 1, 11, 7); - leftSide2.setRotationPoint(-8F, 11.33333F, -3.5F); - leftSide2.setTextureSize(128, 128); - leftSide2.mirror = true; - setRotation(leftSide2, 0F, 0F, 0F); - rightSide = new ModelRenderer(this, 80, 0); - rightSide.addBox(0F, 0F, 0F, 2, 12, 8); - rightSide.setRotationPoint(5F, 10F, -4F); - rightSide.setTextureSize(128, 128); - rightSide.mirror = true; - setRotation(rightSide, 0F, 0F, 0F); - rightSide2 = new ModelRenderer(this, 80, 23); - rightSide2.addBox(0F, 0F, 0F, 1, 11, 7); - rightSide2.setRotationPoint(7F, 11.33333F, -3.5F); - rightSide2.setTextureSize(128, 128); - rightSide2.mirror = true; - setRotation(rightSide2, 0F, 0F, 0F); - leftCrusher = new ModelRenderer(this, 104, 45); - leftCrusher.addBox(-1F, 0F, 0F, 2, 10, 10); - leftCrusher.setRotationPoint(-3F, 11F, -5F); - leftCrusher.setTextureSize(128, 128); - leftCrusher.mirror = true; - setRotation(leftCrusher, 0F, 0F, 0F); - rightCrusher = new ModelRenderer(this, 77, 45); - rightCrusher.addBox(1F, 0F, 0F, 2, 10, 10); - rightCrusher.setRotationPoint(1F, 11F, -5F); - rightCrusher.setTextureSize(128, 128); - rightCrusher.mirror = true; - setRotation(rightCrusher, 0F, 0F, 0F); - leftPiston = new ModelRenderer(this, 104, 68); - leftPiston.addBox(0F, 0F, 0F, 4, 4, 4); - leftPiston.setRotationPoint(-6F, 14F, -2F); - leftPiston.setTextureSize(128, 128); - leftPiston.mirror = true; - setRotation(leftPiston, 0F, 0F, 0F); - rightPiston = new ModelRenderer(this, 80, 68); - rightPiston.addBox(-2F, 0F, 0F, 4, 4, 4); - rightPiston.setRotationPoint(4F, 14F, -2F); - rightPiston.setTextureSize(128, 128); - rightPiston.mirror = true; - setRotation(rightPiston, 0F, 0F, 0F); - buttonA = new ModelRenderer(this, 0, 20); - buttonA.addBox(0F, 0F, 0F, 3, 2, 1); - buttonA.setRotationPoint(5F, 14F, 4F); - buttonA.setTextureSize(128, 128); - buttonA.mirror = true; - setRotation(buttonA, 0F, 0F, 0F); - buttonB = new ModelRenderer(this, 0, 25); - buttonB.addBox(0F, 0F, 0F, 3, 2, 1); - buttonB.setRotationPoint(-8F, 14F, -5F); - buttonB.setTextureSize(128, 128); - buttonB.mirror = true; - setRotation(buttonB, 0F, 0F, 0F); - top = new ModelRenderer(this, 0, 68); - top.addBox(0F, 0F, 0F, 12, 2, 6); - top.setRotationPoint(-6F, 9F, -3F); - top.setTextureSize(128, 128); - top.mirror = true; - setRotation(top, 0F, 0F, 0F); - } - - public void renderBody(float f5) - { - base.render(f5); - front.render(f5); - back.render(f5); - leftSide.render(f5); - leftSide2.render(f5); - rightSide.render(f5); - rightSide2.render(f5); - buttonA.render(f5); - buttonB.render(f5); - top.render(f5); - leftPiston.render(f5); - rightPiston.render(f5); - } - - public void renderPiston(float f5, int pos) - { - leftCrusher.setRotationPoint(-3F, 11F, -5F); - rightCrusher.setRotationPoint(1F, 11F, -5F); - - if (pos > 8) - { - pos = 8; - } - if (pos < 0) - { - pos = 0; - } - float delta = pos / 4; - - if (delta < 0) - { - delta = 0; - } - if (delta > 2) - { - delta = 2; - } - leftCrusher.setRotationPoint(-3F + delta, 11F, -5F); - rightCrusher.setRotationPoint(1F - delta, 11F, -5F); - leftCrusher.render(f5); - rightCrusher.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelElecFurnace.java b/archive/java/resonantinduction/old/client/model/ModelElecFurnace.java deleted file mode 100644 index d2d13d3c..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelElecFurnace.java +++ /dev/null @@ -1,89 +0,0 @@ -// Date: 9/21/2013 11:03:18 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelRenderer; - -public class ModelElecFurnace extends ModelMachine -{ - // fields - ModelRenderer body; - ModelRenderer top; - ModelRenderer bot; - ModelRenderer door; - ModelRenderer tube1; - ModelRenderer tube2; - ModelRenderer tube3; - - public ModelElecFurnace() - { - textureWidth = 128; - textureHeight = 128; - - body = new ModelRenderer(this, 0, 25); - body.addBox(-7.5F, 0F, -7.5F, 15, 12, 10); - body.setRotationPoint(0F, 10F, 1F); - body.setTextureSize(128, 128); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - top = new ModelRenderer(this, 0, 0); - top.addBox(-8F, 0F, -8F, 16, 2, 15); - top.setRotationPoint(0F, 8F, 1F); - top.setTextureSize(128, 128); - top.mirror = true; - setRotation(top, 0F, 0F, 0F); - bot = new ModelRenderer(this, 0, 56); - bot.addBox(-8F, 0F, -8F, 16, 2, 15); - bot.setRotationPoint(0F, 22F, 1F); - bot.setTextureSize(128, 128); - bot.mirror = true; - setRotation(bot, 0F, 0F, 0F); - door = new ModelRenderer(this, 0, 81); - door.addBox(-6F, 1F, -8.5F, 12, 10, 1); - door.setRotationPoint(0F, 10F, 1F); - door.setTextureSize(128, 128); - door.mirror = true; - setRotation(door, 0F, 0F, 0F); - tube1 = new ModelRenderer(this, 0, 99); - tube1.addBox(-7.5F, 0F, -7.5F, 3, 12, 4); - tube1.setRotationPoint(1F, 10F, 11F); - tube1.setTextureSize(128, 128); - tube1.mirror = true; - setRotation(tube1, 0F, 0F, 0F); - tube2 = new ModelRenderer(this, 34, 99); - tube2.addBox(-7.5F, 0F, -7.5F, 3, 12, 4); - tube2.setRotationPoint(11F, 10F, 11F); - tube2.setTextureSize(128, 128); - tube2.mirror = true; - setRotation(tube2, 0F, 0F, 0F); - tube3 = new ModelRenderer(this, 15, 99); - tube3.addBox(-7.5F, 0F, -7.5F, 5, 12, 4); - tube3.setRotationPoint(5F, 10F, 11F); - tube3.setTextureSize(128, 128); - tube3.mirror = true; - setRotation(tube3, 0F, 0F, 0F); - } - - @Override - public void render(float f5) - { - body.render(f5); - top.render(f5); - bot.render(f5); - door.render(f5); - tube1.render(f5); - tube2.render(f5); - tube3.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelEngine.java b/archive/java/resonantinduction/old/client/model/ModelEngine.java deleted file mode 100644 index 5bb1abef..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelEngine.java +++ /dev/null @@ -1,102 +0,0 @@ -// Date: 8/24/2012 1:44:37 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelEngine extends ModelBase -{ - // fields - ModelRenderer Base; - ModelRenderer top; - ModelRenderer TopPiston; - ModelRenderer BottomPiston; - ModelRenderer center; - ModelRenderer C1; - ModelRenderer C2; - - public ModelEngine() - { - textureWidth = 64; - textureHeight = 64; - - Base = new ModelRenderer(this, 0, 20); - Base.addBox(-6F, 0F, -6F, 12, 8, 12); - Base.setRotationPoint(0F, 16F, 0F); - Base.setTextureSize(64, 64); - Base.mirror = true; - setRotation(Base, 0F, 0F, 0F); - top = new ModelRenderer(this, 0, 0); - top.addBox(-6F, 0F, -6F, 12, 8, 12); - top.setRotationPoint(0F, -8F, 0F); - top.setTextureSize(64, 64); - top.mirror = true; - setRotation(top, 0F, 0F, 0F); - TopPiston = new ModelRenderer(this, 0, 52); - TopPiston.addBox(-2F, 0F, -2F, 4, 8, 4); - TopPiston.setRotationPoint(0F, 0F, 0F); - TopPiston.setTextureSize(64, 64); - TopPiston.mirror = true; - setRotation(TopPiston, 0F, 0F, 0F); - BottomPiston = new ModelRenderer(this, 16, 52); - BottomPiston.addBox(-2F, 0F, -2F, 4, 8, 4); - BottomPiston.setRotationPoint(0F, 8F, 0F); - BottomPiston.setTextureSize(64, 64); - BottomPiston.mirror = true; - setRotation(BottomPiston, 0F, 0F, 0F); - center = new ModelRenderer(this, 32, 52); - center.addBox(-3F, 0F, -3F, 6, 6, 6); - // center.setRotationPoint(0F, 5F, 0F); - center.setTextureSize(64, 64); - center.mirror = true; - setRotation(center, 0F, 0F, 0F); - C1 = new ModelRenderer(this, 0, 41); - C1.addBox(-2F, -3F, 0F, 4, 6, 3); - C1.setRotationPoint(0F, 8F, 3F); - C1.setTextureSize(64, 64); - C1.mirror = true; - setRotation(C1, 0F, 0F, 0F); - C2 = new ModelRenderer(this, 15, 41); - C2.addBox(-2F, -3F, -3F, 4, 6, 3); - C2.setRotationPoint(0F, 8F, -3F); - C2.setTextureSize(64, 64); - C2.mirror = true; - setRotation(C2, 0F, 0F, 0F); - } - - public void renderBot(float f5) - { - Base.render(f5); - BottomPiston.render(f5); - } - - public void renderTop(float f5) - { - top.render(f5); - TopPiston.render(f5); - C1.render(f5); - C2.render(f5); - } - - public void renderMid(float f5, float p) - { - - center.setRotationPoint(0F, p, 0F); - center.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelFrackingPipe.java b/archive/java/resonantinduction/old/client/model/ModelFrackingPipe.java deleted file mode 100644 index a8266cb4..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelFrackingPipe.java +++ /dev/null @@ -1,97 +0,0 @@ -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelFrackingPipe extends ModelBase -{ - ModelRenderer Back; - ModelRenderer Top; - ModelRenderer Left; - ModelRenderer Right; - ModelRenderer Front; - ModelRenderer Bottom; - ModelRenderer Pipe; - - public ModelFrackingPipe() - { - textureWidth = 128; - textureHeight = 64; - - Back = new ModelRenderer(this, 35, 18); - Back.addBox(0F, 0F, 0F, 14, 14, 1); - Back.setRotationPoint(-7F, 9F, 7F); - Back.setTextureSize(128, 64); - Back.mirror = true; - setRotation(Back, 0F, 0F, 0F); - Top = new ModelRenderer(this, 0, 0); - Top.addBox(0F, 0F, 0F, 16, 1, 16); - Top.setRotationPoint(-8F, 8F, -8F); - Top.setTextureSize(128, 64); - Top.mirror = true; - setRotation(Top, 0F, 0F, 0F); - Left = new ModelRenderer(this, 0, 18); - Left.addBox(0F, 0F, 0F, 1, 14, 16); - Left.setRotationPoint(-8F, 9F, -8F); - Left.setTextureSize(128, 64); - Left.mirror = true; - setRotation(Left, 0F, 0F, 0F); - Right = new ModelRenderer(this, 0, 18); - Right.addBox(0F, 0F, 0F, 1, 14, 16); - Right.setRotationPoint(7F, 9F, -8F); - Right.setTextureSize(128, 64); - Right.mirror = true; - setRotation(Right, 0F, 0F, 0F); - Front = new ModelRenderer(this, 35, 18); - Front.addBox(0F, 0F, 0F, 14, 14, 1); - Front.setRotationPoint(-7F, 9F, -8F); - Front.setTextureSize(128, 64); - Front.mirror = true; - setRotation(Front, 0F, 0F, 0F); - Bottom = new ModelRenderer(this, 0, 0); - Bottom.addBox(0F, 0F, 0F, 16, 1, 16); - Bottom.setRotationPoint(-8F, 23F, -8F); - Bottom.setTextureSize(128, 64); - Bottom.mirror = true; - setRotation(Bottom, 0F, 0F, 0F); - Pipe = new ModelRenderer(this, 35, 34); - Pipe.addBox(0F, 0F, 0F, 6, 14, 6); - Pipe.setRotationPoint(-3F, 9F, -3F); - Pipe.setTextureSize(128, 64); - Pipe.mirror = true; - setRotation(Pipe, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } - - public void renderAll() - { - Back.render(0.0625F); - Top.render(0.0625F); - Left.render(0.0625F); - Right.render(0.0625F); - Front.render(0.0625F); - Bottom.render(0.0625F); - Pipe.render(0.0625F); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelFurnace.java b/archive/java/resonantinduction/old/client/model/ModelFurnace.java deleted file mode 100644 index 352393d1..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelFurnace.java +++ /dev/null @@ -1,69 +0,0 @@ -// Date: 8/14/2012 3:02:31 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelFurnace extends ModelBase -{ - // fields - ModelRenderer Body; - ModelRenderer top; - ModelRenderer bottom; - ModelRenderer Shape1; - - public ModelFurnace() - { - textureWidth = 256; - textureHeight = 256; - - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-8F, -8F, -8F, 14, 14, 12); - Body.setRotationPoint(1F, 18F, 1F); - Body.setTextureSize(64, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - top = new ModelRenderer(this, 80, 20); - top.addBox(-8F, 0F, -8F, 16, 2, 16); - top.setRotationPoint(0F, 8F, 0F); - top.setTextureSize(64, 32); - top.mirror = true; - setRotation(top, 0F, 0F, 0F); - bottom = new ModelRenderer(this, 80, 0); - bottom.addBox(-8F, 22F, -8F, 16, 2, 16); - bottom.setRotationPoint(0F, 0F, 0F); - bottom.setTextureSize(64, 32); - bottom.mirror = true; - setRotation(bottom, 0F, 0F, 0F); - Shape1 = new ModelRenderer(this, 0, 27); - Shape1.addBox(-4F, -4F, 0F, 10, 8, 1); - Shape1.setRotationPoint(-1F, 16F, 5F); - Shape1.setTextureSize(64, 32); - Shape1.mirror = true; - setRotation(Shape1, 0F, 0F, 0F); - } - - public void genRender(float f5) - { - Body.render(f5); - top.render(f5); - bottom.render(f5); - Shape1.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelGearPiston.java b/archive/java/resonantinduction/old/client/model/ModelGearPiston.java deleted file mode 100644 index e2b657ae..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelGearPiston.java +++ /dev/null @@ -1,386 +0,0 @@ -// Date: 10/1/2012 12:32:21 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelGearPiston extends ModelBase -{ - // fields - ModelRenderer PistonCover; - ModelRenderer RSpiston; - ModelRenderer LSpiston; - ModelRenderer RodPiston; - ModelRenderer Base; - ModelRenderer Front; - ModelRenderer BackCC; - ModelRenderer RightPipe; - ModelRenderer FrontCC; - ModelRenderer LeftCC; - ModelRenderer FrontPipe; - ModelRenderer Right; - ModelRenderer RightCC; - ModelRenderer Back; - ModelRenderer BackPipe; - ModelRenderer Left; - ModelRenderer LeftPipe; - ModelRenderer RigthF4; - ModelRenderer LeftF4; - ModelRenderer LeftF3; - ModelRenderer LeftF2; - ModelRenderer LeftF1; - ModelRenderer RigthF3; - ModelRenderer RigthF2; - ModelRenderer RigthF1; - ModelRenderer RigthGCC; - ModelRenderer RightSlide; - ModelRenderer midRod; - ModelRenderer RightRod2; - ModelRenderer LeftGCC; - ModelRenderer LeftRod2; - ModelRenderer LeftSlide2; - - public ModelGearPiston() - { - textureWidth = 128; - textureHeight = 128; - - PistonCover = new ModelRenderer(this, 13, 31); - PistonCover.addBox(0F, -9F, -3F, 6, 10, 6); - PistonCover.setRotationPoint(-3F, 20F, 0F); - PistonCover.setTextureSize(128, 128); - PistonCover.mirror = true; - setRotation(PistonCover, 0F, 0F, 0F); - RSpiston = new ModelRenderer(this, 0, 32); - RSpiston.addBox(-3F, -2F, -2F, 1, 7, 4); - RSpiston.setRotationPoint(1F, 3F, 0F); - RSpiston.setTextureSize(128, 128); - RSpiston.mirror = true; - setRotation(RSpiston, 0F, 0F, 0F); - LSpiston = new ModelRenderer(this, 0, 32); - LSpiston.addBox(-1F, -2F, -2F, 1, 7, 4); - LSpiston.setRotationPoint(2F, 3F, 0F); - LSpiston.setTextureSize(128, 128); - LSpiston.mirror = true; - setRotation(LSpiston, 0F, 0F, 0F); - RodPiston = new ModelRenderer(this, 0, 59); - RodPiston.addBox(-1F, -2F, -1.5F, 2, 13, 3); - RodPiston.setRotationPoint(0F, 8F, 0F); - RodPiston.setTextureSize(128, 128); - RodPiston.mirror = true; - setRotation(RodPiston, 0F, 0F, 0F); - Base = new ModelRenderer(this, 12, 49); - Base.addBox(0F, 0F, 0F, 10, 5, 10); - Base.setRotationPoint(-5F, 19F, -5F); - Base.setTextureSize(128, 128); - Base.mirror = true; - setRotation(Base, 0F, 0F, 0F); - Front = new ModelRenderer(this, 28, 68); - Front.addBox(-3F, 0F, 0F, 6, 12, 1); - Front.setRotationPoint(0F, 12F, -7F); - Front.setTextureSize(128, 128); - Front.mirror = true; - setRotation(Front, 0F, 0F, 0F); - BackCC = new ModelRenderer(this, 43, 68); - BackCC.addBox(-2F, -2F, 1F, 4, 4, 1); - BackCC.setRotationPoint(0F, 16F, 6F); - BackCC.setTextureSize(128, 128); - BackCC.mirror = true; - setRotation(BackCC, 0F, 0F, 0F); - RightPipe = new ModelRenderer(this, 12, 87); - RightPipe.addBox(0F, 0F, -2F, 2, 10, 4); - RightPipe.setRotationPoint(-6F, 14F, 0F); - RightPipe.setTextureSize(128, 128); - RightPipe.mirror = true; - setRotation(RightPipe, 0F, 0F, 0F); - FrontCC = new ModelRenderer(this, 43, 68); - FrontCC.addBox(-2F, -2F, -1F, 4, 4, 1); - FrontCC.setRotationPoint(0F, 16F, -7F); - FrontCC.setTextureSize(128, 128); - FrontCC.mirror = true; - setRotation(FrontCC, 0F, 0F, 0F); - LeftCC = new ModelRenderer(this, 43, 74); - LeftCC.addBox(0F, -2F, -2F, 1, 4, 4); - LeftCC.setRotationPoint(7F, 16F, 0F); - LeftCC.setTextureSize(128, 128); - LeftCC.mirror = true; - setRotation(LeftCC, 0F, 0F, 0F); - FrontPipe = new ModelRenderer(this, 28, 82); - FrontPipe.addBox(-2F, 0F, 0F, 4, 10, 2); - FrontPipe.setRotationPoint(0F, 14F, -6F); - FrontPipe.setTextureSize(128, 128); - FrontPipe.mirror = true; - setRotation(FrontPipe, 0F, 0F, 0F); - Right = new ModelRenderer(this, 12, 68); - Right.addBox(0F, 0F, -3F, 1, 12, 6); - Right.setRotationPoint(-7F, 12F, 0F); - Right.setTextureSize(128, 128); - Right.mirror = true; - setRotation(Right, 0F, 0F, 0F); - RightCC = new ModelRenderer(this, 43, 74); - RightCC.addBox(-1F, -2F, -2F, 1, 4, 4); - RightCC.setRotationPoint(-7F, 16F, 0F); - RightCC.setTextureSize(128, 128); - RightCC.mirror = true; - setRotation(RightCC, 0F, 0F, 0F); - Back = new ModelRenderer(this, 28, 68); - Back.addBox(-3F, 0F, 0F, 6, 12, 1); - Back.setRotationPoint(0F, 12F, 6F); - Back.setTextureSize(128, 128); - Back.mirror = true; - setRotation(Back, 0F, 0F, 0F); - BackPipe = new ModelRenderer(this, 28, 82); - BackPipe.addBox(-2F, 0F, -2F, 4, 10, 2); - BackPipe.setRotationPoint(0F, 14F, 6F); - BackPipe.setTextureSize(128, 128); - BackPipe.mirror = true; - setRotation(BackPipe, 0F, 0F, 0F); - Left = new ModelRenderer(this, 12, 68); - Left.addBox(0F, 0F, -3F, 1, 12, 6); - Left.setRotationPoint(6F, 12F, 0F); - Left.setTextureSize(128, 128); - Left.mirror = true; - setRotation(Left, 0F, 0F, 0F); - LeftPipe = new ModelRenderer(this, 12, 87); - LeftPipe.addBox(-2F, 0F, -2F, 2, 10, 4); - LeftPipe.setRotationPoint(6F, 14F, 0F); - LeftPipe.setTextureSize(128, 128); - LeftPipe.mirror = true; - setRotation(LeftPipe, 0F, 0F, 0F); - RigthF4 = new ModelRenderer(this, 0, 56); - RigthF4.addBox(-2F, 1F, 1F, 2, 1, 1); - RigthF4.setRotationPoint(-8F, 0F, 0F); - RigthF4.setTextureSize(128, 128); - RigthF4.mirror = true; - setRotation(RigthF4, 0F, 0F, 0F); - LeftF4 = new ModelRenderer(this, 0, 56); - LeftF4.addBox(0F, 1F, 1F, 2, 1, 1); - LeftF4.setRotationPoint(8F, 0F, 0F); - LeftF4.setTextureSize(128, 128); - LeftF4.mirror = true; - setRotation(LeftF4, 0.7853982F, 0F, 0F); - LeftF3 = new ModelRenderer(this, 0, 56); - LeftF3.addBox(0F, 1F, -2F, 2, 1, 1); - LeftF3.setRotationPoint(8F, 0F, 0F); - LeftF3.setTextureSize(128, 128); - LeftF3.mirror = true; - setRotation(LeftF3, 0.7853982F, 0F, 0F); - LeftF2 = new ModelRenderer(this, 0, 56); - LeftF2.addBox(0F, -2F, -2F, 2, 1, 1); - LeftF2.setRotationPoint(8F, 0F, 0F); - LeftF2.setTextureSize(128, 128); - LeftF2.mirror = true; - setRotation(LeftF2, 0.7853982F, 0F, 0F); - LeftF1 = new ModelRenderer(this, 0, 56); - LeftF1.addBox(0F, -2F, 1F, 2, 1, 1); - LeftF1.setRotationPoint(8F, 0F, 0F); - LeftF1.setTextureSize(128, 128); - LeftF1.mirror = true; - setRotation(LeftF1, 0.7853982F, 0F, 0F); - RigthF3 = new ModelRenderer(this, 0, 56); - RigthF3.addBox(-2F, 1F, -2F, 2, 1, 1); - RigthF3.setRotationPoint(-8F, 0F, 0F); - RigthF3.setTextureSize(128, 128); - RigthF3.mirror = true; - setRotation(RigthF3, 0F, 0F, 0F); - RigthF2 = new ModelRenderer(this, 0, 56); - RigthF2.addBox(-2F, -2F, 1F, 2, 1, 1); - RigthF2.setRotationPoint(-8F, 0F, 0F); - RigthF2.setTextureSize(128, 128); - RigthF2.mirror = true; - setRotation(RigthF2, 0F, 0F, 0F); - RigthF1 = new ModelRenderer(this, 0, 56); - RigthF1.addBox(-2F, -2F, -2F, 2, 1, 1); - RigthF1.setRotationPoint(-8F, 0F, 0F); - RigthF1.setTextureSize(128, 128); - RigthF1.mirror = true; - setRotation(RigthF1, 0F, 0F, 0F); - RigthGCC = new ModelRenderer(this, 12, 18); - RigthGCC.addBox(-2F, -2F, -2F, 2, 4, 4); - RigthGCC.setRotationPoint(-6F, 0F, 0F); - RigthGCC.setTextureSize(128, 128); - RigthGCC.mirror = true; - setRotation(RigthGCC, 0F, 0F, 0F); - RightSlide = new ModelRenderer(this, 0, 44); - RightSlide.addBox(0F, -2F, -2F, 1, 7, 4); - RightSlide.setRotationPoint(-4F, 0F, 0F); - RightSlide.setTextureSize(128, 128); - RightSlide.mirror = true; - setRotation(RightSlide, 0F, 0F, 0F); - LeftSlide2 = new ModelRenderer(this, 0, 27); - LeftSlide2.addBox(0F, 2F, -1F, 6, 2, 2); - LeftSlide2.setRotationPoint(-3F, 0F, 0F); - LeftSlide2.setTextureSize(128, 128); - LeftSlide2.mirror = true; - setRotation(LeftSlide2, 0F, 0F, 0F); - RightRod2 = new ModelRenderer(this, 0, 20); - RightRod2.addBox(0F, -1.5F, -1.5F, 2, 3, 3); - RightRod2.setRotationPoint(-6F, 0F, 0F); - RightRod2.setTextureSize(128, 128); - RightRod2.mirror = true; - setRotation(RightRod2, 0F, 0F, 0F); - LeftGCC = new ModelRenderer(this, 24, 18); - LeftGCC.addBox(-1F, -2F, -2F, 2, 4, 4); - LeftGCC.setRotationPoint(7F, 0F, 0F); - LeftGCC.setTextureSize(128, 128); - LeftGCC.mirror = true; - setRotation(LeftGCC, 0.7853982F, 0F, 0F); - LeftRod2 = new ModelRenderer(this, 0, 20); - LeftRod2.addBox(-3F, -1.5F, -1.5F, 2, 3, 3); - LeftRod2.setRotationPoint(7F, 0F, 0F); - LeftRod2.setTextureSize(128, 128); - LeftRod2.mirror = true; - setRotation(LeftRod2, 0F, 0F, 0F); - midRod = new ModelRenderer(this, 0, 32); - midRod.addBox(-1F, -2F, -2F, 1, 7, 4); - midRod.setRotationPoint(4F, 0F, 0F); - midRod.setTextureSize(128, 128); - midRod.mirror = true; - setRotation(midRod, 0F, 0F, 0F); - } - - public void renderBody(float f5) - { - Base.render(f5); - PistonCover.render(f5); - - } - - public void renderGear(float f5) - { - // Rod connectors - LeftF4.render(f5); - LeftF3.render(f5); - LeftF2.render(f5); - LeftF1.render(f5); - RigthF4.render(f5); - RigthF3.render(f5); - RigthF2.render(f5); - RigthF1.render(f5); - RigthGCC.render(f5); - LeftGCC.render(f5); - } - - public void renderR(float f5, int pos) - { - switch (pos) - { - case 0: - RSpiston.setRotationPoint(1F, 3F, 0F); - LSpiston.setRotationPoint(2F, 3F, 0F); - RodPiston.setRotationPoint(0F, 8F, 0F); - setRotation(RSpiston, 0F, 0F, 0F); - setRotation(LSpiston, 0F, 0F, 0F); - break; - case 1: - RodPiston.setRotationPoint(0F, 6F, 0F); - LSpiston.setRotationPoint(2F, 2F, 2F); - RSpiston.setRotationPoint(1F, 2F, 2F); - setRotation(LSpiston, -0.5235988F, 0F, 0F); - setRotation(RSpiston, -0.5235988F, 0F, 0F); - break; - case 2: - LSpiston.setRotationPoint(2F, 0F, 3F); - RSpiston.setRotationPoint(1F, 0F, 3F); - RodPiston.setRotationPoint(0F, 3F, 0F); - setRotation(RSpiston, -1.047198F, 0F, 0F); - setRotation(LSpiston, -1.047198F, 0F, 0F); - break; - case 3: - LSpiston.setRotationPoint(2F, -2F, 2F); - RSpiston.setRotationPoint(1F, -2F, 2F); - RodPiston.setRotationPoint(0F, 1F, 0F); - setRotation(LSpiston, -0.7853982F, 0F, 0F); - setRotation(RSpiston, -0.7853982F, 0F, 0F); - break; - case 4: - LSpiston.setRotationPoint(2F, -3F, 0F); - RSpiston.setRotationPoint(1F, -3F, 0F); - RodPiston.setRotationPoint(0F, 1F, 0F); - setRotation(LSpiston, 0F, 0F, 0F); - setRotation(RSpiston, 0F, 0F, 0F); - break; - case 5: - LSpiston.setRotationPoint(2F, -2F, -2F); - RSpiston.setRotationPoint(1F, -2F, -2F); - RodPiston.setRotationPoint(0F, 1F, 0F); - setRotation(LSpiston, 0.7853982F, 0F, 0F); - setRotation(RSpiston, 0.7853982F, 0F, 0F); - break; - case 6: - RSpiston.setRotationPoint(1F, 0F, -3F); - LSpiston.setRotationPoint(2F, 0F, -3F); - RodPiston.setRotationPoint(0F, 2F, 0F); - setRotation(RSpiston, 1.047198F, 0F, 0F); - setRotation(LSpiston, 1.047198F, 0F, 0F); - break; - case 7: - RodPiston.setRotationPoint(0F, 6F, 0F); - LSpiston.setRotationPoint(2F, 2F, -2F); - RSpiston.setRotationPoint(1F, 2F, -2F); - setRotation(LSpiston, 0.5235988F, 0F, 0F); - setRotation(RSpiston, 0.5235988F, 0F, 0F); - break; - } - // Piston Arm - RSpiston.render(f5); - LSpiston.render(f5); - RodPiston.render(f5); - // GearShaft - RightSlide.rotateAngleX = 0.7853982F * pos; - midRod.rotateAngleX = 0.7853982F * pos; - midRod.rotateAngleX = 0.7853982F * pos; - RightRod2.rotateAngleX = 0.7853982F * pos; - LeftRod2.rotateAngleX = 0.7853982F * pos; - LeftSlide2.rotateAngleX = 0.7853982F * pos; - RightSlide.render(f5); - midRod.render(f5); - RightRod2.render(f5); - LeftRod2.render(f5); - LeftSlide2.render(f5); - } - - public void renderLeft(float f5) - { - Left.render(f5); - LeftPipe.render(f5); - LeftCC.render(f5); - } - - public void renderRight(float f5) - { - Right.render(f5); - RightCC.render(f5); - RightPipe.render(f5); - } - - public void renderFront(float f5) - { - Front.render(f5); - FrontCC.render(f5); - FrontPipe.render(f5); - } - - public void renderBack(float f5) - { - Back.render(f5); - BackPipe.render(f5); - BackCC.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelGearRod.java b/archive/java/resonantinduction/old/client/model/ModelGearRod.java deleted file mode 100644 index 550eab1d..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelGearRod.java +++ /dev/null @@ -1,139 +0,0 @@ -// Date: 9/25/2012 4:29:17 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelGearRod extends ModelBase -{ - // fields - ModelRenderer Rod; - ModelRenderer front; - ModelRenderer back; - ModelRenderer f2; - ModelRenderer b2; - ModelRenderer b3; - ModelRenderer b4; - ModelRenderer b1; - ModelRenderer f1; - ModelRenderer f4; - ModelRenderer f3; - ModelRenderer Rod2; - - public ModelGearRod() - { - textureWidth = 64; - textureHeight = 32; - - Rod = new ModelRenderer(this, 0, 0); - Rod.addBox(-1.5F, -1.5F, 0F, 3, 3, 12); - Rod.setRotationPoint(0F, 16F, -6F); - Rod.setTextureSize(64, 32); - Rod.mirror = true; - setRotation(Rod, 0F, 0F, 0F); - front = new ModelRenderer(this, 35, 0); - front.addBox(-2F, -2F, -2F, 4, 4, 2); - front.setRotationPoint(0F, 16F, -6F); - front.setTextureSize(64, 32); - front.mirror = true; - setRotation(front, 0F, 0F, 0F); - back = new ModelRenderer(this, 35, 0); - back.addBox(-2F, -2F, 0F, 4, 4, 2); - back.setRotationPoint(0F, 16F, 6F); - back.setTextureSize(64, 32); - back.mirror = true; - setRotation(back, 0F, 0F, 0.7853982F); - f2 = new ModelRenderer(this, 0, 17); - f2.addBox(0F, 0F, 0F, 1, 1, 2); - f2.setRotationPoint(1F, 17F, -10F); - f2.setTextureSize(64, 32); - f2.mirror = true; - setRotation(f2, 0F, 0F, 0F); - b2 = new ModelRenderer(this, 0, 17); - b2.addBox(-0.5F, -0.5F, 0F, 1, 1, 2); - b2.setRotationPoint(0F, 18F, 8F); - b2.setTextureSize(64, 32); - b2.mirror = true; - setRotation(b2, 0F, 0F, 0.7853982F); - b3 = new ModelRenderer(this, 0, 17); - b3.addBox(-0.5F, -0.5F, 0F, 1, 1, 2); - b3.setRotationPoint(-2F, 16F, 8F); - b3.setTextureSize(64, 32); - b3.mirror = true; - setRotation(b3, 0F, 0F, 0.7853982F); - b4 = new ModelRenderer(this, 0, 17); - b4.addBox(-0.5F, -0.5F, 0F, 1, 1, 2); - b4.setRotationPoint(2F, 16F, 8F); - b4.setTextureSize(64, 32); - b4.mirror = true; - setRotation(b4, 0F, 0F, 0.7853982F); - b1 = new ModelRenderer(this, 0, 17); - b1.addBox(-0.5F, -0.5F, 0F, 1, 1, 2); - b1.setRotationPoint(0F, 14F, 8F); - b1.setTextureSize(64, 32); - b1.mirror = true; - setRotation(b1, 0F, 0F, 0.7853982F); - f1 = new ModelRenderer(this, 0, 17); - f1.addBox(0F, 0F, 0F, 1, 1, 2); - f1.setRotationPoint(1F, 14F, -10F); - f1.setTextureSize(64, 32); - f1.mirror = true; - setRotation(f1, 0F, 0F, 0F); - f4 = new ModelRenderer(this, 0, 17); - f4.addBox(0F, 0F, 0F, 1, 1, 2); - f4.setRotationPoint(-2F, 17F, -10F); - f4.setTextureSize(64, 32); - f4.mirror = true; - setRotation(f4, 0F, 0F, 0F); - f3 = new ModelRenderer(this, 0, 17); - f3.addBox(0F, 0F, 0F, 1, 1, 2); - f3.setRotationPoint(-2F, 14F, -10F); - f3.setTextureSize(64, 32); - f3.mirror = true; - setRotation(f3, 0F, 0F, 0F); - Rod2 = new ModelRenderer(this, 0, 0); - Rod2.addBox(-1.5F, -1.5F, 0F, 3, 3, 12); - Rod2.setRotationPoint(0F, 16F, -6F); - Rod2.setTextureSize(64, 32); - Rod2.mirror = true; - setRotation(Rod2, 0F, 0F, 0.7853982F); - } - - public void render(float f5, int pos) - { - - // Rod.rotateAngleZ = 45 * tileEntity; - Rod2.rotateAngleZ = Rod.rotateAngleZ + 45; - - Rod.render(f5); - Rod2.render(f5); - // TODO add rotation to rods - front.render(f5); - back.render(f5); - f2.render(f5); - b2.render(f5); - b3.render(f5); - b4.render(f5); - b1.render(f5); - f1.render(f5); - f4.render(f5); - f3.render(f5); - - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelGenerator.java b/archive/java/resonantinduction/old/client/model/ModelGenerator.java deleted file mode 100644 index c5b9f07c..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelGenerator.java +++ /dev/null @@ -1,193 +0,0 @@ -// Date: 12/23/2012 8:44:55 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelGenerator extends ModelBase -{ - // fields - ModelRenderer Bottom; - ModelRenderer Left; - ModelRenderer CenterRod; - ModelRenderer Right; - ModelRenderer RightTopCorner; - ModelRenderer LeftTopCorner; - ModelRenderer LeftBottomCorner; - ModelRenderer RightBottomCorner; - ModelRenderer BottomCase; - ModelRenderer TopCase; - ModelRenderer LeftBrace; - ModelRenderer RightBrace; - ModelRenderer BackBracer; - ModelRenderer FrontBracer; - ModelRenderer FrontDisc; - ModelRenderer FrontDisc2; - ModelRenderer BackDisc; - ModelRenderer BackDisc2; - - public ModelGenerator() - { - textureWidth = 128; - textureHeight = 128; - - Bottom = new ModelRenderer(this, 0, 74); - Bottom.addBox(-7F, -1F, -7F, 14, 2, 14); - Bottom.setRotationPoint(0F, 23F, 0F); - Bottom.setTextureSize(128, 128); - Bottom.mirror = true; - setRotation(Bottom, 0F, 0F, 0F); - Left = new ModelRenderer(this, 17, 49); - Left.addBox(-1F, -4F, -3F, 2, 8, 6); - Left.setRotationPoint(7F, 15F, 0F); - Left.setTextureSize(128, 128); - Left.mirror = true; - setRotation(Left, 0F, 0F, 0F); - CenterRod = new ModelRenderer(this, 62, 0); - CenterRod.addBox(-1.5F, -1.5F, -8F, 3, 3, 16); - CenterRod.setRotationPoint(0F, 15F, 0F); - CenterRod.setTextureSize(128, 128); - CenterRod.mirror = true; - setRotation(CenterRod, 0F, 0F, 0F); - Right = new ModelRenderer(this, 0, 49); - Right.addBox(-1F, -4F, -3F, 2, 8, 6); - Right.setRotationPoint(-7F, 15F, 0F); - Right.setTextureSize(128, 128); - Right.mirror = true; - setRotation(Right, 0F, 0F, 0F); - RightTopCorner = new ModelRenderer(this, 0, 35); - RightTopCorner.addBox(-2F, -6F, -3F, 2, 6, 6); - RightTopCorner.setRotationPoint(-7F, 13F, 0F); - RightTopCorner.setTextureSize(128, 128); - RightTopCorner.mirror = true; - setRotation(RightTopCorner, 0F, 0F, 1.047198F); - LeftTopCorner = new ModelRenderer(this, 17, 35); - LeftTopCorner.addBox(0F, -6F, -3F, 2, 6, 6); - LeftTopCorner.setRotationPoint(7F, 13F, 0F); - LeftTopCorner.setTextureSize(128, 128); - LeftTopCorner.mirror = true; - setRotation(LeftTopCorner, 0F, 0F, -1.047198F); - LeftBottomCorner = new ModelRenderer(this, 17, 91); - LeftBottomCorner.addBox(0F, 0F, -3F, 2, 6, 6); - LeftBottomCorner.setRotationPoint(7F, 17F, 0F); - LeftBottomCorner.setTextureSize(128, 128); - LeftBottomCorner.mirror = true; - setRotation(LeftBottomCorner, 0F, 0F, 1.047198F); - RightBottomCorner = new ModelRenderer(this, 0, 91); - RightBottomCorner.addBox(-2F, 0F, -3F, 2, 6, 6); - RightBottomCorner.setRotationPoint(-7F, 17F, 0F); - RightBottomCorner.setTextureSize(128, 128); - RightBottomCorner.mirror = true; - setRotation(RightBottomCorner, 0F, 0F, -1.047198F); - BottomCase = new ModelRenderer(this, 3, 64); - BottomCase.addBox(0F, 0F, -3F, 6, 2, 6); - BottomCase.setRotationPoint(-3F, 20F, 0F); - BottomCase.setTextureSize(128, 128); - BottomCase.mirror = true; - setRotation(BottomCase, 0F, 0F, 0F); - TopCase = new ModelRenderer(this, 3, 26); - TopCase.addBox(0F, 0F, -3F, 6, 2, 6); - TopCase.setRotationPoint(-3F, 8F, 0F); - TopCase.setTextureSize(128, 128); - TopCase.mirror = true; - setRotation(TopCase, 0F, 0F, 0F); - LeftBrace = new ModelRenderer(this, 44, 64); - LeftBrace.addBox(0F, 0F, -1.5F, 3, 6, 3); - LeftBrace.setRotationPoint(3F, 17F, 0F); - LeftBrace.setTextureSize(128, 128); - LeftBrace.mirror = true; - setRotation(LeftBrace, 0F, 0F, 0F); - RightBrace = new ModelRenderer(this, 31, 64); - RightBrace.addBox(0F, 0F, -1.5F, 3, 6, 3); - RightBrace.setRotationPoint(-6F, 17F, 0F); - RightBrace.setTextureSize(128, 128); - RightBrace.mirror = true; - setRotation(RightBrace, 0F, 0F, 0F); - BackBracer = new ModelRenderer(this, 50, 0); - BackBracer.addBox(-2F, -3F, 5F, 4, 10, 1); - BackBracer.setRotationPoint(0F, 15F, 0F); - BackBracer.setTextureSize(128, 128); - BackBracer.mirror = true; - setRotation(BackBracer, 0F, 0F, 0F); - FrontBracer = new ModelRenderer(this, 50, 0); - FrontBracer.addBox(-2F, -3F, -6F, 4, 10, 1); - FrontBracer.setRotationPoint(0F, 15F, 0F); - FrontBracer.setTextureSize(128, 128); - FrontBracer.mirror = true; - setRotation(FrontBracer, 0F, 0F, 0F); - FrontDisc = new ModelRenderer(this, 65, 25); - FrontDisc.addBox(-5F, -5F, -5F, 10, 10, 2); - FrontDisc.setRotationPoint(0F, 15F, 0F); - FrontDisc.setTextureSize(128, 128); - FrontDisc.mirror = true; - setRotation(FrontDisc, 0F, 0F, 0.7853982F); - FrontDisc2 = new ModelRenderer(this, 65, 25); - FrontDisc2.addBox(-5F, -5F, -5F, 10, 10, 2); - FrontDisc2.setRotationPoint(0F, 15F, 0F); - FrontDisc2.setTextureSize(128, 128); - FrontDisc2.mirror = true; - setRotation(FrontDisc2, 0F, 0F, 0F); - BackDisc = new ModelRenderer(this, 65, 25); - BackDisc.addBox(-5F, -5F, 3F, 10, 10, 2); - BackDisc.setRotationPoint(0F, 15F, 0F); - BackDisc.setTextureSize(128, 128); - BackDisc.mirror = true; - setRotation(BackDisc, 0F, 0F, 0.7853982F); - BackDisc2 = new ModelRenderer(this, 65, 25); - BackDisc2.addBox(-5F, -5F, 3F, 10, 10, 2); - BackDisc2.setRotationPoint(0F, 15F, 0F); - BackDisc2.setTextureSize(128, 128); - BackDisc2.mirror = true; - setRotation(BackDisc2, 0F, 0F, 0F); - } - - public void render(TileEntity ent) - { - float f5 = 0.0625F; - // noMoving renderParts - Bottom.render(f5); - Left.render(f5); - CenterRod.render(f5); - Right.render(f5); - RightTopCorner.render(f5); - LeftTopCorner.render(f5); - LeftBottomCorner.render(f5); - RightBottomCorner.render(f5); - BottomCase.render(f5); - TopCase.render(f5); - LeftBrace.render(f5); - RightBrace.render(f5); - BackBracer.render(f5); - FrontBracer.render(f5); - // Moving parts - float pos = 0; - - // change - FrontDisc.rotateAngleZ = (float) Math.toRadians(pos); - FrontDisc2.rotateAngleZ = (float) Math.toRadians(pos + 45); - BackDisc.rotateAngleZ = (float) Math.toRadians(pos); - BackDisc2.rotateAngleZ = (float) Math.toRadians(pos + 45); - - FrontDisc.render(f5); - FrontDisc2.render(f5); - BackDisc.render(f5); - BackDisc2.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelGrinder.java b/archive/java/resonantinduction/old/client/model/ModelGrinder.java deleted file mode 100644 index 429c0f69..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelGrinder.java +++ /dev/null @@ -1,221 +0,0 @@ -// Date: 9/17/2013 12:00:07 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelGrinder extends ModelBase -{ - // fields - ModelRenderer base; - ModelRenderer rightSide; - ModelRenderer leftSide; - ModelRenderer front; - ModelRenderer back; - ModelRenderer top; - ModelRenderer uDisk1; - ModelRenderer uDisk2; - ModelRenderer uDisk3; - ModelRenderer uDisk4; - ModelRenderer uDisk5; - ModelRenderer uDisk6; - ModelRenderer dDisk1; - ModelRenderer dDisk2; - ModelRenderer dDisk3; - ModelRenderer dDisk4; - ModelRenderer dDisk5; - ModelRenderer dDisk6; - - ModelRenderer[] topDiskSet; - ModelRenderer[] bottomDiskSet; - - public ModelGrinder() - { - textureWidth = 128; - textureHeight = 128; - - base = new ModelRenderer(this, 1, 109); - base.addBox(-8F, 0F, -8F, 16, 2, 16); - base.setRotationPoint(0F, 22F, 0F); - base.setTextureSize(128, 128); - base.mirror = true; - setRotation(base, 0F, 0F, 0F); - rightSide = new ModelRenderer(this, 0, 80); - rightSide.addBox(0F, 0F, 0F, 2, 13, 13); - rightSide.setRotationPoint(-8F, 9F, -6F); - rightSide.setTextureSize(128, 128); - rightSide.mirror = true; - setRotation(rightSide, 0F, 0F, 0F); - leftSide = new ModelRenderer(this, 40, 80); - leftSide.addBox(0F, 0F, 0F, 2, 13, 13); - leftSide.setRotationPoint(6F, 9F, -6F); - leftSide.setTextureSize(128, 128); - leftSide.mirror = true; - setRotation(leftSide, 0F, 0F, 0F); - front = new ModelRenderer(this, 78, 114); - front.addBox(-8F, 0F, -8F, 16, 5, 2); - front.setRotationPoint(0F, 17F, 0F); - front.setTextureSize(128, 128); - front.mirror = true; - setRotation(front, 0F, 0F, 0F); - back = new ModelRenderer(this, 78, 95); - back.addBox(-8F, 0F, -3F, 16, 13, 1); - back.setRotationPoint(0F, 9F, 10F); - back.setTextureSize(128, 128); - back.mirror = true; - setRotation(back, 0F, 0F, 0F); - top = new ModelRenderer(this, 1, 65); - top.addBox(-8F, 0F, -8F, 14, 1, 10); - top.setRotationPoint(1F, 8F, 5F); - top.setTextureSize(128, 128); - top.mirror = true; - setRotation(top, 0F, 0F, 0F); - uDisk1 = new ModelRenderer(this, 0, 0); - uDisk1.addBox(0F, -4F, -4F, 1, 8, 8); - uDisk1.setRotationPoint(-6F, 14F, 1F); - uDisk1.setTextureSize(128, 128); - uDisk1.mirror = true; - setRotation(uDisk1, 0.7853982F, 0F, 0F); - uDisk2 = new ModelRenderer(this, 0, 0); - uDisk2.addBox(0F, -4F, -4F, 1, 8, 8); - uDisk2.setRotationPoint(-4F, 14F, 1F); - uDisk2.setTextureSize(128, 128); - uDisk2.mirror = true; - setRotation(uDisk2, 0F, 0F, 0F); - uDisk3 = new ModelRenderer(this, 0, 0); - uDisk3.addBox(4F, -4F, -4F, 1, 8, 8); - uDisk3.setRotationPoint(-6F, 14F, 1F); - uDisk3.setTextureSize(128, 128); - uDisk3.mirror = true; - setRotation(uDisk3, 0.7853982F, 0F, 0F); - uDisk4 = new ModelRenderer(this, 0, 0); - uDisk4.addBox(6F, -4F, -4F, 1, 8, 8); - uDisk4.setRotationPoint(-6F, 14F, 1F); - uDisk4.setTextureSize(128, 128); - uDisk4.mirror = true; - setRotation(uDisk4, 0F, 0F, 0F); - uDisk5 = new ModelRenderer(this, 0, 0); - uDisk5.addBox(8F, -4F, -4F, 1, 8, 8); - uDisk5.setRotationPoint(-6F, 14F, 1F); - uDisk5.setTextureSize(128, 128); - uDisk5.mirror = true; - setRotation(uDisk5, 0.7853982F, 0F, 0F); - uDisk6 = new ModelRenderer(this, 0, 0); - uDisk6.addBox(10F, -4F, -4F, 1, 8, 8); - uDisk6.setRotationPoint(-6F, 14F, 1F); - uDisk6.setTextureSize(128, 128); - uDisk6.mirror = true; - setRotation(uDisk6, 0F, 0F, 0F); - dDisk1 = new ModelRenderer(this, 0, 0); - dDisk1.addBox(0F, -4F, -4F, 1, 8, 8); - dDisk1.setRotationPoint(-5F, 17F, 0F); - dDisk1.setTextureSize(128, 128); - dDisk1.mirror = true; - setRotation(dDisk1, 0F, 0F, 0F); - dDisk2 = new ModelRenderer(this, 0, 0); - dDisk2.addBox(2F, -4F, -4F, 1, 8, 8); - dDisk2.setRotationPoint(-5F, 17F, 0F); - dDisk2.setTextureSize(128, 128); - dDisk2.mirror = true; - setRotation(dDisk2, 0.7853982F, 0F, 0F); - dDisk3 = new ModelRenderer(this, 0, 0); - dDisk3.addBox(4F, -4F, -4F, 1, 8, 8); - dDisk3.setRotationPoint(-5F, 17F, 0F); - dDisk3.setTextureSize(128, 128); - dDisk3.mirror = true; - setRotation(dDisk3, 0F, 0F, 0F); - dDisk4 = new ModelRenderer(this, 0, 0); - dDisk4.addBox(6F, -4F, -4F, 1, 8, 8); - dDisk4.setRotationPoint(-5F, 17F, 0F); - dDisk4.setTextureSize(128, 128); - dDisk4.mirror = true; - setRotation(dDisk4, 0.7853982F, 0F, 0F); - dDisk5 = new ModelRenderer(this, 0, 0); - dDisk5.addBox(8F, -4F, -4F, 1, 8, 8); - dDisk5.setRotationPoint(-5F, 17F, 0F); - dDisk5.setTextureSize(128, 128); - dDisk5.mirror = true; - setRotation(dDisk5, 0F, 0F, 0F); - dDisk6 = new ModelRenderer(this, 0, 0); - dDisk6.addBox(10F, -4F, -4F, 1, 8, 8); - dDisk6.setRotationPoint(-5F, 17F, 0F); - dDisk6.setTextureSize(128, 128); - dDisk6.mirror = true; - setRotation(dDisk6, 0.7853982F, 0F, 0F); - - topDiskSet = new ModelRenderer[] { uDisk1, uDisk2, uDisk3, uDisk4, uDisk5, uDisk6 }; - bottomDiskSet = new ModelRenderer[] { dDisk1, dDisk2, dDisk3, dDisk4, dDisk5, dDisk6 }; - } - - public void renderBody(float f5) - { - base.render(f5); - rightSide.render(f5); - leftSide.render(f5); - front.render(f5); - back.render(f5); - top.render(f5); - - } - - public void renderRotation(float f5, int stage) - { - float rotation = 0.3926990816987241F * stage; - this.resetRotation(); - // Set new rotation angle - for (int i = 0; i < 6; i++) - { - topDiskSet[i].rotateAngleX += rotation; - bottomDiskSet[i].rotateAngleX -= rotation; - } - - // render - for (int i = 0; i < 6; i++) - { - topDiskSet[i].render(f5); - bottomDiskSet[i].render(f5); - } - this.resetRotation(); - } - - /** Resets default rotation of the spinning disks */ - public void resetRotation() - { - for (int i = 0; i < topDiskSet.length; i++) - { - if (i == 0 || i % 2 == 0) - { - topDiskSet[i].rotateAngleX = 0.7853982F; - } - else - { - topDiskSet[i].rotateAngleX = 0F; - } - } - for (int i = 0; i < bottomDiskSet.length; i++) - { - if (i != 0 && i % 2 != 0) - { - bottomDiskSet[i].rotateAngleX = 0.7853982F; - } - else - { - bottomDiskSet[i].rotateAngleX = 0F; - } - } - - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelHelper.java b/archive/java/resonantinduction/old/client/model/ModelHelper.java deleted file mode 100644 index bdd0c326..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelHelper.java +++ /dev/null @@ -1,203 +0,0 @@ -package resonantinduction.old.client.model; - -import static org.lwjgl.opengl.GL11.GL_QUADS; -import static org.lwjgl.opengl.GL11.glBegin; -import static org.lwjgl.opengl.GL11.glEnd; -import static org.lwjgl.opengl.GL11.glTexCoord2f; -import static org.lwjgl.opengl.GL11.glVertex3d; -import net.minecraft.util.Vec3; -import net.minecraftforge.common.ForgeDirection; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelHelper -{ - private static int gTexWidth = 64; - private static int gTexHeight = 32; - private static int sTexWidth = 64; - private static int sTexHeight = 32; - private static int texOffsetX = 0; - private static int texOffsetY = 0; - private static float texScale = 16f; // 16 pixels per world unit - private static boolean clip = false; // clip textures instead of scaling them - - /** - * @param v1 Top Left - * @param v2 Top Right - * @param v3 Bottom Right - * @param v4 Bottom Left - */ - private static void drawQuadRaw(Vec3 v1, Vec3 v2, Vec3 v3, Vec3 v4, ForgeDirection side) - { - glBegin(GL_QUADS); - - float quadWidth = 1; - float quadHeight = 1; - - float subWidth = ((float) sTexWidth / (float) gTexWidth); - float subHeight = ((float) sTexHeight / (float) gTexHeight); - float xMin = ((float) texOffsetX / sTexWidth) * subWidth; - float yMin = ((float) texOffsetY / sTexHeight) * subHeight; - float subSqX = 0; - float subSqY = 0; - float subSqWidth = 0.25f * ((float) sTexWidth / (float) gTexWidth); // constant for now - float subSqHeight = 0.5f * ((float) sTexHeight / (float) gTexHeight); - - switch (side) - { - case UP: // top - { - subSqX = 2f * subSqWidth; - subSqY = 0; - quadWidth = (float) Math.abs(v2.xCoord - v1.xCoord); - quadHeight = (float) Math.abs(v4.zCoord - v1.zCoord); - break; - } - case DOWN: // bottom - { - subSqX = 1f * subSqWidth; - subSqY = 0; - quadWidth = (float) Math.abs(v2.xCoord - v1.xCoord); - quadHeight = (float) Math.abs(v4.zCoord - v1.zCoord); - break; - } - case EAST: // right - { - subSqX = 0; - subSqY = subSqHeight; - quadWidth = (float) Math.abs(v2.zCoord - v1.zCoord); - quadHeight = (float) Math.abs(v4.yCoord - v1.yCoord); - break; - } - case WEST: // left - { - subSqX = 2f * subSqWidth; - subSqY = subSqHeight; - quadWidth = (float) Math.abs(v2.zCoord - v1.zCoord); - quadHeight = (float) Math.abs(v4.yCoord - v1.yCoord); - break; - } - case SOUTH: // back - { - subSqX = subSqWidth; - subSqY = subSqHeight; - quadWidth = (float) Math.abs(v2.xCoord - v1.xCoord); - quadHeight = (float) Math.abs(v4.yCoord - v1.yCoord); - break; - } - case NORTH: // front - { - subSqX = 3f * subSqWidth; - subSqY = subSqHeight; - quadWidth = (float) Math.abs(v2.xCoord - v1.xCoord); - quadHeight = (float) Math.abs(v4.yCoord - v1.yCoord); - break; - } - default: - break; - } - - float xMax, yMax; - - xMin += subSqX; - yMin += subSqY; - - if (clip) - { - xMin += (1f - quadWidth) * subSqWidth; - yMin += (1f - quadHeight) * subSqHeight; - xMax = xMin + (subSqWidth * quadWidth); - yMax = yMin + (subSqHeight * quadHeight); - } - else - { - xMax = xMin + (subSqWidth); - yMax = yMin + (subSqHeight); - } - - // System.out.println("xMin: " + xMin + "; xMax: " + xMax); - - glTexCoord2f(xMin, yMin); - glVertex3d(v1.xCoord, v1.yCoord, v1.zCoord); - glTexCoord2f(xMax, yMin); - glVertex3d(v2.xCoord, v2.yCoord, v2.zCoord); - glTexCoord2f(xMax, yMax); - glVertex3d(v3.xCoord, v3.yCoord, v3.zCoord); - glTexCoord2f(xMin, yMax); - glVertex3d(v4.xCoord, v4.yCoord, v4.zCoord); - - glEnd(); - } - - /** - * @param v1 Top Left Back - * @param v2 Top Right Back - * @param v3 Top Right Front - * @param v4 Top Left Front - * @param v5 Bottom Left Front - * @param v6 Bottom Right Front - * @param v7 Bottom Right Back - * @param v8 Bottom Left Back - */ - private static void drawCuboidRaw(Vec3 v1, Vec3 v2, Vec3 v3, Vec3 v4, Vec3 v5, Vec3 v6, Vec3 v7, Vec3 v8) - { - drawQuadRaw(v1, v2, v3, v4, ForgeDirection.UP); // top - drawQuadRaw(v7, v6, v3, v2, ForgeDirection.EAST); // right - drawQuadRaw(v5, v6, v7, v8, ForgeDirection.DOWN); // bottom - drawQuadRaw(v5, v8, v1, v4, ForgeDirection.WEST); // left - drawQuadRaw(v6, v5, v4, v3, ForgeDirection.NORTH); // front - drawQuadRaw(v8, v7, v2, v1, ForgeDirection.SOUTH); // back - } - - public static void drawCuboid(float xOffset, float yOffset, float zOffset, float xSize, float ySize, float zSize) - { - Vec3 v1, v2, v3, v4, v5, v6, v7, v8; - float x, y, z; - float x2, y2, z2; - x = xOffset; - y = yOffset; - z = zOffset; - x2 = x + xSize; - y2 = y + ySize; - z2 = z + zSize; - v1 = Vec3.createVectorHelper(x, y2, z2); - v2 = Vec3.createVectorHelper(x2, y2, z2); - v3 = Vec3.createVectorHelper(x2, y2, z); - v4 = Vec3.createVectorHelper(x, y2, z); - v5 = Vec3.createVectorHelper(x, y, z); - v6 = Vec3.createVectorHelper(x2, y, z); - v7 = Vec3.createVectorHelper(x2, y, z2); - v8 = Vec3.createVectorHelper(x, y, z2); - drawCuboidRaw(v1, v2, v3, v4, v5, v6, v7, v8); - } - - public static void setTextureOffset(int xOffset, int yOffset) - { - texOffsetX = xOffset; - texOffsetY = yOffset; - } - - public static void setGlobalTextureResolution(int width, int height) - { - gTexWidth = width; - gTexHeight = height; - } - - public static void setTextureSubResolution(int width, int height) - { - sTexWidth = width; - sTexHeight = height; - } - - /** - * Sets whether or not to clip the texture. - * - * @param clip If true, textures on blocks less than 1x1x1 will be clipped. If false, they will - * be scaled. - */ - public static void setTextureClip(boolean clip) - { - ModelHelper.clip = clip; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelLargePipe.java b/archive/java/resonantinduction/old/client/model/ModelLargePipe.java deleted file mode 100644 index 745f3dc3..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelLargePipe.java +++ /dev/null @@ -1,242 +0,0 @@ -// Date: 9/20/2012 12:00:21 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelLargePipe extends ModelBase -{ - // fields - ModelRenderer Mid; - ModelRenderer RightPipe; - ModelRenderer RightInter; - ModelRenderer RightConnect; - ModelRenderer LeftInter; - ModelRenderer LeftPipe; - ModelRenderer LeftConnect; - ModelRenderer TopInter; - ModelRenderer TopPipe; - ModelRenderer TopConnect; - ModelRenderer BottomPipe; - ModelRenderer BottomInter; - ModelRenderer BottomConnect; - ModelRenderer BackPipe; - ModelRenderer BackInter; - ModelRenderer BackConnect; - ModelRenderer FrontInter; - ModelRenderer FrontPipe; - ModelRenderer FrontConnect; - - public ModelLargePipe() - { - textureWidth = 128; - textureHeight = 32; - - Mid = new ModelRenderer(this, 50, 13); - Mid.addBox(-3F, -3F, -3F, 6, 6, 6); - Mid.setRotationPoint(0F, 16F, 0F); - Mid.setTextureSize(128, 32); - Mid.mirror = true; - setRotation(Mid, 0F, 0F, 0F); - RightPipe = new ModelRenderer(this, 25, 0); - RightPipe.addBox(0F, -3F, -3F, 4, 6, 6); - RightPipe.setRotationPoint(3F, 16F, 0F); - RightPipe.setTextureSize(128, 32); - RightPipe.mirror = true; - setRotation(RightPipe, 0F, 0F, 0F); - RightInter = new ModelRenderer(this, 98, 0); - RightInter.addBox(0F, -4F, -4F, 1, 8, 8); - RightInter.setRotationPoint(2F, 16F, 0F); - RightInter.setTextureSize(128, 32); - RightInter.mirror = true; - setRotation(RightInter, 0F, 0F, 0F); - RightConnect = new ModelRenderer(this, 98, 0); - RightConnect.addBox(0F, -4F, -4F, 1, 8, 8); - RightConnect.setRotationPoint(7F, 16F, 0F); - RightConnect.setTextureSize(128, 32); - RightConnect.mirror = true; - setRotation(RightConnect, 0F, 0F, 0F); - LeftInter = new ModelRenderer(this, 98, 0); - LeftInter.addBox(-1F, -4F, -4F, 1, 8, 8); - LeftInter.setRotationPoint(-2F, 16F, 0F); - LeftInter.setTextureSize(128, 32); - LeftInter.mirror = true; - setRotation(LeftInter, 0F, 0F, 0F); - LeftPipe = new ModelRenderer(this, 25, 0); - LeftPipe.addBox(-4F, -3F, -3F, 4, 6, 6); - LeftPipe.setRotationPoint(-3F, 16F, 0F); - LeftPipe.setTextureSize(128, 32); - LeftPipe.mirror = true; - setRotation(LeftPipe, 0F, 0F, 0F); - LeftConnect = new ModelRenderer(this, 98, 0); - LeftConnect.addBox(-1F, -4F, -4F, 1, 8, 8); - LeftConnect.setRotationPoint(-7F, 16F, 0F); - LeftConnect.setTextureSize(128, 32); - LeftConnect.mirror = true; - setRotation(LeftConnect, 0F, 0F, 0F); - TopInter = new ModelRenderer(this, 77, 17); - TopInter.addBox(-4F, -1F, -4F, 8, 1, 8); - TopInter.setRotationPoint(0F, 14F, 0F); - TopInter.setTextureSize(128, 32); - TopInter.mirror = true; - setRotation(TopInter, 0F, 0F, 0F); - TopPipe = new ModelRenderer(this, 50, 0); - TopPipe.addBox(-3F, -4F, -3F, 6, 4, 6); - TopPipe.setRotationPoint(0F, 13F, 0F); - TopPipe.setTextureSize(128, 32); - TopPipe.mirror = true; - setRotation(TopPipe, 0F, 0F, 0F); - TopConnect = new ModelRenderer(this, 77, 17); - TopConnect.addBox(-4F, -1F, -4F, 8, 1, 8); - TopConnect.setRotationPoint(0F, 9F, 0F); - TopConnect.setTextureSize(128, 32); - TopConnect.mirror = true; - setRotation(TopConnect, 0F, 0F, 0F); - BottomPipe = new ModelRenderer(this, 50, 0); - BottomPipe.addBox(-3F, 0F, -3F, 6, 4, 6); - BottomPipe.setRotationPoint(0F, 19F, 0F); - BottomPipe.setTextureSize(128, 32); - BottomPipe.mirror = true; - setRotation(BottomPipe, 0F, 0F, 0F); - BottomInter = new ModelRenderer(this, 77, 17); - BottomInter.addBox(-4F, 0F, -4F, 8, 1, 8); - BottomInter.setRotationPoint(0F, 18F, 0F); - BottomInter.setTextureSize(128, 32); - BottomInter.mirror = true; - setRotation(BottomInter, 0F, 0F, 0F); - BottomConnect = new ModelRenderer(this, 77, 17); - BottomConnect.addBox(-4F, 0F, -4F, 8, 1, 8); - BottomConnect.setRotationPoint(0F, 23F, 0F); - BottomConnect.setTextureSize(128, 32); - BottomConnect.mirror = true; - setRotation(BottomConnect, 0F, 0F, 0F); - BackPipe = new ModelRenderer(this, 0, 0); - BackPipe.addBox(-3F, -3F, 0F, 6, 6, 4); - BackPipe.setRotationPoint(0F, 16F, 3F); - BackPipe.setTextureSize(128, 32); - BackPipe.mirror = true; - setRotation(BackPipe, 0F, 0F, 0F); - BackInter = new ModelRenderer(this, 0, 23); - BackInter.addBox(-4F, -4F, 0F, 8, 8, 1); - BackInter.setRotationPoint(0F, 16F, 2F); - BackInter.setTextureSize(128, 32); - BackInter.mirror = true; - setRotation(BackInter, 0F, 0F, 0F); - BackConnect = new ModelRenderer(this, 0, 23); - BackConnect.addBox(-4F, -4F, 0F, 8, 8, 1); - BackConnect.setRotationPoint(0F, 16F, 7F); - BackConnect.setTextureSize(128, 32); - BackConnect.mirror = true; - setRotation(BackConnect, 0F, 0F, 0F); - FrontInter = new ModelRenderer(this, 0, 23); - FrontInter.addBox(-4F, -4F, -1F, 8, 8, 1); - FrontInter.setRotationPoint(0F, 16F, -2F); - FrontInter.setTextureSize(128, 32); - FrontInter.mirror = true; - setRotation(FrontInter, 0F, 0F, 0F); - FrontPipe = new ModelRenderer(this, 0, 0); - FrontPipe.addBox(-3F, -3F, -4F, 6, 6, 4); - FrontPipe.setRotationPoint(0F, 16F, -3F); - FrontPipe.setTextureSize(128, 32); - FrontPipe.mirror = true; - setRotation(FrontPipe, 0F, 0F, 0F); - FrontConnect = new ModelRenderer(this, 0, 23); - FrontConnect.addBox(-4F, -4F, -1F, 8, 8, 1); - FrontConnect.setRotationPoint(0F, 16F, -7F); - FrontConnect.setTextureSize(128, 32); - FrontConnect.mirror = true; - setRotation(FrontConnect, 0F, 0F, 0F); - } - - public void render(boolean[] side) - { - if (side[0]) - { - renderBottom(); - } - if (side[1]) - { - renderTop(); - } - if (side[3]) - { - renderFront(); - } - if (side[2]) - { - renderBack(); - } - if (side[5]) - { - renderRight(); - } - if (side[4]) - { - renderLeft(); - } - renderMiddle(); - } - - public void renderMiddle() - { - Mid.render(0.0625F); - } - - public void renderBottom() - { - BottomPipe.render(0.0625F); - BottomConnect.render(0.0625F); - BottomInter.render(0.0625F); - } - - public void renderTop() - { - TopPipe.render(0.0625F); - TopConnect.render(0.0625F); - TopInter.render(0.0625F); - } - - public void renderLeft() - { - LeftPipe.render(0.0625F); - LeftConnect.render(0.0625F); - LeftInter.render(0.0625F); - } - - public void renderRight() - { - RightPipe.render(0.0625F); - RightConnect.render(0.0625F); - RightInter.render(0.0625F); - } - - public void renderBack() - { - BackPipe.render(0.0625F); - BackConnect.render(0.0625F); - BackInter.render(0.0625F); - } - - public void renderFront() - { - FrontPipe.render(0.0625F); - FrontConnect.render(0.0625F); - FrontInter.render(0.0625F); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelLaserTile.java b/archive/java/resonantinduction/old/client/model/ModelLaserTile.java deleted file mode 100644 index 70c5313b..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelLaserTile.java +++ /dev/null @@ -1,119 +0,0 @@ -// Date: 11/12/2013 5:27:39 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelLaserTile extends ModelBase -{ - // fields - ModelRenderer base; - ModelRenderer base2; - ModelRenderer rod; - ModelRenderer body; - ModelRenderer body2; - ModelRenderer body3; - ModelRenderer body4; - ModelRenderer body5; - ModelRenderer body6; - ModelRenderer body7; - - public ModelLaserTile() - { - textureWidth = 128; - textureHeight = 128; - - base = new ModelRenderer(this, 0, 76); - base.addBox(-5F, 0F, -5F, 10, 1, 10); - base.setRotationPoint(0F, 23F, 0F); - base.setTextureSize(128, 128); - base.mirror = true; - setRotation(base, 0F, 0F, 0F); - base2 = new ModelRenderer(this, 0, 66); - base2.addBox(-4F, 0F, -4F, 8, 1, 8); - base2.setRotationPoint(0F, 22F, 0F); - base2.setTextureSize(128, 128); - base2.mirror = true; - setRotation(base2, 0F, 0F, 0F); - rod = new ModelRenderer(this, 0, 53); - rod.addBox(-1.5F, -1F, -1.5F, 3, 8, 3); - rod.setRotationPoint(0F, 15F, 0F); - rod.setTextureSize(128, 128); - rod.mirror = true; - setRotation(rod, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 35); - body.addBox(-3.5F, -1F, -2.5F, 9, 3, 5); - body.setRotationPoint(0F, 10F, 0F); - body.setTextureSize(128, 128); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 44); - body2.addBox(-3.5F, -1F, -2F, 7, 2, 4); - body2.setRotationPoint(0F, 13F, 0F); - body2.setTextureSize(128, 128); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body3 = new ModelRenderer(this, 30, 37); - body3.addBox(-3.5F, -1F, -2F, 3, 4, 4); - body3.setRotationPoint(-3F, 10.3F, 0F); - body3.setTextureSize(128, 128); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body4 = new ModelRenderer(this, 57, 34); - body4.addBox(-3.5F, -1.5F, -1F, 3, 1, 2); - body4.setRotationPoint(-6F, 11F, 0F); - body4.setTextureSize(128, 128); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - body5 = new ModelRenderer(this, 57, 47); - body5.addBox(-3.5F, -1.5F, -1F, 3, 1, 2); - body5.setRotationPoint(-6F, 13F, 0F); - body5.setTextureSize(128, 128); - body5.mirror = true; - setRotation(body5, 0F, 0F, 0F); - body6 = new ModelRenderer(this, 66, 42); - body6.addBox(-3.5F, -1.5F, -1.5F, 3, 1, 1); - body6.setRotationPoint(-6F, 12F, 0F); - body6.setTextureSize(128, 128); - body6.mirror = true; - setRotation(body6, 0F, 0F, 0F); - body7 = new ModelRenderer(this, 51, 41); - body7.addBox(-3.5F, -1.5F, 0.5F, 3, 1, 1); - body7.setRotationPoint(-6F, 12F, 0F); - body7.setTextureSize(128, 128); - body7.mirror = true; - setRotation(body7, 0F, 0F, 0F); - } - - public void render(float f5) - { - base.render(f5); - base2.render(f5); - rod.render(f5); - body.render(f5); - body2.render(f5); - body3.render(f5); - body4.render(f5); - body5.render(f5); - body6.render(f5); - body7.render(f5); - } - - public void renderAll() - { - this.render(0.0625F); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelLiquidTankCorner.java b/archive/java/resonantinduction/old/client/model/ModelLiquidTankCorner.java deleted file mode 100644 index caa15ddd..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelLiquidTankCorner.java +++ /dev/null @@ -1,135 +0,0 @@ -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelLiquidTankCorner extends ModelBase -{ - // fields - ModelRenderer sOne; - ModelRenderer sTwo; - ModelRenderer d7; - ModelRenderer d5; - ModelRenderer d3; - ModelRenderer d4; - ModelRenderer d1; - ModelRenderer d6; - ModelRenderer d2; - ModelRenderer d8; - ModelRenderer d9; - ModelRenderer d10; - ModelRenderer face; - - public ModelLiquidTankCorner() - { - textureWidth = 128; - textureHeight = 128; - - sOne = new ModelRenderer(this, 0, 30); - sOne.addBox(-1F, 0F, -1F, 2, 16, 2); - sOne.setRotationPoint(-7F, 8F, 7F); - sOne.setTextureSize(128, 128); - sOne.mirror = true; - setRotation(sOne, 0F, 0F, 0F); - sTwo = new ModelRenderer(this, 0, 30); - sTwo.addBox(-1F, 0F, -1F, 2, 16, 2); - sTwo.setRotationPoint(-7F, 8F, -7F); - sTwo.setTextureSize(128, 128); - sTwo.mirror = true; - setRotation(sTwo, 0F, 0F, 0F); - d7 = new ModelRenderer(this, 43, 2); - d7.addBox(-1F, 0F, -1F, 2, 16, 12); - d7.setRotationPoint(-7F, 8F, -5F); - d7.setTextureSize(128, 128); - d7.mirror = true; - setRotation(d7, 0F, 0F, 0F); - d5 = new ModelRenderer(this, 9, 12); - d5.addBox(-1F, 0F, -1F, 14, 16, 2); - d5.setRotationPoint(-5F, 8F, 7F); - d5.setTextureSize(128, 128); - d5.mirror = true; - setRotation(d5, 0F, 0F, 0F); - d3 = new ModelRenderer(this, 9, 67); - d3.addBox(-1.5F, 0F, -1.3F, 20, 2, 2); - d3.setRotationPoint(-6F, 22F, -6F); - d3.setTextureSize(128, 128); - d3.mirror = true; - setRotation(d3, 0F, -0.7853982F, 0F); - d4 = new ModelRenderer(this, 9, 88); - d4.addBox(0F, 0F, -9F, 5, 2, 4); - d4.setRotationPoint(-6F, 22F, 6F); - d4.setTextureSize(128, 128); - d4.mirror = true; - setRotation(d4, 0F, 0F, 0F); - d1 = new ModelRenderer(this, 9, 67); - d1.addBox(-1.5F, 0F, -1.3F, 20, 2, 2); - d1.setRotationPoint(-6F, 8F, -6F); - d1.setTextureSize(128, 128); - d1.mirror = true; - setRotation(d1, 0F, -0.7853982F, 0F); - d6 = new ModelRenderer(this, 9, 75); - d6.addBox(-1.5F, 0F, -1.3F, 17, 2, 2); - d6.setRotationPoint(-6F, 22F, -4F); - d6.setTextureSize(128, 128); - d6.mirror = true; - setRotation(d6, 0F, -0.7853982F, 0F); - d2 = new ModelRenderer(this, 9, 80); - d2.addBox(0F, 0F, -5F, 9, 2, 5); - d2.setRotationPoint(-6F, 22F, 6F); - d2.setTextureSize(128, 128); - d2.mirror = true; - setRotation(d2, 0F, 0F, 0F); - d8 = new ModelRenderer(this, 9, 75); - d8.addBox(-1.5F, 0F, -1.3F, 17, 2, 2); - d8.setRotationPoint(-6F, 8F, -4F); - d8.setTextureSize(128, 128); - d8.mirror = true; - setRotation(d8, 0F, -0.7853982F, 0F); - d9 = new ModelRenderer(this, 9, 88); - d9.addBox(0F, 0F, -9F, 5, 2, 4); - d9.setRotationPoint(-6F, 8F, 6F); - d9.setTextureSize(128, 128); - d9.mirror = true; - setRotation(d9, 0F, 0F, 0F); - d10 = new ModelRenderer(this, 9, 80); - d10.addBox(0F, 0F, -5F, 9, 2, 5); - d10.setRotationPoint(-6F, 8F, 6F); - d10.setTextureSize(128, 128); - d10.mirror = true; - setRotation(d10, 0F, 0F, 0F); - face = new ModelRenderer(this, 0, 50); - face.addBox(-8.5F, 0F, 0F, 17, 14, 2); - face.setRotationPoint(0F, 9F, 0F); - face.setTextureSize(128, 128); - face.mirror = true; - setRotation(face, 0F, -0.7853982F, 0F); - } - - public void render(float f5) - { - sOne.render(f5); - sTwo.render(f5); - d7.render(f5); - d5.render(f5); - d3.render(f5); - d4.render(f5); - d1.render(f5); - d6.render(f5); - d2.render(f5); - d8.render(f5); - d9.render(f5); - d10.render(f5); - face.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelMachine.java b/archive/java/resonantinduction/old/client/model/ModelMachine.java deleted file mode 100644 index 2eac8502..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelMachine.java +++ /dev/null @@ -1,8 +0,0 @@ -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; - -public abstract class ModelMachine extends ModelBase -{ - public abstract void render(float f5); -} diff --git a/archive/java/resonantinduction/old/client/model/ModelManipulator.java b/archive/java/resonantinduction/old/client/model/ModelManipulator.java deleted file mode 100644 index 8d2b40b6..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelManipulator.java +++ /dev/null @@ -1,203 +0,0 @@ -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelManipulator extends ModelBase -{ - // fields - ModelRenderer bBELTLong; - ModelRenderer FBELT; - ModelRenderer BacPanel; - ModelRenderer BBelt; - ModelRenderer FRL; - ModelRenderer MRL; - ModelRenderer FLL; - ModelRenderer BLL; - ModelRenderer MRoller; - ModelRenderer BRoller; - ModelRenderer tBELT; - ModelRenderer FRoller; - ModelRenderer BRL; - ModelRenderer BML; - ModelRenderer tBELTLong; - ModelRenderer RPanel; - ModelRenderer LPanel; - ModelRenderer TopPanel; - ModelRenderer RCPanel; - ModelRenderer LCPanel; - - public ModelManipulator() - { - textureWidth = 128; - textureHeight = 128; - - bBELTLong = new ModelRenderer(this, 0, 66); - bBELTLong.addBox(0F, 0F, 0F, 14, 1, 16); - bBELTLong.setRotationPoint(-7F, 22F, -8F); - bBELTLong.setTextureSize(128, 128); - bBELTLong.mirror = true; - setRotation(bBELTLong, 0F, 0F, 0F); - FBELT = new ModelRenderer(this, 0, 16); - FBELT.addBox(0F, 0F, 0F, 14, 2, 1); - FBELT.setRotationPoint(-7F, 20F, -8F); - FBELT.setTextureSize(128, 128); - FBELT.mirror = true; - setRotation(FBELT, 0F, 0F, 0F); - BacPanel = new ModelRenderer(this, 0, 86); - BacPanel.addBox(0F, -12F, 0F, 14, 12, 1); - BacPanel.setRotationPoint(-7F, 24F, 7F); - BacPanel.setTextureSize(128, 128); - BacPanel.mirror = true; - setRotation(BacPanel, 0F, 0F, 0F); - BBelt = new ModelRenderer(this, 0, 31); - BBelt.addBox(0F, 0F, 0F, 14, 1, 14); - BBelt.setRotationPoint(-7F, 22F, -7F); - BBelt.setTextureSize(128, 128); - BBelt.mirror = true; - setRotation(BBelt, 0F, 0F, 0F); - FRL = new ModelRenderer(this, 0, 20); - FRL.addBox(0F, 0F, 0F, 1, 3, 2); - FRL.setRotationPoint(-8F, 21F, -6F); - FRL.setTextureSize(128, 128); - FRL.mirror = true; - setRotation(FRL, 0F, 0F, 0F); - MRL = new ModelRenderer(this, 0, 20); - MRL.addBox(0F, 0F, 0F, 1, 3, 2); - MRL.setRotationPoint(-8F, 21F, -1F); - MRL.setTextureSize(128, 128); - MRL.mirror = true; - setRotation(MRL, 0F, 0F, 0F); - FLL = new ModelRenderer(this, 0, 20); - FLL.addBox(0F, 0F, 0F, 1, 3, 2); - FLL.setRotationPoint(7F, 21F, -6F); - FLL.setTextureSize(128, 128); - FLL.mirror = true; - setRotation(FLL, 0F, 0F, 0F); - BLL = new ModelRenderer(this, 0, 20); - BLL.addBox(0F, 0F, 0F, 1, 3, 2); - BLL.setRotationPoint(7F, 21F, 4F); - BLL.setTextureSize(128, 128); - BLL.mirror = true; - setRotation(BLL, 0F, 0F, 0F); - MRoller = new ModelRenderer(this, 0, 26); - MRoller.addBox(-7F, -1F, -1F, 14, 2, 2); - MRoller.setRotationPoint(0F, 21F, 0F); - MRoller.setTextureSize(128, 128); - MRoller.mirror = true; - setRotation(MRoller, 0F, 0F, 0F); - BRoller = new ModelRenderer(this, 0, 26); - BRoller.addBox(-7F, -1F, -1F, 14, 2, 2); - BRoller.setRotationPoint(0F, 21F, 5F); - BRoller.setTextureSize(128, 128); - BRoller.mirror = true; - setRotation(BRoller, 0F, 0F, 0F); - tBELT = new ModelRenderer(this, 0, 0); - tBELT.addBox(0F, 0F, 0F, 14, 1, 14); - tBELT.setRotationPoint(-7F, 19F, -7F); - tBELT.setTextureSize(128, 128); - tBELT.mirror = true; - setRotation(tBELT, 0F, 0F, 0F); - FRoller = new ModelRenderer(this, 0, 26); - FRoller.addBox(-7F, -1F, -1F, 14, 2, 2); - FRoller.setRotationPoint(0F, 21F, -5F); - FRoller.setTextureSize(128, 128); - FRoller.mirror = true; - setRotation(FRoller, 0F, 0F, 0F); - BRL = new ModelRenderer(this, 0, 20); - BRL.addBox(0F, 0F, 0F, 1, 3, 2); - BRL.setRotationPoint(-8F, 21F, 4F); - BRL.setTextureSize(128, 128); - BRL.mirror = true; - setRotation(BRL, 0F, 0F, 0F); - BML = new ModelRenderer(this, 0, 20); - BML.addBox(0F, 0F, 0F, 1, 3, 2); - BML.setRotationPoint(7F, 21F, -1F); - BML.setTextureSize(128, 128); - BML.mirror = true; - setRotation(BML, 0F, 0F, 0F); - tBELTLong = new ModelRenderer(this, 0, 48); - tBELTLong.addBox(0F, 0F, 0F, 14, 1, 16); - tBELTLong.setRotationPoint(-7F, 19F, -8F); - tBELTLong.setTextureSize(128, 128); - tBELTLong.mirror = true; - setRotation(tBELTLong, 0F, 0F, 0F); - RPanel = new ModelRenderer(this, 65, 41); - RPanel.addBox(0F, -2F, -8F, 1, 4, 16); - RPanel.setRotationPoint(-8F, 19F, 0F); - RPanel.setTextureSize(128, 128); - RPanel.mirror = true; - setRotation(RPanel, 0F, 0F, 0F); - LPanel = new ModelRenderer(this, 65, 20); - LPanel.addBox(0F, -2F, -8F, 1, 4, 16); - LPanel.setRotationPoint(7F, 19F, 0F); - LPanel.setTextureSize(128, 128); - LPanel.mirror = true; - setRotation(LPanel, 0F, 0F, 0F); - TopPanel = new ModelRenderer(this, 0, 105); - TopPanel.addBox(0F, 0F, 0F, 14, 2, 10); - TopPanel.setRotationPoint(-7F, 12F, -3F); - TopPanel.setTextureSize(128, 128); - TopPanel.mirror = true; - setRotation(TopPanel, 0F, 0F, 0F); - RCPanel = new ModelRenderer(this, 50, 105); - RCPanel.addBox(-1F, 0F, 0F, 2, 5, 10); - RCPanel.setRotationPoint(-7F, 14F, -3F); - RCPanel.setTextureSize(128, 128); - RCPanel.mirror = true; - setRotation(RCPanel, 0F, 0F, 0F); - LCPanel = new ModelRenderer(this, 76, 105); - LCPanel.addBox(0F, 0F, 0F, 2, 5, 10); - LCPanel.setRotationPoint(6F, 14F, -3F); - LCPanel.setTextureSize(128, 128); - LCPanel.mirror = true; - setRotation(LCPanel, 0F, 0F, 0F); - } - - public void render(float f5, boolean isLongBelt, int radians) - { - // body panels - BacPanel.render(f5); - RPanel.render(f5); - LPanel.render(f5); - TopPanel.render(f5); - RCPanel.render(f5); - LCPanel.render(f5); - // legs - FRL.render(f5); - MRL.render(f5); - FLL.render(f5); - BLL.render(f5); - BRL.render(f5); - BML.render(f5); - // rollers - MRoller.rotateAngleX = radians; - BRoller.rotateAngleX = radians; - FRoller.rotateAngleX = radians; - MRoller.render(f5); - BRoller.render(f5); - FRoller.render(f5); - - if (isLongBelt) - { - tBELTLong.render(f5); - bBELTLong.render(f5); - } - else - { - FBELT.render(f5); - tBELT.render(f5); - BBelt.render(f5); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelMiningLaserGun.java b/archive/java/resonantinduction/old/client/model/ModelMiningLaserGun.java deleted file mode 100644 index 6e212703..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelMiningLaserGun.java +++ /dev/null @@ -1,146 +0,0 @@ -// Date: 11/12/2013 5:48:04 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelMiningLaserGun extends ModelBase -{ - // fields - ModelRenderer grip; - ModelRenderer grip2; - ModelRenderer body; - ModelRenderer body2; - ModelRenderer body3; - ModelRenderer body4; - ModelRenderer body5; - ModelRenderer body6; - ModelRenderer barrel; - ModelRenderer barrel2; - ModelRenderer screen; - ModelRenderer battery; - ModelRenderer batteryClip; - ModelRenderer batteryClip2; - - public ModelMiningLaserGun() - { - textureWidth = 128; - textureHeight = 64; - - grip = new ModelRenderer(this, 1, 26); - grip.addBox(0F, 0F, 0F, 1, 2, 1); - grip.setRotationPoint(0.5F, 19F, -2F); - grip.setTextureSize(128, 64); - grip.mirror = true; - setRotation(grip, 0.4014257F, 0F, 0F); - grip2 = new ModelRenderer(this, 32, 2); - grip2.addBox(-1.5F, 0F, 0F, 3, 1, 1); - grip2.setRotationPoint(4.5F, 17.58F, -12.01F); - grip2.setTextureSize(128, 64); - grip2.mirror = true; - setRotation(grip2, 0F, 0F, 0F); - body = new ModelRenderer(this, 16, 39); - body.addBox(-1.5F, 0F, 0F, 3, 3, 13); - body.setRotationPoint(1F, 15.8F, -11.01F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 49, 41); - body2.addBox(0F, 0F, 0F, 2, 1, 13); - body2.setRotationPoint(0F, 15.6F, -11.01F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body3 = new ModelRenderer(this, 55, 7); - body3.addBox(-1.5F, 0F, 0F, 2, 1, 8); - body3.setRotationPoint(1.5F, 18.8F, -15.01F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body4 = new ModelRenderer(this, 0, 0); - body4.addBox(0F, 0F, 0F, 2, 1, 5); - body4.setRotationPoint(0F, 18F, -3F); - body4.setTextureSize(128, 64); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - body5 = new ModelRenderer(this, 17, 7); - body5.addBox(-1.5F, 0F, 0F, 1, 2, 8); - body5.setRotationPoint(0.5F, 17F, -15.01F); - body5.setTextureSize(128, 64); - body5.mirror = true; - setRotation(body5, 0F, 0F, 0F); - body6 = new ModelRenderer(this, 36, 7); - body6.addBox(-1.5F, 0F, 0F, 1, 2, 8); - body6.setRotationPoint(3.5F, 17F, -15.01F); - body6.setTextureSize(128, 64); - body6.mirror = true; - setRotation(body6, 0F, 0F, 0F); - barrel = new ModelRenderer(this, 34, 21); - barrel.addBox(0F, 0F, 0F, 1, 3, 8); - barrel.setRotationPoint(0.5F, 16F, -19.01F); - barrel.setTextureSize(128, 64); - barrel.mirror = true; - setRotation(barrel, 0F, 0F, 0F); - barrel2 = new ModelRenderer(this, 55, 23); - barrel2.addBox(0F, 0F, 0F, 2, 2, 6); - barrel2.setRotationPoint(0F, 16.8F, -17.01F); - barrel2.setTextureSize(128, 64); - barrel2.mirror = true; - setRotation(barrel2, 0F, 0F, 0F); - screen = new ModelRenderer(this, 7, 10); - screen.addBox(0F, 0F, 0F, 3, 3, 1); - screen.setRotationPoint(2.5F, 16F, -8.01F); - screen.setTextureSize(128, 64); - screen.mirror = true; - setRotation(screen, 0.5410521F, 0F, 0F); - battery = new ModelRenderer(this, 17, 22); - battery.addBox(-1.5F, 0F, 0F, 2, 4, 5); - battery.setRotationPoint(-1F, 16F, -6.5F); - battery.setTextureSize(128, 64); - battery.mirror = true; - setRotation(battery, 0F, 0F, 0F); - batteryClip = new ModelRenderer(this, 17, 0); - batteryClip.addBox(-1.5F, 0F, 0F, 2, 1, 1); - batteryClip.setRotationPoint(-0.4F, 16.5F, -2F); - batteryClip.setTextureSize(128, 64); - batteryClip.mirror = true; - setRotation(batteryClip, 0F, 0F, 0F); - batteryClip2 = new ModelRenderer(this, 17, 0); - batteryClip2.addBox(-1.5F, 0F, 0F, 2, 1, 1); - batteryClip2.setRotationPoint(-0.4F, 16.5F, -7F); - batteryClip2.setTextureSize(128, 64); - batteryClip2.mirror = true; - setRotation(batteryClip2, 0F, 0F, 0F); - } - - public void render(float f5) - { - grip.render(f5); - grip2.render(f5); - body.render(f5); - body2.render(f5); - body3.render(f5); - body4.render(f5); - body5.render(f5); - body6.render(f5); - barrel.render(f5); - barrel2.render(f5); - screen.render(f5); - battery.render(f5); - batteryClip.render(f5); - batteryClip2.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelOpenTrough.java b/archive/java/resonantinduction/old/client/model/ModelOpenTrough.java deleted file mode 100644 index bc74969e..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelOpenTrough.java +++ /dev/null @@ -1,425 +0,0 @@ -// Date: 12/30/2013 5:50:34 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelOpenTrough extends ModelBase -{ - // fields - ModelRenderer base; - ModelRenderer leftBase; - ModelRenderer leftBaseB; - ModelRenderer rightBaseB; - ModelRenderer rightBase; - ModelRenderer frontBase; - ModelRenderer frontBaseB; - ModelRenderer backBase; - ModelRenderer backBaseB; - ModelRenderer frontA; - ModelRenderer frontB; - ModelRenderer backA; - ModelRenderer backB; - ModelRenderer rightA; - ModelRenderer rightB; - ModelRenderer leftB; - ModelRenderer leftA; - ModelRenderer centerA; - ModelRenderer centerB; - ModelRenderer centerC; - ModelRenderer centerD; - ModelRenderer frontDoorA; - ModelRenderer frontDoorB; - ModelRenderer frontDoorC; - ModelRenderer backDoorA; - ModelRenderer backDoorB; - ModelRenderer backDoorC; - ModelRenderer leftDoorA; - ModelRenderer leftDoorB; - ModelRenderer leftDoorC; - ModelRenderer rightDoorA; - ModelRenderer rightDoorB; - ModelRenderer rightDoorC; - ModelRenderer cornerBackLeft; - ModelRenderer cornerBackRight; - ModelRenderer cornerFrontLeft; - ModelRenderer cornerFrontRight; - - public ModelOpenTrough() - { - textureWidth = 128; - textureHeight = 128; - - base = new ModelRenderer(this, 0, 0); - base.addBox(-4F, 0F, -4F, 8, 2, 8); - base.setRotationPoint(0F, 22F, 0F); - base.setTextureSize(64, 32); - base.mirror = true; - setRotation(base, 0F, 0F, 0F); - leftBase = new ModelRenderer(this, 32, 0); - leftBase.addBox(-4F, 0F, -4F, 4, 1, 8); - leftBase.setRotationPoint(8F, 22F, 0F); - leftBase.setTextureSize(64, 32); - leftBase.mirror = true; - setRotation(leftBase, 0F, 0F, 0F); - leftBaseB = new ModelRenderer(this, 36, 10); - leftBaseB.addBox(-4F, 0F, -3F, 4, 1, 6); - leftBaseB.setRotationPoint(8F, 23F, 0F); - leftBaseB.setTextureSize(64, 32); - leftBaseB.mirror = true; - setRotation(leftBaseB, 0F, 0F, 0F); - rightBaseB = new ModelRenderer(this, 36, 10); - rightBaseB.addBox(-4F, 0F, -3F, 4, 1, 6); - rightBaseB.setRotationPoint(-4F, 23F, 0F); - rightBaseB.setTextureSize(64, 32); - rightBaseB.mirror = true; - setRotation(rightBaseB, 0F, 0F, 0F); - rightBase = new ModelRenderer(this, 32, 0); - rightBase.addBox(-4F, 0F, -4F, 4, 1, 8); - rightBase.setRotationPoint(-4F, 22F, 0F); - rightBase.setTextureSize(64, 32); - rightBase.mirror = true; - setRotation(rightBase, 0F, 0F, 0F); - frontBase = new ModelRenderer(this, 60, 6); - frontBase.addBox(-3F, 0F, -4F, 6, 1, 4); - frontBase.setRotationPoint(0F, 23F, -4F); - frontBase.setTextureSize(64, 32); - frontBase.mirror = true; - setRotation(frontBase, 0F, 0F, 0F); - frontBaseB = new ModelRenderer(this, 58, 0); - frontBaseB.addBox(-4F, 0F, -4F, 8, 1, 4); - frontBaseB.setRotationPoint(0F, 22F, -4F); - frontBaseB.setTextureSize(64, 32); - frontBaseB.mirror = true; - setRotation(frontBaseB, 0F, 0F, 0F); - backBase = new ModelRenderer(this, 58, 0); - backBase.addBox(-4F, 0F, -4F, 8, 1, 4); - backBase.setRotationPoint(0F, 22F, 8F); - backBase.setTextureSize(64, 32); - backBase.mirror = true; - setRotation(backBase, 0F, 0F, 0F); - backBaseB = new ModelRenderer(this, 60, 6); - backBaseB.addBox(-3F, 0F, -4F, 6, 1, 4); - backBaseB.setRotationPoint(0F, 23F, 8F); - backBaseB.setTextureSize(64, 32); - backBaseB.mirror = true; - setRotation(backBaseB, 0F, 0F, 0F); - frontA = new ModelRenderer(this, 0, 12); - frontA.addBox(-4F, 0F, -4F, 2, 7, 4); - frontA.setRotationPoint(0F, 15F, -4F); - frontA.setTextureSize(64, 32); - frontA.mirror = true; - setRotation(frontA, 0F, 0F, 0F); - frontB = new ModelRenderer(this, 0, 12); - frontB.addBox(-4F, 0F, -4F, 2, 7, 4); - frontB.setRotationPoint(6F, 15F, -4F); - frontB.setTextureSize(64, 32); - frontB.mirror = true; - setRotation(frontB, 0F, 0F, 0F); - backA = new ModelRenderer(this, 0, 12); - backA.addBox(-4F, 0F, -4F, 2, 7, 4); - backA.setRotationPoint(0F, 15F, 8F); - backA.setTextureSize(64, 32); - backA.mirror = true; - setRotation(backA, 0F, 0F, 0F); - backB = new ModelRenderer(this, 0, 12); - backB.addBox(-4F, 0F, -4F, 2, 7, 4); - backB.setRotationPoint(6F, 15F, 8F); - backB.setTextureSize(64, 32); - backB.mirror = true; - setRotation(backB, 0F, 0F, 0F); - rightA = new ModelRenderer(this, 13, 12); - rightA.addBox(-8F, 0F, 0F, 4, 7, 2); - rightA.setRotationPoint(0F, 15F, -4F); - rightA.setTextureSize(64, 32); - rightA.mirror = true; - setRotation(rightA, 0F, 0F, 0F); - rightB = new ModelRenderer(this, 13, 12); - rightB.addBox(-8F, 0F, 6F, 4, 7, 2); - rightB.setRotationPoint(0F, 15F, -4F); - rightB.setTextureSize(64, 32); - rightB.mirror = true; - setRotation(rightB, 0F, 0F, 0F); - leftB = new ModelRenderer(this, 13, 12); - leftB.addBox(4F, 0F, 6F, 4, 7, 2); - leftB.setRotationPoint(0F, 15F, -4F); - leftB.setTextureSize(64, 32); - leftB.mirror = true; - setRotation(leftB, 0F, 0F, 0F); - leftA = new ModelRenderer(this, 13, 12); - leftA.addBox(4F, 0F, 0F, 4, 7, 2); - leftA.setRotationPoint(0F, 15F, -4F); - leftA.setTextureSize(64, 32); - leftA.mirror = true; - setRotation(leftA, 0F, 0F, 0F); - centerA = new ModelRenderer(this, 27, 12); - centerA.addBox(-4F, 0F, -4F, 2, 7, 2); - centerA.setRotationPoint(6F, 15F, 6F); - centerA.setTextureSize(64, 32); - centerA.mirror = true; - setRotation(centerA, 0F, 0F, 0F); - centerB = new ModelRenderer(this, 27, 12); - centerB.addBox(-4F, 0F, -4F, 2, 7, 2); - centerB.setRotationPoint(6F, 15F, 0F); - centerB.setTextureSize(64, 32); - centerB.mirror = true; - setRotation(centerB, 0F, 0F, 0F); - centerC = new ModelRenderer(this, 27, 12); - centerC.addBox(-4F, 0F, -4F, 2, 7, 2); - centerC.setRotationPoint(0F, 15F, 0F); - centerC.setTextureSize(64, 32); - centerC.mirror = true; - setRotation(centerC, 0F, 0F, 0F); - centerD = new ModelRenderer(this, 27, 12); - centerD.addBox(-4F, 0F, -4F, 2, 7, 2); - centerD.setRotationPoint(0F, 15F, 6F); - centerD.setTextureSize(64, 32); - centerD.mirror = true; - setRotation(centerD, 0F, 0F, 0F); - frontDoorA = new ModelRenderer(this, 0, 25); - frontDoorA.addBox(-4F, 0F, -4F, 4, 7, 2); - frontDoorA.setRotationPoint(2F, 15F, -4F); - frontDoorA.setTextureSize(64, 32); - frontDoorA.mirror = true; - setRotation(frontDoorA, 0F, 0F, 0F); - frontDoorB = new ModelRenderer(this, 0, 25); - frontDoorB.addBox(-4F, 0F, -4F, 4, 7, 2); - frontDoorB.setRotationPoint(2F, 15F, -2F); - frontDoorB.setTextureSize(64, 32); - frontDoorB.mirror = true; - setRotation(frontDoorB, 0F, 0F, 0F); - frontDoorC = new ModelRenderer(this, 0, 25); - frontDoorC.addBox(-4F, 0F, -4F, 4, 7, 2); - frontDoorC.setRotationPoint(2F, 15F, 0F); - frontDoorC.setTextureSize(64, 32); - frontDoorC.mirror = true; - setRotation(frontDoorC, 0F, 0F, 0F); - backDoorA = new ModelRenderer(this, 0, 25); - backDoorA.addBox(-4F, 0F, -4F, 4, 7, 2); - backDoorA.setRotationPoint(2F, 15F, 10F); - backDoorA.setTextureSize(64, 32); - backDoorA.mirror = true; - setRotation(backDoorA, 0F, 0F, 0F); - backDoorB = new ModelRenderer(this, 0, 25); - backDoorB.addBox(-4F, 0F, -4F, 4, 7, 2); - backDoorB.setRotationPoint(2F, 15F, 8F); - backDoorB.setTextureSize(64, 32); - backDoorB.mirror = true; - setRotation(backDoorB, 0F, 0F, 0F); - backDoorC = new ModelRenderer(this, 0, 25); - backDoorC.addBox(-4F, 0F, -4F, 4, 7, 2); - backDoorC.setRotationPoint(2F, 15F, 6F); - backDoorC.setTextureSize(64, 32); - backDoorC.mirror = true; - setRotation(backDoorC, 0F, 0F, 0F); - leftDoorA = new ModelRenderer(this, 16, 24); - leftDoorA.addBox(4F, 0F, 6F, 2, 7, 4); - leftDoorA.setRotationPoint(2F, 15F, -8F); - leftDoorA.setTextureSize(64, 32); - leftDoorA.mirror = true; - setRotation(leftDoorA, 0F, 0F, 0F); - leftDoorB = new ModelRenderer(this, 16, 24); - leftDoorB.addBox(4F, 0F, 6F, 2, 7, 4); - leftDoorB.setRotationPoint(0F, 15F, -8F); - leftDoorB.setTextureSize(64, 32); - leftDoorB.mirror = true; - setRotation(leftDoorB, 0F, 0F, 0F); - leftDoorC = new ModelRenderer(this, 16, 24); - leftDoorC.addBox(4F, 0F, 6F, 2, 7, 4); - leftDoorC.setRotationPoint(-2F, 15F, -8F); - leftDoorC.setTextureSize(64, 32); - leftDoorC.mirror = true; - setRotation(leftDoorC, 0F, 0F, 0F); - rightDoorA = new ModelRenderer(this, 16, 24); - rightDoorA.addBox(4F, 0F, 6F, 2, 7, 4); - rightDoorA.setRotationPoint(-12F, 15F, -8F); - rightDoorA.setTextureSize(64, 32); - rightDoorA.mirror = true; - setRotation(rightDoorA, 0F, 0F, 0F); - rightDoorB = new ModelRenderer(this, 16, 24); - rightDoorB.addBox(4F, 0F, 6F, 2, 7, 4); - rightDoorB.setRotationPoint(-10F, 15F, -8F); - rightDoorB.setTextureSize(64, 32); - rightDoorB.mirror = true; - setRotation(rightDoorB, 0F, 0F, 0F); - rightDoorC = new ModelRenderer(this, 16, 24); - rightDoorC.addBox(4F, 0F, 6F, 2, 7, 4); - rightDoorC.setRotationPoint(-8F, 15F, -8F); - rightDoorC.setTextureSize(64, 32); - rightDoorC.mirror = true; - setRotation(rightDoorC, 0F, 0F, 0F); - cornerBackLeft = new ModelRenderer(this, 0, 37); - cornerBackLeft.addBox(-4F, 0F, -4F, 4, 10, 4); - cornerBackLeft.setRotationPoint(8F, 14F, 8F); - cornerBackLeft.setTextureSize(64, 32); - cornerBackLeft.mirror = true; - setRotation(cornerBackLeft, 0F, 0F, 0F); - cornerBackRight = new ModelRenderer(this, 0, 37); - cornerBackRight.addBox(-4F, 0F, -4F, 4, 10, 4); - cornerBackRight.setRotationPoint(-4F, 14F, 8F); - cornerBackRight.setTextureSize(64, 32); - cornerBackRight.mirror = true; - setRotation(cornerBackRight, 0F, 0F, 0F); - cornerFrontLeft = new ModelRenderer(this, 0, 37); - cornerFrontLeft.addBox(-4F, 0F, -4F, 4, 10, 4); - cornerFrontLeft.setRotationPoint(8F, 14F, -4F); - cornerFrontLeft.setTextureSize(64, 32); - cornerFrontLeft.mirror = true; - setRotation(cornerFrontLeft, 0F, 0F, 0F); - cornerFrontRight = new ModelRenderer(this, 0, 37); - cornerFrontRight.addBox(-4F, 0F, -4F, 4, 10, 4); - cornerFrontRight.setRotationPoint(-4F, 14F, -4F); - cornerFrontRight.setTextureSize(64, 32); - cornerFrontRight.mirror = true; - setRotation(cornerFrontRight, 0F, 0F, 0F); - } - - public void render(boolean[] side, boolean stone) - { - if (side != null) - { - renderMiddle(!side[0], stone); - renderBack(side[2] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP); - renderFront(side[3] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP); - renderRight(side[4] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP); - renderLeft(side[5] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP); - } - } - - public void renderMiddle(boolean bottom, boolean corners) - { - if (bottom) - base.render(0.0625F); - centerA.render(0.0625F); - centerB.render(0.0625F); - centerC.render(0.0625F); - centerD.render(0.0625F); - if (corners) - { - cornerBackLeft.render(0.0625F); - cornerBackRight.render(0.0625F); - cornerFrontLeft.render(0.0625F); - cornerFrontRight.render(0.0625F); - } - } - - public void renderLeft(PipeType type) - { - if (type != PipeType.MID_CAP) - { - leftBase.render(0.0625F); - leftBaseB.render(0.0625F); - leftB.render(0.0625F); - leftA.render(0.0625F); - if (type == PipeType.CAP || type == PipeType.SOLID) - { - leftDoorA.render(0.0625F); - if (type == PipeType.SOLID) - { - leftDoorB.render(0.0625F); - leftDoorC.render(0.0625F); - } - } - } - else - { - leftDoorC.render(0.0625F); - } - } - - public void renderRight(PipeType type) - { - if (type != PipeType.MID_CAP) - { - rightBaseB.render(0.0625F); - rightBase.render(0.0625F); - rightA.render(0.0625F); - rightB.render(0.0625F); - if (type == PipeType.CAP || type == PipeType.SOLID) - { - rightDoorA.render(0.0625F); - if (type == PipeType.SOLID) - { - rightDoorB.render(0.0625F); - rightDoorC.render(0.0625F); - } - } - } - else - { - rightDoorC.render(0.0625F); - } - } - - public void renderBack(PipeType type) - { - if (type != PipeType.MID_CAP) - { - backBase.render(0.0625F); - backBaseB.render(0.0625F); - backA.render(0.0625F); - backB.render(0.0625F); - if (type == PipeType.CAP || type == PipeType.SOLID) - { - backDoorA.render(0.0625F); - if (type == PipeType.SOLID) - { - backDoorB.render(0.0625F); - backDoorC.render(0.0625F); - } - } - } - else - { - backDoorC.render(0.0625F); - } - } - - public void renderFront(PipeType type) - { - if (type != PipeType.MID_CAP) - { - frontBase.render(0.0625F); - frontBaseB.render(0.0625F); - frontA.render(0.0625F); - frontB.render(0.0625F); - if (type == PipeType.CAP || type == PipeType.SOLID) - { - frontDoorA.render(0.0625F); - if (type == PipeType.SOLID) - { - frontDoorB.render(0.0625F); - frontDoorC.render(0.0625F); - } - } - } - else - { - frontDoorC.render(0.0625F); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public static enum PipeType - { - /** When there is no connection */ - MID_CAP, - /** Pipe to pipe connection */ - NORMAL, - /** Pipe to wall */ - CAP, - /** No pipe, used only by stone through */ - SOLID; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelPump.java b/archive/java/resonantinduction/old/client/model/ModelPump.java deleted file mode 100644 index 110f2fbd..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelPump.java +++ /dev/null @@ -1,294 +0,0 @@ -// Date: 1/22/2013 9:59:56 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelPump extends ModelBase -{ - // fields - ModelRenderer Body; - ModelRenderer pipecc1; - ModelRenderer pipecc3; - ModelRenderer wheelcenter; - ModelRenderer wheelcenter2; - ModelRenderer joint; - ModelRenderer wheelcc0; - ModelRenderer wheelcc1; - ModelRenderer wheelcc2; - ModelRenderer wheelcc3; - ModelRenderer wheelcc4; - ModelRenderer wheelcc5; - ModelRenderer wheelcc6; - ModelRenderer wheelcc7; - ModelRenderer wheelBrace; - ModelRenderer piston_top; - ModelRenderer piston; - ModelRenderer wheelBrace2; - ModelRenderer joint2; - ModelRenderer w2; - ModelRenderer w22; - ModelRenderer w2cc; - ModelRenderer w2cc1; - ModelRenderer w2cc2; - ModelRenderer w2cc3; - ModelRenderer w2cc4; - ModelRenderer w2cc5; - ModelRenderer w2cc6; - ModelRenderer w2cc7; - ModelRenderer side7; - ModelRenderer side8; - - public ModelPump() - { - textureWidth = 128; - textureHeight = 128; - - Body = new ModelRenderer(this, 0, 109); - Body.addBox(-3F, 0F, -3F, 6, 12, 6); - Body.setRotationPoint(0F, 12F, 0F); - Body.setTextureSize(128, 128); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - pipecc1 = new ModelRenderer(this, 21, 92); - pipecc1.addBox(-3.5F, -3.5F, 3F, 7, 7, 5); - pipecc1.setRotationPoint(0F, 16F, 0F); - pipecc1.setTextureSize(128, 128); - pipecc1.mirror = true; - setRotation(pipecc1, 0F, 1.570796F, 0F); - pipecc3 = new ModelRenderer(this, 8, 50); - pipecc3.addBox(-3.5F, -4F, 3F, 7, 5, 5); - pipecc3.setRotationPoint(0F, 16F, 0F); - pipecc3.setTextureSize(128, 128); - pipecc3.mirror = true; - setRotation(pipecc3, 0F, 3.141593F, 0F); - wheelcenter = new ModelRenderer(this, 0, 25); - wheelcenter.addBox(0F, -2.5F, -2.5F, 1, 5, 5); - wheelcenter.setRotationPoint(-5F, 18F, 0F); - wheelcenter.setTextureSize(128, 128); - wheelcenter.mirror = true; - setRotation(wheelcenter, 0F, 0F, 0F); - wheelcenter2 = new ModelRenderer(this, 0, 25); - wheelcenter2.addBox(0F, -2.5F, -2.5F, 1, 5, 5); - wheelcenter2.setRotationPoint(-5F, 18F, 0F); - wheelcenter2.setTextureSize(128, 128); - wheelcenter2.mirror = true; - setRotation(wheelcenter2, 0.7853982F, 0F, 0F); - joint = new ModelRenderer(this, 0, 18); - joint.addBox(0F, -1.5F, -1.5F, 1, 3, 3); - joint.setRotationPoint(-4F, 18F, 0F); - joint.setTextureSize(128, 128); - joint.mirror = true; - setRotation(joint, 0F, 0F, 0F); - wheelcc0 = new ModelRenderer(this, 0, 0); - wheelcc0.addBox(0F, -4.5F, -2F, 1, 1, 4); - wheelcc0.setRotationPoint(-5F, 18F, 0F); - wheelcc0.setTextureSize(128, 128); - wheelcc0.mirror = true; - setRotation(wheelcc0, 1.570796F, 0F, 0F); - wheelcc1 = new ModelRenderer(this, 0, 0); - wheelcc1.addBox(0F, -4.5F, -2F, 1, 1, 4); - wheelcc1.setRotationPoint(-5F, 18F, 0F); - wheelcc1.setTextureSize(128, 128); - wheelcc1.mirror = true; - setRotation(wheelcc1, 0F, 0F, 0F); - wheelcc2 = new ModelRenderer(this, 0, 0); - wheelcc2.addBox(0F, -4.5F, -2F, 1, 1, 4); - wheelcc2.setRotationPoint(-5F, 18F, 0F); - wheelcc2.setTextureSize(128, 128); - wheelcc2.mirror = true; - setRotation(wheelcc2, -1.570796F, 0F, 0F); - wheelcc3 = new ModelRenderer(this, 0, 0); - wheelcc3.addBox(0F, -4.5F, -2F, 1, 1, 4); - wheelcc3.setRotationPoint(-5F, 18F, 0F); - wheelcc3.setTextureSize(128, 128); - wheelcc3.mirror = true; - setRotation(wheelcc3, 3.141593F, 0F, 0F); - wheelcc4 = new ModelRenderer(this, 0, 0); - wheelcc4.addBox(0F, -4.5F, -2F, 1, 1, 4); - wheelcc4.setRotationPoint(-5F, 18F, 0F); - wheelcc4.setTextureSize(128, 128); - wheelcc4.mirror = true; - setRotation(wheelcc4, 0.7853982F, 0F, 0F); - wheelcc5 = new ModelRenderer(this, 0, 0); - wheelcc5.addBox(0F, -4.5F, -2F, 1, 1, 4); - wheelcc5.setRotationPoint(-5F, 18F, 0F); - wheelcc5.setTextureSize(128, 128); - wheelcc5.mirror = true; - setRotation(wheelcc5, -2.356194F, 0F, 0F); - wheelcc6 = new ModelRenderer(this, 0, 0); - wheelcc6.addBox(0F, -4.5F, -2F, 1, 1, 4); - wheelcc6.setRotationPoint(-5F, 18F, 0F); - wheelcc6.setTextureSize(128, 128); - wheelcc6.mirror = true; - setRotation(wheelcc6, -0.7853982F, 0F, 0F); - wheelcc7 = new ModelRenderer(this, 0, 0); - wheelcc7.addBox(0F, -4.5F, -2F, 1, 1, 4); - wheelcc7.setRotationPoint(-5F, 18F, 0F); - wheelcc7.setTextureSize(128, 128); - wheelcc7.mirror = true; - setRotation(wheelcc7, 2.356194F, 0F, 0F); - wheelBrace = new ModelRenderer(this, 27, 5); - wheelBrace.addBox(0F, -1.5F, -1.5F, 1, 8, 3); - wheelBrace.setRotationPoint(-6F, 18F, 0F); - wheelBrace.setTextureSize(128, 128); - wheelBrace.mirror = true; - setRotation(wheelBrace, 0F, 0F, 0F); - piston_top = new ModelRenderer(this, 0, 81); - piston_top.addBox(-3F, 0F, -3F, 6, 1, 6); - piston_top.setRotationPoint(0F, 10F, 0F); - piston_top.setTextureSize(128, 128); - piston_top.mirror = true; - setRotation(piston_top, 0F, 0F, 0F); - piston = new ModelRenderer(this, 0, 90); - piston.addBox(-2.5F, 0F, -2.5F, 5, 12, 5); - piston.setRotationPoint(0F, 11F, 0F); - piston.setTextureSize(128, 128); - piston.mirror = true; - setRotation(piston, 0F, 0F, 0F); - wheelBrace2 = new ModelRenderer(this, 26, 18); - wheelBrace2.addBox(0F, 0F, -1.5F, 2, 1, 3); - wheelBrace2.setRotationPoint(-5F, 23F, 0F); - wheelBrace2.setTextureSize(128, 128); - wheelBrace2.mirror = true; - setRotation(wheelBrace2, 0F, 0F, 0F); - joint2 = new ModelRenderer(this, 0, 14); - joint2.addBox(0F, -0.5F, -0.5F, 1, 1, 1); - joint2.setRotationPoint(-4F, 14F, -6F); - joint2.setTextureSize(128, 128); - joint2.mirror = true; - setRotation(joint2, 0F, 0F, 0F); - w2 = new ModelRenderer(this, 0, 55); - w2.addBox(0F, -1F, -1F, 1, 2, 2); - w2.setRotationPoint(-5F, 14F, -6F); - w2.setTextureSize(128, 128); - w2.mirror = true; - setRotation(w2, 0.7853982F, 0F, 0F); - w22 = new ModelRenderer(this, 0, 55); - w22.addBox(0F, -1F, -1F, 1, 2, 2); - w22.setRotationPoint(-5F, 14F, -6F); - w22.setTextureSize(128, 128); - w22.mirror = true; - setRotation(w22, 0F, 0F, 0F); - w2cc = new ModelRenderer(this, 0, 50); - w2cc.addBox(0F, 1.3F, -1F, 1, 1, 2); - w2cc.setRotationPoint(-5F, 14F, -6F); - w2cc.setTextureSize(128, 128); - w2cc.mirror = true; - setRotation(w2cc, 1.570796F, 0F, 0F); - w2cc1 = new ModelRenderer(this, 0, 50); - w2cc1.addBox(0F, 1.3F, -1F, 1, 1, 2); - w2cc1.setRotationPoint(-5F, 14F, -6F); - w2cc1.setTextureSize(128, 128); - w2cc1.mirror = true; - setRotation(w2cc1, 0.7853982F, 0F, 0F); - w2cc2 = new ModelRenderer(this, 0, 50); - w2cc2.addBox(0F, 1.3F, -1F, 1, 1, 2); - w2cc2.setRotationPoint(-5F, 14F, -6F); - w2cc2.setTextureSize(128, 128); - w2cc2.mirror = true; - setRotation(w2cc2, 0F, 0F, 0F); - w2cc3 = new ModelRenderer(this, 0, 50); - w2cc3.addBox(0F, 1.3F, -1F, 1, 1, 2); - w2cc3.setRotationPoint(-5F, 14F, -6F); - w2cc3.setTextureSize(128, 128); - w2cc3.mirror = true; - setRotation(w2cc3, -0.7853982F, 0F, 0F); - w2cc4 = new ModelRenderer(this, 0, 50); - w2cc4.addBox(0F, 1.3F, -1F, 1, 1, 2); - w2cc4.setRotationPoint(-5F, 14F, -6F); - w2cc4.setTextureSize(128, 128); - w2cc4.mirror = true; - setRotation(w2cc4, -1.570796F, 0F, 0F); - w2cc5 = new ModelRenderer(this, 0, 50); - w2cc5.addBox(0F, 1.3F, -1F, 1, 1, 2); - w2cc5.setRotationPoint(-5F, 14F, -6F); - w2cc5.setTextureSize(128, 128); - w2cc5.mirror = true; - setRotation(w2cc5, -2.356194F, 0F, 0F); - w2cc6 = new ModelRenderer(this, 0, 50); - w2cc6.addBox(0F, 1.3F, -1F, 1, 1, 2); - w2cc6.setRotationPoint(-5F, 14F, -6F); - w2cc6.setTextureSize(128, 128); - w2cc6.mirror = true; - setRotation(w2cc6, 3.141593F, 0F, 0F); - w2cc7 = new ModelRenderer(this, 0, 50); - w2cc7.addBox(0F, 1.3F, -1F, 1, 1, 2); - w2cc7.setRotationPoint(-5F, 14F, -6F); - w2cc7.setTextureSize(128, 128); - w2cc7.mirror = true; - setRotation(w2cc7, -3.926991F, 0F, 0F); - side7 = new ModelRenderer(this, 0, 65); - side7.addBox(-2.5F, -4F, 3F, 5, 7, 4); - side7.setRotationPoint(0F, 21F, 0F); - side7.setTextureSize(128, 128); - side7.mirror = true; - setRotation(side7, 0F, 3.141593F, 0F); - side8 = new ModelRenderer(this, 25, 111); - side8.addBox(-2.5F, 0F, 3F, 5, 11, 3); - side8.setRotationPoint(0F, 13F, 0F); - side8.setTextureSize(128, 128); - side8.mirror = true; - setRotation(side8, 0F, 0F, 0F); - } - - public void render(float f5) - { - Body.render(f5); - pipecc1.render(f5); - pipecc3.render(f5); - - joint.render(f5); - - wheelBrace.render(f5); - piston_top.render(f5); - piston.render(f5); - wheelBrace2.render(f5); - joint2.render(f5); - - side7.render(f5); - side8.render(f5); - } - - public void renderMotion(float f5, int i) - { - // wheel 1 - wheelcenter.render(f5); - wheelcenter2.render(f5); - wheelcc0.render(f5); - wheelcc1.render(f5); - wheelcc2.render(f5); - wheelcc3.render(f5); - wheelcc4.render(f5); - wheelcc5.render(f5); - wheelcc6.render(f5); - wheelcc7.render(f5); - // wheel 2 - w2.render(f5); - w22.render(f5); - w2cc.render(f5); - w2cc1.render(f5); - w2cc2.render(f5); - w2cc3.render(f5); - w2cc4.render(f5); - w2cc5.render(f5); - w2cc6.render(f5); - w2cc7.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelRejectorPiston.java b/archive/java/resonantinduction/old/client/model/ModelRejectorPiston.java deleted file mode 100644 index 9b3dbab3..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelRejectorPiston.java +++ /dev/null @@ -1,172 +0,0 @@ -// Date: 1/17/2013 8:14:56 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelRejectorPiston extends ModelBase -{ - // fields - ModelRenderer BodyBottom; - ModelRenderer PistonFace2; - ModelRenderer PistonShaft; - ModelRenderer Piston; - ModelRenderer H1; - ModelRenderer H2; - ModelRenderer H3; - ModelRenderer PistonFace; - ModelRenderer WireCCRight; - ModelRenderer WireCCLeft; - ModelRenderer BodyP2; - ModelRenderer BodyP1; - ModelRenderer LeftSide; - ModelRenderer RightSide; - ModelRenderer PistonBack; - ModelRenderer WireCCFront; - - public ModelRejectorPiston() - { - textureWidth = 128; - textureHeight = 128; - - BodyBottom = new ModelRenderer(this, 29, 69); - BodyBottom.addBox(-5F, 0F, -2F, 10, 5, 15); - BodyBottom.setRotationPoint(0F, 19F, -6F); - BodyBottom.setTextureSize(128, 128); - BodyBottom.mirror = true; - setRotation(BodyBottom, 0F, 0F, 0F); - PistonFace2 = new ModelRenderer(this, 0, 53); - PistonFace2.addBox(-2F, -2F, -1F, 4, 6, 1); - PistonFace2.setRotationPoint(0F, 15F, -6F); - PistonFace2.setTextureSize(128, 128); - PistonFace2.mirror = true; - setRotation(PistonFace2, 0F, 0F, 0F); - PistonShaft = new ModelRenderer(this, 0, 75); - PistonShaft.addBox(-1.5F, -1.5F, 0F, 3, 3, 10); - PistonShaft.setRotationPoint(0F, 16F, -6F); - PistonShaft.setTextureSize(128, 128); - PistonShaft.mirror = true; - setRotation(PistonShaft, 0F, 0F, 0F); - Piston = new ModelRenderer(this, 0, 22); - Piston.addBox(-3F, -1F, 0F, 6, 6, 10); - Piston.setRotationPoint(0F, 14F, -5F); - Piston.setTextureSize(128, 128); - Piston.mirror = true; - setRotation(Piston, 0F, 0F, 0F); - H1 = new ModelRenderer(this, 33, 23); - H1.addBox(-1.5F, 0F, 0F, 3, 1, 8); - H1.setRotationPoint(0F, 12F, -4F); - H1.setTextureSize(128, 128); - H1.mirror = true; - setRotation(H1, 0F, 0F, 0F); - H2 = new ModelRenderer(this, 90, 23); - H2.addBox(0F, -1.5F, 0F, 1, 3, 8); - H2.setRotationPoint(-4F, 16F, -4F); - H2.setTextureSize(128, 128); - H2.mirror = true; - setRotation(H2, 0F, 0F, 0F); - H3 = new ModelRenderer(this, 70, 23); - H3.addBox(0F, -1.5F, 0F, 1, 3, 8); - H3.setRotationPoint(3F, 16F, -4F); - H3.setTextureSize(128, 128); - H3.mirror = true; - setRotation(H3, 0F, 0F, 0F); - PistonFace = new ModelRenderer(this, 0, 62); - PistonFace.addBox(-3F, -2F, -1F, 6, 4, 1); - PistonFace.setRotationPoint(0F, 16F, -6F); - PistonFace.setTextureSize(128, 128); - PistonFace.mirror = true; - setRotation(PistonFace, 0F, 0F, 0F); - WireCCRight = new ModelRenderer(this, 69, 52); - WireCCRight.addBox(-3F, -3F, 0F, 6, 11, 1); - WireCCRight.setRotationPoint(0F, 16F, 7F); - WireCCRight.setTextureSize(128, 128); - WireCCRight.mirror = true; - setRotation(WireCCRight, 0F, 0F, 0F); - WireCCLeft = new ModelRenderer(this, 54, 37); - WireCCLeft.addBox(0F, -3F, -3F, 1, 8, 6); - WireCCLeft.setRotationPoint(7F, 16F, 0F); - WireCCLeft.setTextureSize(128, 128); - WireCCLeft.mirror = true; - setRotation(WireCCLeft, 0F, 0F, 0F); - BodyP2 = new ModelRenderer(this, 100, 60); - BodyP2.addBox(1F, -2F, -2F, 2, 7, 4); - BodyP2.setRotationPoint(-8F, 16F, 0F); - BodyP2.setTextureSize(128, 128); - BodyP2.mirror = true; - setRotation(BodyP2, 0F, 0F, 0F); - BodyP1 = new ModelRenderer(this, 87, 60); - BodyP1.addBox(3F, -2F, -2F, 2, 7, 4); - BodyP1.setRotationPoint(2F, 16F, 0F); - BodyP1.setTextureSize(128, 128); - BodyP1.mirror = true; - setRotation(BodyP1, 0F, 0F, 0F); - LeftSide = new ModelRenderer(this, 29, 91); - LeftSide.addBox(0F, 0F, -2F, 3, 3, 14); - LeftSide.setRotationPoint(5F, 21F, -5F); - LeftSide.setTextureSize(128, 128); - LeftSide.mirror = true; - setRotation(LeftSide, 0F, 0F, 0F); - RightSide = new ModelRenderer(this, 64, 91); - RightSide.addBox(0F, 0F, -2F, 3, 3, 14); - RightSide.setRotationPoint(-8F, 21F, -5F); - RightSide.setTextureSize(128, 128); - RightSide.mirror = true; - setRotation(RightSide, 0F, 0F, 0F); - PistonBack = new ModelRenderer(this, 0, 12); - PistonBack.addBox(-2.5F, -2.5F, -1F, 5, 5, 2); - PistonBack.setRotationPoint(0F, 16F, 6F); - PistonBack.setTextureSize(128, 128); - PistonBack.mirror = true; - setRotation(PistonBack, 0F, 0F, 0F); - WireCCFront = new ModelRenderer(this, 69, 37); - WireCCFront.addBox(0F, -3F, -3F, 1, 8, 6); - WireCCFront.setRotationPoint(-8F, 16F, 0F); - WireCCFront.setTextureSize(128, 128); - WireCCFront.mirror = true; - setRotation(WireCCFront, 0F, 0F, 0F); - } - - public void render(float f5) - { - BodyBottom.render(f5); - Piston.render(f5); - H1.render(f5); - H2.render(f5); - H3.render(f5); - WireCCRight.render(f5); - WireCCLeft.render(f5); - BodyP2.render(f5); - BodyP1.render(f5); - LeftSide.render(f5); - RightSide.render(f5); - PistonBack.render(f5); - WireCCFront.render(f5); - } - - public void renderPiston(float f5, int p) - { - PistonFace2.setRotationPoint(0F, 15F, -6F - p); - PistonShaft.setRotationPoint(0F, 16F, -6F - p); - PistonFace.setRotationPoint(0F, 16F, -6F - p); - PistonFace2.render(f5); - PistonShaft.render(f5); - PistonFace.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelReleaseValve.java b/archive/java/resonantinduction/old/client/model/ModelReleaseValve.java deleted file mode 100644 index 808a8eaa..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelReleaseValve.java +++ /dev/null @@ -1,137 +0,0 @@ -// Date: 1/7/2013 12:20:13 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelReleaseValve extends ModelBase -{ - - // fields - ModelRenderer ValveStem; - ModelRenderer ValveWheelCenter; - ModelRenderer ValveRest; - ModelRenderer WheelBar3; - ModelRenderer WheelBar4; - ModelRenderer Wheel; - ModelRenderer Wheel2; - ModelRenderer Wheel3; - ModelRenderer Wheel4; - ModelRenderer WheelB; - ModelRenderer WheelB2; - ModelRenderer WheelB3; - ModelRenderer WheelB4; - ModelRenderer[] renders; - - public ModelReleaseValve() - { - textureWidth = 128; - textureHeight = 32; - - ValveStem = new ModelRenderer(this, 50, 21); - ValveStem.addBox(-1F, -6F, -1F, 2, 3, 2); - ValveStem.setRotationPoint(0F, 16F, 0F); - ValveStem.setTextureSize(128, 32); - ValveStem.mirror = true; - setRotation(ValveStem, 0F, 0F, 0F); - ValveWheelCenter = new ModelRenderer(this, 50, 17); - ValveWheelCenter.addBox(-0.5F, -7.5F, -0.5F, 1, 2, 1); - ValveWheelCenter.setRotationPoint(0F, 16F, 0F); - ValveWheelCenter.setTextureSize(128, 32); - ValveWheelCenter.mirror = true; - setRotation(ValveWheelCenter, 0F, 0F, 0F); - ValveRest = new ModelRenderer(this, 50, 27); - ValveRest.addBox(-1.5F, -4F, -1.5F, 3, 1, 3); - ValveRest.setRotationPoint(0F, 16F, 0F); - ValveRest.setTextureSize(128, 32); - ValveRest.mirror = true; - setRotation(ValveRest, 0F, 0F, 0F); - WheelBar3 = new ModelRenderer(this, 85, 15); - WheelBar3.addBox(-3F, -7F, -0.5F, 6, 1, 1); - WheelBar3.setRotationPoint(0F, 16F, 0F); - WheelBar3.setTextureSize(128, 32); - WheelBar3.mirror = true; - setRotation(WheelBar3, 0F, 0.7853982F, 0F); - WheelBar4 = new ModelRenderer(this, 85, 18); - WheelBar4.addBox(-3F, -7F, -0.5F, 6, 1, 1); - WheelBar4.setRotationPoint(0F, 16F, 0F); - WheelBar4.setTextureSize(128, 32); - WheelBar4.mirror = true; - setRotation(WheelBar4, 0F, -0.7853982F, 0F); - Wheel = new ModelRenderer(this, 50, 13); - Wheel.addBox(-1.5F, -7.5F, -3.5F, 3, 1, 1); - Wheel.setRotationPoint(0F, 16F, 0F); - Wheel.setTextureSize(128, 32); - Wheel.mirror = true; - setRotation(Wheel, 0F, -0.7853982F, 0F); - Wheel2 = new ModelRenderer(this, 50, 13); - Wheel2.addBox(-1.5F, -7.5F, -3.5F, 3, 1, 1); - Wheel2.setRotationPoint(0F, 16F, 0F); - Wheel2.setTextureSize(128, 32); - Wheel2.mirror = true; - setRotation(Wheel2, 0F, 2.356194F, 0F); - Wheel3 = new ModelRenderer(this, 50, 13); - Wheel3.addBox(-1.5F, -7.5F, -3.5F, 3, 1, 1); - Wheel3.setRotationPoint(0F, 16F, 0F); - Wheel3.setTextureSize(128, 32); - Wheel3.mirror = true; - setRotation(Wheel3, 0F, -2.356194F, 0F); - Wheel4 = new ModelRenderer(this, 50, 13); - Wheel4.addBox(-1.5F, -7.5F, -3.5F, 3, 1, 1); - Wheel4.setRotationPoint(0F, 16F, 0F); - Wheel4.setTextureSize(128, 32); - Wheel4.mirror = true; - setRotation(Wheel4, 0F, 0.7853982F, 0F); - WheelB = new ModelRenderer(this, 50, 13); - WheelB.addBox(-1.5F, -7.5F, 2.5F, 3, 1, 1); - WheelB.setRotationPoint(0F, 16F, 0F); - WheelB.setTextureSize(128, 32); - WheelB.mirror = true; - setRotation(WheelB, 0F, -3.141593F, 0F); - WheelB2 = new ModelRenderer(this, 50, 13); - WheelB2.addBox(-1.5F, -7.5F, 2.5F, 3, 1, 1); - WheelB2.setRotationPoint(0F, 16F, 0F); - WheelB2.setTextureSize(128, 32); - WheelB2.mirror = true; - setRotation(WheelB2, 0F, 0F, 0F); - WheelB3 = new ModelRenderer(this, 50, 13); - WheelB3.addBox(-1.5F, -7.5F, 2.5F, 3, 1, 1); - WheelB3.setRotationPoint(0F, 16F, 0F); - WheelB3.setTextureSize(128, 32); - WheelB3.mirror = true; - setRotation(WheelB3, 0F, 1.570796F, 0F); - WheelB4 = new ModelRenderer(this, 50, 13); - WheelB4.addBox(-1.5F, -7.5F, 2.5F, 3, 1, 1); - WheelB4.setRotationPoint(0F, 16F, 0F); - WheelB4.setTextureSize(128, 32); - WheelB4.mirror = true; - setRotation(WheelB4, 0F, -1.570796F, 0F); - renders = new ModelRenderer[] { ValveStem, ValveWheelCenter, ValveRest, WheelBar3, WheelBar4, Wheel, Wheel2, Wheel3, Wheel4, WheelB, WheelB2, WheelB3, WheelB4 }; - - } - - public void render() - { - ModelRenderer[] renderSet = renders; - for (int i = 0; i < renders.length; i++) - { - renderSet[i].render(0.0625F); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelSink.java b/archive/java/resonantinduction/old/client/model/ModelSink.java deleted file mode 100644 index cd85c216..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelSink.java +++ /dev/null @@ -1,114 +0,0 @@ -// Date: 1/22/2013 12:21:32 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelSink extends ModelBase -{ - // fields - ModelRenderer Base; - ModelRenderer FrontLip; - ModelRenderer BottomLip; - ModelRenderer RightLip; - ModelRenderer LeftLip; - ModelRenderer BLip; - ModelRenderer Edge; - ModelRenderer Edge2; - ModelRenderer Water; - - public ModelSink() - { - textureWidth = 128; - textureHeight = 128; - - Base = new ModelRenderer(this, 0, 0); - Base.addBox(-7F, 0F, -7F, 14, 12, 14); - Base.setRotationPoint(0F, 12F, 0F); - Base.setTextureSize(128, 128); - Base.mirror = true; - setRotation(Base, 0F, 0F, 0F); - FrontLip = new ModelRenderer(this, 10, 62); - FrontLip.addBox(-8F, -4F, -8F, 16, 4, 2); - FrontLip.setRotationPoint(0F, 12F, 0F); - FrontLip.setTextureSize(128, 128); - FrontLip.mirror = true; - setRotation(FrontLip, 0F, 0F, 0F); - BottomLip = new ModelRenderer(this, 5, 37); - BottomLip.addBox(-8F, -4F, 4F, 16, 4, 4); - BottomLip.setRotationPoint(0F, 12F, 0F); - BottomLip.setTextureSize(128, 128); - BottomLip.mirror = true; - setRotation(BottomLip, 0F, 0F, 0F); - RightLip = new ModelRenderer(this, 0, 47); - RightLip.addBox(-8F, -4F, -6F, 2, 4, 10); - RightLip.setRotationPoint(0F, 12F, 0F); - RightLip.setTextureSize(128, 128); - RightLip.mirror = true; - setRotation(RightLip, 0F, 0F, 0F); - LeftLip = new ModelRenderer(this, 25, 47); - LeftLip.addBox(6F, -4F, -6F, 2, 4, 10); - LeftLip.setRotationPoint(0F, 12F, 0F); - LeftLip.setTextureSize(128, 128); - LeftLip.mirror = true; - setRotation(LeftLip, 0F, 0F, 0F); - BLip = new ModelRenderer(this, 9, 32); - BLip.addBox(-1F, -1F, 4F, 2, 2, 2); - BLip.setRotationPoint(0F, 12F, 0F); - BLip.setTextureSize(128, 128); - BLip.mirror = true; - setRotation(BLip, 0.5061455F, 0F, 0F); - Edge = new ModelRenderer(this, 5, 64); - Edge.addBox(0F, 0F, 0F, 1, 12, 1); - Edge.setRotationPoint(7F, 12F, 7F); - Edge.setTextureSize(128, 128); - Edge.mirror = true; - setRotation(Edge, 0F, 0F, 0F); - Edge2 = new ModelRenderer(this, 0, 64); - Edge2.addBox(0F, 0F, 0F, 1, 12, 1); - Edge2.setRotationPoint(-8F, 12F, 7F); - Edge2.setTextureSize(128, 128); - Edge2.mirror = true; - setRotation(Edge2, 0F, 0F, 0F); - Water = new ModelRenderer(this, 0, 0); - Water.addBox(-6F, 0F, -6F, 12, 0, 10); - Water.setRotationPoint(0F, 12F, 0F); - Water.setTextureSize(128, 128); - Water.mirror = true; - setRotation(Water, 0F, 0F, 0F); - } - - public void render(float f5) - { - Base.render(f5); - FrontLip.render(f5); - BottomLip.render(f5); - RightLip.render(f5); - LeftLip.render(f5); - BLip.render(f5); - Edge.render(f5); - Edge2.render(f5); - - } - - public void renderLiquid(float f5, float level) - { - Water.setRotationPoint(0F, 12F - level, 0F); - Water.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelSmallFluidCan.java b/archive/java/resonantinduction/old/client/model/ModelSmallFluidCan.java deleted file mode 100644 index cc7d7f28..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelSmallFluidCan.java +++ /dev/null @@ -1,126 +0,0 @@ -// Date: 11/27/2013 9:27:04 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelSmallFluidCan extends ModelBase -{ - // fields - ModelRenderer body1; - ModelRenderer body2; - ModelRenderer body3; - ModelRenderer body4; - ModelRenderer edge1; - ModelRenderer edge2; - ModelRenderer edge3; - ModelRenderer edge4; - ModelRenderer glass1; - ModelRenderer glass2; - ModelRenderer glass3; - ModelRenderer glass4; - - public ModelSmallFluidCan() - { - textureWidth = 64; - textureHeight = 32; - - body1 = new ModelRenderer(this, 12, 28); - body1.addBox(-1.5F, 0F, -1.5F, 3, 1, 3); - body1.setRotationPoint(0F, 23F, 0F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 10, 22); - body2.addBox(-2F, -1F, -2F, 4, 1, 4); - body2.setRotationPoint(0F, 23F, 0F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body3 = new ModelRenderer(this, 10, 5); - body3.addBox(-2F, -1F, -2F, 4, 1, 4); - body3.setRotationPoint(0F, 17F, 0F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body4 = new ModelRenderer(this, 12, 0); - body4.addBox(-1.5F, 0F, -1.5F, 3, 1, 3); - body4.setRotationPoint(0F, 15F, 0F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - edge1 = new ModelRenderer(this, 21, 13); - edge1.addBox(-1.9F, -1F, -1.9F, 1, 5, 1); - edge1.setRotationPoint(0F, 18F, 0F); - edge1.setTextureSize(64, 32); - edge1.mirror = true; - setRotation(edge1, 0F, 0F, 0F); - edge2 = new ModelRenderer(this, 26, 13); - edge2.addBox(-2.1F, -1F, -1.9F, 1, 5, 1); - edge2.setRotationPoint(3F, 18F, 0F); - edge2.setTextureSize(64, 32); - edge2.mirror = true; - setRotation(edge2, 0F, 0F, 0F); - edge3 = new ModelRenderer(this, 10, 13); - edge3.addBox(-2.1F, -1F, 0.9F, 1, 5, 1); - edge3.setRotationPoint(3F, 18F, 0F); - edge3.setTextureSize(64, 32); - edge3.mirror = true; - setRotation(edge3, 0F, 0F, 0F); - edge4 = new ModelRenderer(this, 16, 13); - edge4.addBox(-1.9F, -1F, 0.9F, 1, 5, 1); - edge4.setRotationPoint(0F, 18F, 0F); - edge4.setTextureSize(64, 32); - edge4.mirror = true; - setRotation(edge4, 0F, 0F, 0F); - glass1 = new ModelRenderer(this, 2, 13); - glass1.addBox(-3.1F, -1F, 1.8F, 2, 5, 0); - glass1.setRotationPoint(2F, 18F, 0F); - glass1.setTextureSize(64, 32); - glass1.mirror = true; - setRotation(glass1, 0F, 0F, 0F); - glass2 = new ModelRenderer(this, 2, 13); - glass2.addBox(-3.1F, -1F, 0.2F, 2, 5, 0); - glass2.setRotationPoint(2F, 18F, -2F); - glass2.setTextureSize(64, 32); - glass2.mirror = true; - setRotation(glass2, 0F, 0F, 0F); - glass3 = new ModelRenderer(this, 2, 13); - glass3.addBox(-1.1F, -1F, -0.2F, 2, 5, 0); - glass3.setRotationPoint(2F, 18F, 0F); - glass3.setTextureSize(64, 32); - glass3.mirror = true; - setRotation(glass3, 0F, 1.570796F, 0F); - glass4 = new ModelRenderer(this, 2, 13); - glass4.addBox(-1.1F, -1F, 2.2F, 2, 5, 0); - glass4.setRotationPoint(-4F, 18F, 0F); - glass4.setTextureSize(64, 32); - glass4.mirror = true; - setRotation(glass4, 0F, 1.570796F, 0F); - } - - public void render(float f5) - { - body1.render(f5); - body2.render(f5); - body3.render(f5); - body4.render(f5); - edge1.render(f5); - edge2.render(f5); - edge3.render(f5); - edge4.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelSteamGen.java b/archive/java/resonantinduction/old/client/model/ModelSteamGen.java deleted file mode 100644 index 943e3f25..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelSteamGen.java +++ /dev/null @@ -1,288 +0,0 @@ -// Date: 11/27/2013 5:36:07 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelRenderer; - -public class ModelSteamGen extends ModelMachine -{ - // fields - ModelRenderer face; - ModelRenderer grill; - ModelRenderer grill2; - ModelRenderer grill3; - ModelRenderer grill4; - ModelRenderer grill5; - ModelRenderer grill6; - ModelRenderer grill7; - ModelRenderer grill8; - ModelRenderer grill9; - ModelRenderer grill10; - ModelRenderer grill11; - ModelRenderer grill12; - ModelRenderer grill13; - ModelRenderer grill14; - ModelRenderer grill15; - ModelRenderer grill16; - ModelRenderer grill17; - ModelRenderer tank; - ModelRenderer tank2; - ModelRenderer tank3; - ModelRenderer tank4; - ModelRenderer tank5; - ModelRenderer tankTop; - ModelRenderer tankTop2; - ModelRenderer tankTop3; - ModelRenderer tankTop4; - ModelRenderer pipe; - ModelRenderer pipe2; - ModelRenderer gauge; - ModelRenderer gaugeNeedle; - - public ModelSteamGen() - { - textureWidth = 128; - textureHeight = 128; - - face = new ModelRenderer(this, 20, 93); - face.addBox(-8F, 0F, -6F, 16, 6, 14); - face.setRotationPoint(0F, 18F, 0F); - face.setTextureSize(128, 128); - face.mirror = true; - setRotation(face, 0F, 0F, 0F); - grill = new ModelRenderer(this, 44, 56); - grill.addBox(0F, 0F, 0F, 1, 5, 1); - grill.setRotationPoint(-7.6F, 18.5F, -7F); - grill.setTextureSize(128, 128); - grill.mirror = true; - setRotation(grill, 0F, 0F, 0F); - grill2 = new ModelRenderer(this, 38, 56); - grill2.addBox(0F, 0F, 0F, 1, 5, 1); - grill2.setRotationPoint(6.4F, 18.5F, -7F); - grill2.setTextureSize(128, 128); - grill2.mirror = true; - setRotation(grill2, 0F, 0F, 0F); - grill3 = new ModelRenderer(this, 0, 49); - grill3.addBox(0F, 0F, 0F, 13, 1, 1); - grill3.setRotationPoint(-6.6F, 18.5F, -7F); - grill3.setTextureSize(128, 128); - grill3.mirror = true; - setRotation(grill3, 0F, 0F, 0F); - grill4 = new ModelRenderer(this, 0, 52); - grill4.addBox(0F, 0F, 0F, 13, 1, 1); - grill4.setRotationPoint(-6.6F, 22.5F, -7F); - grill4.setTextureSize(128, 128); - grill4.mirror = true; - setRotation(grill4, 0F, 0F, 0F); - grill5 = new ModelRenderer(this, 0, 56); - grill5.addBox(0F, 0F, 0F, 1, 3, 1); - grill5.setRotationPoint(-6.6F, 19.5F, -6F); - grill5.setTextureSize(128, 128); - grill5.mirror = true; - setRotation(grill5, 0F, 0.7853982F, 0F); - grill6 = new ModelRenderer(this, 0, 56); - grill6.addBox(0F, 0F, 0F, 1, 3, 1); - grill6.setRotationPoint(5F, 19.5F, -6F); - grill6.setTextureSize(128, 128); - grill6.mirror = true; - setRotation(grill6, 0F, 0.7853982F, 0F); - grill7 = new ModelRenderer(this, 0, 56); - grill7.addBox(0F, 0F, 0F, 1, 3, 1); - grill7.setRotationPoint(4F, 19.5F, -6F); - grill7.setTextureSize(128, 128); - grill7.mirror = true; - setRotation(grill7, 0F, 0.7853982F, 0F); - grill8 = new ModelRenderer(this, 0, 56); - grill8.addBox(0F, 0F, 0F, 1, 3, 1); - grill8.setRotationPoint(3F, 19.5F, -6F); - grill8.setTextureSize(128, 128); - grill8.mirror = true; - setRotation(grill8, 0F, 0.7853982F, 0F); - grill9 = new ModelRenderer(this, 0, 56); - grill9.addBox(0F, 0F, 0F, 1, 3, 1); - grill9.setRotationPoint(2F, 19.5F, -6F); - grill9.setTextureSize(128, 128); - grill9.mirror = true; - setRotation(grill9, 0F, 0.7853982F, 0F); - grill10 = new ModelRenderer(this, 0, 56); - grill10.addBox(0F, 0F, 0F, 1, 3, 1); - grill10.setRotationPoint(-5.6F, 19.5F, -6F); - grill10.setTextureSize(128, 128); - grill10.mirror = true; - setRotation(grill10, 0F, 0.7853982F, 0F); - grill11 = new ModelRenderer(this, 0, 56); - grill11.addBox(0F, 0F, 0F, 1, 3, 1); - grill11.setRotationPoint(-4.6F, 19.5F, -6F); - grill11.setTextureSize(128, 128); - grill11.mirror = true; - setRotation(grill11, 0F, 0.7853982F, 0F); - grill12 = new ModelRenderer(this, 0, 56); - grill12.addBox(0F, 0F, 0F, 1, 3, 1); - grill12.setRotationPoint(-3.6F, 19.5F, -6F); - grill12.setTextureSize(128, 128); - grill12.mirror = true; - setRotation(grill12, 0F, 0.7853982F, 0F); - grill13 = new ModelRenderer(this, 0, 56); - grill13.addBox(0F, 0F, 0F, 1, 3, 1); - grill13.setRotationPoint(-2.6F, 19.5F, -6F); - grill13.setTextureSize(128, 128); - grill13.mirror = true; - setRotation(grill13, 0F, 0.7853982F, 0F); - grill14 = new ModelRenderer(this, 0, 56); - grill14.addBox(0F, 0F, 0F, 1, 3, 1); - grill14.setRotationPoint(-1.6F, 19.5F, -6F); - grill14.setTextureSize(128, 128); - grill14.mirror = true; - setRotation(grill14, 0F, 0.7853982F, 0F); - grill15 = new ModelRenderer(this, 0, 56); - grill15.addBox(0F, 0F, 0F, 1, 3, 1); - grill15.setRotationPoint(1F, 19.5F, -6F); - grill15.setTextureSize(128, 128); - grill15.mirror = true; - setRotation(grill15, 0F, 0.7853982F, 0F); - grill16 = new ModelRenderer(this, 0, 56); - grill16.addBox(0F, 0F, 0F, 1, 3, 1); - grill16.setRotationPoint(0F, 19.5F, -6F); - grill16.setTextureSize(128, 128); - grill16.mirror = true; - setRotation(grill16, 0F, 0.7853982F, 0F); - grill17 = new ModelRenderer(this, 0, 56); - grill17.addBox(0F, 0F, 0F, 1, 3, 1); - grill17.setRotationPoint(-0.8F, 19.5F, -6F); - grill17.setTextureSize(128, 128); - grill17.mirror = true; - setRotation(grill17, 0F, 0.7853982F, 0F); - tank = new ModelRenderer(this, 22, 65); - tank.addBox(-5F, 0F, -5F, 10, 8, 10); - tank.setRotationPoint(0F, 10F, 2F); - tank.setTextureSize(128, 128); - tank.mirror = true; - setRotation(tank, 0F, 0F, 0F); - tank2 = new ModelRenderer(this, 0, 66); - tank2.addBox(-4F, 0F, -6F, 8, 8, 1); - tank2.setRotationPoint(0F, 10F, 2F); - tank2.setTextureSize(128, 128); - tank2.mirror = true; - setRotation(tank2, 0F, 0F, 0F); - tank3 = new ModelRenderer(this, 0, 65); - tank3.addBox(-4F, 0F, -6F, 8, 8, 1); - tank3.setRotationPoint(0F, 10F, 2F); - tank3.setTextureSize(128, 128); - tank3.mirror = true; - setRotation(tank3, 0F, 1.570796F, 0F); - tank4 = new ModelRenderer(this, 0, 65); - tank4.addBox(-4F, 0F, -6F, 8, 8, 1); - tank4.setRotationPoint(0F, 10F, 2F); - tank4.setTextureSize(128, 128); - tank4.mirror = true; - setRotation(tank4, 0F, 3.141593F, 0F); - tank5 = new ModelRenderer(this, 0, 65); - tank5.addBox(-4F, 0F, -6F, 8, 8, 1); - tank5.setRotationPoint(0F, 10F, 2F); - tank5.setTextureSize(128, 128); - tank5.mirror = true; - setRotation(tank5, 0F, -1.570796F, 0F); - tankTop = new ModelRenderer(this, 0, 11); - tankTop.addBox(0F, 0F, 0F, 16, 2, 4); - tankTop.setRotationPoint(-8F, 8F, -6F); - tankTop.setTextureSize(128, 128); - tankTop.mirror = true; - setRotation(tankTop, 0F, 0F, 0F); - tankTop2 = new ModelRenderer(this, 0, 18); - tankTop2.addBox(-4F, 0F, 2F, 8, 2, 4); - tankTop2.setRotationPoint(0F, 8F, 2F); - tankTop2.setTextureSize(128, 128); - tankTop2.mirror = true; - setRotation(tankTop2, 0F, 0F, 0F); - tankTop3 = new ModelRenderer(this, 29, 25); - tankTop3.addBox(0F, 0F, 0F, 4, 2, 10); - tankTop3.setRotationPoint(4F, 8F, -2F); - tankTop3.setTextureSize(128, 128); - tankTop3.mirror = true; - setRotation(tankTop3, 0F, 0F, 0F); - tankTop4 = new ModelRenderer(this, 0, 25); - tankTop4.addBox(0F, 0F, 0F, 4, 2, 10); - tankTop4.setRotationPoint(-8F, 8F, -2F); - tankTop4.setTextureSize(128, 128); - tankTop4.mirror = true; - setRotation(tankTop4, 0F, 0F, 0F); - pipe = new ModelRenderer(this, 10, 0); - pipe.addBox(0F, 0F, 0F, 2, 8, 2); - pipe.setRotationPoint(-7F, 10F, -5F); - pipe.setTextureSize(128, 128); - pipe.mirror = true; - setRotation(pipe, 0F, 0F, 0F); - pipe2 = new ModelRenderer(this, 0, 0); - pipe2.addBox(0F, 0F, 0F, 2, 8, 2); - pipe2.setRotationPoint(5F, 10F, -5F); - pipe2.setTextureSize(128, 128); - pipe2.mirror = true; - setRotation(pipe2, 0F, 0F, 0F); - gauge = new ModelRenderer(this, 59, 25); - gauge.addBox(0F, 0F, 0F, 4, 4, 1); - gauge.setRotationPoint(-2F, 12F, -4.5F); - gauge.setTextureSize(128, 128); - gauge.mirror = true; - setRotation(gauge, 0F, 0F, 0F); - gaugeNeedle = new ModelRenderer(this, 71, 25); - gaugeNeedle.addBox(-0.5F, -2F, -1F, 1, 3, 0); - gaugeNeedle.setRotationPoint(0F, 15F, -3.6F); - gaugeNeedle.setTextureSize(128, 128); - gaugeNeedle.mirror = true; - setRotation(gaugeNeedle, -0.0174533F, 0F, -0.5759587F); - } - - @Override - public void render(float f5) - { - face.render(f5); - grill.render(f5); - grill2.render(f5); - grill3.render(f5); - grill4.render(f5); - grill5.render(f5); - grill6.render(f5); - grill7.render(f5); - grill8.render(f5); - grill9.render(f5); - grill10.render(f5); - grill11.render(f5); - grill12.render(f5); - grill13.render(f5); - grill14.render(f5); - grill15.render(f5); - grill16.render(f5); - grill17.render(f5); - tank.render(f5); - tank2.render(f5); - tank3.render(f5); - tank4.render(f5); - tank5.render(f5); - tankTop.render(f5); - tankTop2.render(f5); - tankTop3.render(f5); - tankTop4.render(f5); - pipe.render(f5); - pipe2.render(f5); - gauge.render(f5); - - } - - public void renderGauge(float f5, float angle) - { - gaugeNeedle.rotateAngleZ = angle; - gaugeNeedle.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelSteamTurbine.java b/archive/java/resonantinduction/old/client/model/ModelSteamTurbine.java deleted file mode 100644 index c3b42150..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelSteamTurbine.java +++ /dev/null @@ -1,214 +0,0 @@ -// Date: 11/26/2013 1:36:31 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelRenderer; - -public class ModelSteamTurbine extends ModelMachine -{ - // fields - ModelRenderer base; - ModelRenderer base2; - ModelRenderer centerBeam; - ModelRenderer fan1; - ModelRenderer fan2; - ModelRenderer fan3; - ModelRenderer fan4; - ModelRenderer fan5; - ModelRenderer fan6; - ModelRenderer fan7; - ModelRenderer fan8; - ModelRenderer rightSide; - ModelRenderer leftSide; - ModelRenderer backSide; - ModelRenderer motor; - ModelRenderer motorNeck; - ModelRenderer brace; - ModelRenderer gauge; - ModelRenderer gaugeFrame; - ModelRenderer gaugeFrame2; - ModelRenderer gaugeFrame3; - ModelRenderer gaugeDieal; - - public ModelSteamTurbine() - { - textureWidth = 256; - textureHeight = 256; - - base = new ModelRenderer(this, 120, 40); - base.addBox(-8F, 0F, -8F, 16, 1, 16); - base.setRotationPoint(0F, 23F, 0F); - base.setTextureSize(256, 256); - base.mirror = true; - setRotation(base, 0F, 0F, 0F); - base2 = new ModelRenderer(this, 120, 22); - base2.addBox(-7F, -1F, -7F, 14, 1, 14); - base2.setRotationPoint(0F, 23F, 0F); - base2.setTextureSize(256, 256); - base2.mirror = true; - setRotation(base2, 0F, 0F, 0F); - centerBeam = new ModelRenderer(this, 0, 80); - centerBeam.addBox(-2F, -1F, -2F, 4, 7, 4); - centerBeam.setRotationPoint(0F, 16F, 0F); - centerBeam.setTextureSize(256, 256); - centerBeam.mirror = true; - setRotation(centerBeam, 0F, 0F, 0F); - fan1 = new ModelRenderer(this, 0, 100); - fan1.addBox(-0.5F, -1F, -6F, 1, 7, 4); - fan1.setRotationPoint(0F, 16F, 0F); - fan1.setTextureSize(256, 256); - fan1.mirror = true; - setRotation(fan1, 0F, 0F, 0F); - fan2 = new ModelRenderer(this, 0, 100); - fan2.addBox(-0.5F, -1F, -6F, 1, 7, 4); - fan2.setRotationPoint(0F, 16F, 0F); - fan2.setTextureSize(256, 256); - fan2.mirror = true; - setRotation(fan2, 0F, 0.7853982F, 0F); - fan3 = new ModelRenderer(this, 0, 100); - fan3.addBox(-0.5F, -1F, -6F, 1, 7, 4); - fan3.setRotationPoint(0F, 16F, 0F); - fan3.setTextureSize(256, 256); - fan3.mirror = true; - setRotation(fan3, 0F, 1.570796F, 0F); - fan4 = new ModelRenderer(this, 0, 100); - fan4.addBox(-0.5F, -1F, -6F, 1, 7, 4); - fan4.setRotationPoint(0F, 16F, 0F); - fan4.setTextureSize(256, 256); - fan4.mirror = true; - setRotation(fan4, 0F, 2.356194F, 0F); - fan5 = new ModelRenderer(this, 0, 100); - fan5.addBox(-0.5F, -1F, -6F, 1, 7, 4); - fan5.setRotationPoint(0F, 16F, 0F); - fan5.setTextureSize(256, 256); - fan5.mirror = true; - setRotation(fan5, 0F, 3.141593F, 0F); - fan6 = new ModelRenderer(this, 0, 100); - fan6.addBox(-0.5F, -1F, -6F, 1, 7, 4); - fan6.setRotationPoint(0F, 16F, 0F); - fan6.setTextureSize(256, 256); - fan6.mirror = true; - setRotation(fan6, 0F, -2.356194F, 0F); - fan7 = new ModelRenderer(this, 0, 100); - fan7.addBox(-0.5F, -1F, -6F, 1, 7, 4); - fan7.setRotationPoint(0F, 16F, 0F); - fan7.setTextureSize(256, 256); - fan7.mirror = true; - setRotation(fan7, 0F, -1.570796F, 0F); - fan8 = new ModelRenderer(this, 0, 100); - fan8.addBox(-0.5F, -1F, -6F, 1, 7, 4); - fan8.setRotationPoint(0F, 16F, 0F); - fan8.setTextureSize(256, 256); - fan8.mirror = true; - setRotation(fan8, 0F, -0.7853982F, 0F); - rightSide = new ModelRenderer(this, 124, 0); - rightSide.addBox(-8F, 0F, -3F, 2, 10, 9); - rightSide.setRotationPoint(0F, 13F, 0F); - rightSide.setTextureSize(256, 256); - rightSide.mirror = true; - setRotation(rightSide, 0F, 0F, 0F); - leftSide = new ModelRenderer(this, 150, 0); - leftSide.addBox(6F, 0F, -3F, 2, 10, 9); - leftSide.setRotationPoint(0F, 13F, 0F); - leftSide.setTextureSize(256, 256); - leftSide.mirror = true; - setRotation(leftSide, 0F, 0F, 0F); - backSide = new ModelRenderer(this, 120, 111); - backSide.addBox(-8F, 0F, 6F, 16, 15, 2); - backSide.setRotationPoint(0F, 8F, 0F); - backSide.setTextureSize(256, 256); - backSide.mirror = true; - setRotation(backSide, 0F, 0F, 0F); - motor = new ModelRenderer(this, 0, 53); - motor.addBox(-3F, -1F, -3F, 6, 7, 7); - motor.setRotationPoint(0F, 8F, 0F); - motor.setTextureSize(256, 256); - motor.mirror = true; - setRotation(motor, 0F, 0F, 0F); - motorNeck = new ModelRenderer(this, 0, 71); - motorNeck.addBox(-2F, -1F, -2F, 4, 1, 4); - motorNeck.setRotationPoint(0F, 15F, 0F); - motorNeck.setTextureSize(256, 256); - motorNeck.mirror = true; - setRotation(motorNeck, 0F, 0F, 0F); - brace = new ModelRenderer(this, 120, 96); - brace.addBox(0F, 0F, 0F, 14, 5, 5); - brace.setRotationPoint(-7F, 9F, 1F); - brace.setTextureSize(256, 256); - brace.mirror = true; - setRotation(brace, 0F, 0F, 0F); - gauge = new ModelRenderer(this, 0, 17); - gauge.addBox(0F, 0F, 0F, 5, 5, 2); - gauge.setRotationPoint(-8F, 8F, 0F); - gauge.setTextureSize(256, 256); - gauge.mirror = true; - setRotation(gauge, 0F, 0F, 0F); - gaugeFrame = new ModelRenderer(this, 0, 0); - gaugeFrame.addBox(0F, 0F, 0F, 5, 1, 1); - gaugeFrame.setRotationPoint(-8F, 8F, -0.2F); - gaugeFrame.setTextureSize(256, 256); - gaugeFrame.mirror = true; - setRotation(gaugeFrame, 0F, 0F, 0F); - gaugeFrame2 = new ModelRenderer(this, 0, 0); - gaugeFrame2.addBox(0F, 0F, 0F, 4, 1, 1); - gaugeFrame2.setRotationPoint(-7F, 12F, -0.2F); - gaugeFrame2.setTextureSize(256, 256); - gaugeFrame2.mirror = true; - setRotation(gaugeFrame2, 0F, 0F, 0F); - gaugeFrame3 = new ModelRenderer(this, 0, 0); - gaugeFrame3.addBox(0F, 0F, 0F, 1, 4, 1); - gaugeFrame3.setRotationPoint(-8F, 9F, -0.2F); - gaugeFrame3.setTextureSize(256, 256); - gaugeFrame3.mirror = true; - setRotation(gaugeFrame3, 0F, 0F, 0F); - gaugeDieal = new ModelRenderer(this, 0, 28); - gaugeDieal.addBox(-1F, -0.5F, 0F, 3, 1, 0); - gaugeDieal.setRotationPoint(-5F, 12F, -0.2F); - gaugeDieal.setTextureSize(256, 256); - gaugeDieal.mirror = true; - setRotation(gaugeDieal, 0F, 0F, -2.80998F); - } - - @Override - public void render(float f5) - { - base.render(f5); - base2.render(f5); - centerBeam.render(f5); - rightSide.render(f5); - leftSide.render(f5); - backSide.render(f5); - motor.render(f5); - motorNeck.render(f5); - brace.render(f5); - gauge.render(f5); - gaugeFrame.render(f5); - gaugeFrame2.render(f5); - gaugeFrame3.render(f5); - gaugeDieal.render(f5); - } - - public void renderFan(float f5) - { - fan1.render(f5); - fan2.render(f5); - fan3.render(f5); - fan4.render(f5); - fan5.render(f5); - fan6.render(f5); - fan7.render(f5); - fan8.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelTank.java b/archive/java/resonantinduction/old/client/model/ModelTank.java deleted file mode 100644 index 4bebea39..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelTank.java +++ /dev/null @@ -1,140 +0,0 @@ -// Date: 8/14/2012 1:48:41 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelTank extends ModelBase -{ - // One Block Tank - ModelRenderer TANK_WALL_1; - ModelRenderer TANK_WALL_2; - ModelRenderer TANK_WALL_3; - ModelRenderer TANK_WALL_4; - ModelRenderer TANK_SUPPORT_1; - ModelRenderer TANK_TOP_1; - ModelRenderer TANK_WALL_5; - ModelRenderer TANK_SUPPORT_2; - ModelRenderer TANK_SUPPORT_3; - ModelRenderer TANK_WALL_6; - ModelRenderer TANK_TOP_2; - ModelRenderer TANK_TOP_3; - ModelRenderer TANK_VALVE; - - public ModelTank(float par1) - { - textureWidth = 128; - textureHeight = 128; - - TANK_WALL_1 = new ModelRenderer(this, 0, 49); - TANK_WALL_1.addBox(0F, 0F, 0F, 1, 12, 8, par1); - TANK_WALL_1.setRotationPoint(6F, 12F, -4F); - TANK_WALL_1.setTextureSize(128, 128); - TANK_WALL_1.mirror = true; - setRotation(TANK_WALL_1, 0F, 0F, 0F); - TANK_WALL_2 = new ModelRenderer(this, 0, 70); - TANK_WALL_2.addBox(0F, 0F, 0F, 1, 12, 7, par1); - TANK_WALL_2.setRotationPoint(-8F, 12F, -4F); - TANK_WALL_2.setTextureSize(128, 128); - TANK_WALL_2.mirror = true; - setRotation(TANK_WALL_2, 0F, 0F, 0F); - TANK_WALL_3 = new ModelRenderer(this, 0, 34); - TANK_WALL_3.addBox(0F, 0F, 0F, 8, 12, 1, par1); - TANK_WALL_3.setRotationPoint(0F, 12F, 8F); - TANK_WALL_3.setTextureSize(128, 128); - TANK_WALL_3.mirror = true; - setRotation(TANK_WALL_3, 0F, 2.617994F, 0F); - TANK_WALL_4 = new ModelRenderer(this, 0, 34); - TANK_WALL_4.addBox(0F, 0F, 0F, 8, 12, 1, par1); - TANK_WALL_4.setRotationPoint(0F, 12F, -8F); - TANK_WALL_4.setTextureSize(128, 128); - TANK_WALL_4.mirror = true; - setRotation(TANK_WALL_4, 0F, -0.5235988F, 0F); - TANK_SUPPORT_1 = new ModelRenderer(this, 43, 22); - TANK_SUPPORT_1.addBox(-1F, 0F, -8F, 2, 14, 16, par1); - TANK_SUPPORT_1.setRotationPoint(0F, 10F, 0F); - TANK_SUPPORT_1.setTextureSize(128, 128); - TANK_SUPPORT_1.mirror = true; - setRotation(TANK_SUPPORT_1, 0F, 0F, 0F); - TANK_TOP_1 = new ModelRenderer(this, 43, 11); - TANK_TOP_1.addBox(-8F, 0F, -4F, 16, 2, 8, par1); - TANK_TOP_1.setRotationPoint(0F, 10F, 0F); - TANK_TOP_1.setTextureSize(128, 128); - TANK_TOP_1.mirror = true; - setRotation(TANK_TOP_1, 0F, 0F, 0F); - TANK_WALL_5 = new ModelRenderer(this, 0, 34); - TANK_WALL_5.addBox(0F, 0F, 0F, 8, 12, 1, par1); - TANK_WALL_5.setRotationPoint(0F, 12F, -7F); - TANK_WALL_5.setTextureSize(128, 128); - TANK_WALL_5.mirror = true; - setRotation(TANK_WALL_5, 0F, -2.617994F, 0F); - TANK_SUPPORT_2 = new ModelRenderer(this, 0, 0); - TANK_SUPPORT_2.addBox(-1F, 0F, -9F, 2, 14, 18, par1); - TANK_SUPPORT_2.setRotationPoint(0F, 10F, 0F); - TANK_SUPPORT_2.setTextureSize(128, 128); - TANK_SUPPORT_2.mirror = true; - setRotation(TANK_SUPPORT_2, 0F, 1.047198F, 0F); - TANK_SUPPORT_3 = new ModelRenderer(this, 0, 0); - TANK_SUPPORT_3.addBox(-1F, 0F, -9F, 2, 14, 18, par1); - TANK_SUPPORT_3.setRotationPoint(0F, 10F, 0F); - TANK_SUPPORT_3.setTextureSize(128, 128); - TANK_SUPPORT_3.mirror = true; - setRotation(TANK_SUPPORT_3, 0F, -1.047198F, 0F); - TANK_WALL_6 = new ModelRenderer(this, 0, 34); - TANK_WALL_6.addBox(0F, 0F, 0F, 8, 12, 1, par1); - TANK_WALL_6.setRotationPoint(0F, 12F, 7F); - TANK_WALL_6.setTextureSize(128, 128); - TANK_WALL_6.mirror = true; - setRotation(TANK_WALL_6, 0F, 0.5235988F, 0F); - TANK_TOP_2 = new ModelRenderer(this, 43, 0); - TANK_TOP_2.addBox(-6F, 0F, -4F, 12, 2, 8, par1); - TANK_TOP_2.setRotationPoint(0F, 10F, 0F); - TANK_TOP_2.setTextureSize(128, 128); - TANK_TOP_2.mirror = true; - setRotation(TANK_TOP_2, 0F, 1.047198F, 0F); - TANK_TOP_3 = new ModelRenderer(this, 43, 0); - TANK_TOP_3.addBox(-6F, 0F, -4F, 12, 2, 8, par1); - TANK_TOP_3.setRotationPoint(0F, 10F, 0F); - TANK_TOP_3.setTextureSize(128, 128); - TANK_TOP_3.mirror = true; - setRotation(TANK_TOP_3, 0F, -1.047198F, 0F); - TANK_VALVE = new ModelRenderer(this, 84, 0); - TANK_VALVE.addBox(0F, 0F, 0F, 2, 1, 2, par1); - TANK_VALVE.setRotationPoint(-1F, 9F, -1F); - TANK_VALVE.setTextureSize(128, 128); - TANK_VALVE.mirror = true; - setRotation(TANK_VALVE, 0F, 0F, 0F); - } - - public void generalRender(float f5) - { - TANK_WALL_1.render(f5); - TANK_WALL_2.render(f5); - TANK_WALL_3.render(f5); - TANK_WALL_4.render(f5); - TANK_SUPPORT_1.render(f5); - TANK_TOP_1.render(f5); - TANK_WALL_5.render(f5); - TANK_SUPPORT_2.render(f5); - TANK_SUPPORT_3.render(f5); - TANK_WALL_6.render(f5); - TANK_TOP_2.render(f5); - TANK_TOP_3.render(f5); - TANK_VALVE.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/archive/java/resonantinduction/old/client/model/ModelTankSide.java b/archive/java/resonantinduction/old/client/model/ModelTankSide.java deleted file mode 100644 index 7a50f8f9..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelTankSide.java +++ /dev/null @@ -1,210 +0,0 @@ -// Date: 6/3/2013 6:47:54 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelTankSide extends ModelBase -{ - - ModelRenderer botSiding; - ModelRenderer botRightOut; - ModelRenderer botLeftOut; - - ModelRenderer topSiding; - ModelRenderer topRightOut; - ModelRenderer topLeftOut; - - ModelRenderer leftSiding; - ModelRenderer leftBotSide; - ModelRenderer leftTopSide; - ModelRenderer leftSide; - - ModelRenderer rightSiding; - ModelRenderer rightBotSide; - ModelRenderer rightTopSide; - ModelRenderer rightSide; - - public ModelTankSide() - { - textureWidth = 128; - textureHeight = 128; - - rightSiding = new ModelRenderer(this, 0, 19); - rightSiding.addBox(-7F, 11F, 7F, 2, 10, 1); - rightSiding.setRotationPoint(0F, 0F, 0F); - rightSiding.setTextureSize(128, 128); - rightSiding.mirror = true; - setRotation(rightSiding, 0F, 0F, 0F); - leftSiding = new ModelRenderer(this, 0, 19); - leftSiding.addBox(5F, 11F, 7F, 2, 10, 1); - leftSiding.setRotationPoint(0F, 0F, 0F); - leftSiding.setTextureSize(128, 128); - leftSiding.mirror = true; - setRotation(leftSiding, 0F, 0F, 0F); - topSiding = new ModelRenderer(this, 7, 8); - topSiding.addBox(-5F, 8F, 7F, 10, 3, 1); - topSiding.setRotationPoint(0F, 0F, 0F); - topSiding.setTextureSize(128, 128); - topSiding.mirror = true; - setRotation(topSiding, 0F, 0F, 0F); - botSiding = new ModelRenderer(this, 7, 8); - botSiding.addBox(-5F, 21F, 7F, 10, 3, 1); - botSiding.setRotationPoint(0F, 0F, 0F); - botSiding.setTextureSize(128, 128); - botSiding.mirror = true; - setRotation(botSiding, 0F, 0F, 0F); - botRightOut = new ModelRenderer(this, 0, 0); - botRightOut.addBox(-7F, 21F, 7F, 2, 3, 1); - botRightOut.setRotationPoint(0F, 0F, 0F); - botRightOut.setTextureSize(128, 128); - botRightOut.mirror = true; - setRotation(botRightOut, 0F, 0F, 0F); - botLeftOut = new ModelRenderer(this, 0, 0); - botLeftOut.addBox(5F, 21F, 7F, 2, 3, 1); - botLeftOut.setRotationPoint(0F, 0F, 0F); - botLeftOut.setTextureSize(128, 128); - botLeftOut.mirror = true; - setRotation(botLeftOut, 0F, 0F, 0F); - topRightOut = new ModelRenderer(this, 0, 0); - topRightOut.addBox(-7F, 8F, 7F, 2, 3, 1); - topRightOut.setRotationPoint(0F, 0F, 0F); - topRightOut.setTextureSize(128, 128); - topRightOut.mirror = true; - setRotation(topRightOut, 0F, 0F, 0F); - topLeftOut = new ModelRenderer(this, 0, 0); - topLeftOut.addBox(5F, 8F, 7F, 2, 3, 1); - topLeftOut.setRotationPoint(0F, 0F, 0F); - topLeftOut.setTextureSize(128, 128); - topLeftOut.mirror = true; - setRotation(topLeftOut, 0F, 0F, 0F); - leftSide = new ModelRenderer(this, 0, 19); - leftSide.addBox(7F, 11F, 7F, 1, 10, 1); - leftSide.setRotationPoint(0F, 0F, 0F); - leftSide.setTextureSize(128, 128); - leftSide.mirror = true; - setRotation(leftSide, 0F, 0F, 0F); - leftTopSide = new ModelRenderer(this, 0, 0); - leftTopSide.addBox(7F, 8F, 7F, 1, 3, 1); - leftTopSide.setRotationPoint(0F, 0F, 0F); - leftTopSide.setTextureSize(128, 128); - leftTopSide.mirror = true; - setRotation(leftTopSide, 0F, 0F, 0F); - leftBotSide = new ModelRenderer(this, 0, 0); - leftBotSide.addBox(7F, 21F, 7F, 1, 3, 1); - leftBotSide.setRotationPoint(0F, 0F, 0F); - leftBotSide.setTextureSize(128, 128); - leftBotSide.mirror = true; - setRotation(leftBotSide, 0F, 0F, 0F); - rightBotSide = new ModelRenderer(this, 0, 0); - rightBotSide.addBox(-8F, 21F, 7F, 1, 3, 1); - rightBotSide.setRotationPoint(0F, 0F, 0F); - rightBotSide.setTextureSize(128, 128); - rightBotSide.mirror = true; - setRotation(rightBotSide, 0F, 0F, 0F); - rightSide = new ModelRenderer(this, 0, 19); - rightSide.addBox(-8F, 11F, 7F, 1, 10, 1); - rightSide.setRotationPoint(0F, 0F, 0F); - rightSide.setTextureSize(128, 128); - rightSide.mirror = true; - setRotation(rightSide, 0F, 0F, 0F); - rightTopSide = new ModelRenderer(this, 0, 0); - rightTopSide.addBox(-8F, 8F, 7F, 1, 3, 1); - rightTopSide.setRotationPoint(0F, 0F, 0F); - rightTopSide.setTextureSize(128, 128); - rightTopSide.mirror = true; - setRotation(rightTopSide, 0F, 0F, 0F); - } - - /** - * @param size - render size normal is 0.0625F - * @param left - is the an instance of this to the left - * @param right - "" to the right - * @param bot - "" to the bot - * @param top - "" to the top - * - * Not this only renders one side of the block. You will need to rotate it to face another - * direction then render it. If rotating up or down you will need to translate it a bit - */ - public void render(float size, boolean left, boolean right, boolean bot, boolean top) - { - if (!top) - { - topSiding.render(size); - topRightOut.render(size); - topLeftOut.render(size); - if (right) - { - rightTopSide.render(size); - } - if (left) - { - leftTopSide.render(size); - } - } - if (!bot) - { - botSiding.render(size); - botRightOut.render(size); - botLeftOut.render(size); - if (right) - { - rightBotSide.render(size); - } - if (left) - { - leftBotSide.render(size); - } - } - if (!right) - { - rightSiding.render(size); - rightBotSide.render(size); - rightTopSide.render(size); - rightSide.render(size); - - if (top) - { - topRightOut.render(size); - - } - if (bot) - { - botRightOut.render(size); - } - } - if (!left) - { - leftSiding.render(size); - leftBotSide.render(size); - leftTopSide.render(size); - leftSide.render(size); - - if (top) - { - topLeftOut.render(size); - } - if (bot) - { - botLeftOut.render(size); - } - } - - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelTestCar.java b/archive/java/resonantinduction/old/client/model/ModelTestCar.java deleted file mode 100644 index 596e4d55..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelTestCar.java +++ /dev/null @@ -1,197 +0,0 @@ -// Date: 11/10/2013 11:17:40 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelTestCar extends ModelBase -{ - // fields - ModelRenderer base; - ModelRenderer base2; - ModelRenderer seat; - ModelRenderer seatback; - ModelRenderer engineWall; - ModelRenderer dash; - ModelRenderer body; - ModelRenderer body2; - ModelRenderer body3; - ModelRenderer headlight; - ModelRenderer box; - ModelRenderer boxLid; - ModelRenderer frontRightAxil; - ModelRenderer frontRightWheel; - ModelRenderer frontLefttAxil; - ModelRenderer frontLeftWheel; - ModelRenderer backRightAxil; - ModelRenderer backRightWheel; - ModelRenderer backleftAxil; - ModelRenderer backLeftWheel; - - public ModelTestCar() - { - textureWidth = 128; - textureHeight = 128; - - base = new ModelRenderer(this, 0, 0); - base.addBox(0F, 0F, 0F, 14, 2, 25); - base.setRotationPoint(-7F, 22F, -8F); - base.setTextureSize(128, 128); - base.mirror = true; - setRotation(base, 0F, 0F, 0F); - base2 = new ModelRenderer(this, 0, 0); - base2.addBox(0F, 0F, 0F, 12, 2, 33); - base2.setRotationPoint(-6F, 24F, -18F); - base2.setTextureSize(128, 128); - base2.mirror = true; - setRotation(base2, 0F, 0F, 0F); - seat = new ModelRenderer(this, 2, 73); - seat.addBox(0F, 0F, 0F, 14, 2, 10); - seat.setRotationPoint(-7F, 20F, -3F); - seat.setTextureSize(128, 128); - seat.mirror = true; - setRotation(seat, 0F, 0F, 0F); - seatback = new ModelRenderer(this, 2, 88); - seatback.addBox(0F, 0F, 0F, 14, 2, 10); - seatback.setRotationPoint(-7F, 20F, 5F); - seatback.setTextureSize(128, 128); - seatback.mirror = true; - setRotation(seatback, 1.448623F, 0F, 0F); - engineWall = new ModelRenderer(this, 80, 116); - engineWall.addBox(0F, 0F, 0F, 16, 6, 2); - engineWall.setRotationPoint(-8F, 13F, -8F); - engineWall.setTextureSize(128, 128); - engineWall.mirror = true; - setRotation(engineWall, -0.1570796F, 0F, 0F); - dash = new ModelRenderer(this, 80, 68); - dash.addBox(0F, 0F, 0F, 16, 4, 2); - dash.setRotationPoint(-8F, 10F, -9F); - dash.setTextureSize(128, 128); - dash.mirror = true; - setRotation(dash, 0.2617994F, 0F, 0F); - body = new ModelRenderer(this, 70, 77); - body.addBox(0F, 0F, 0F, 16, 9, 2); - body.setRotationPoint(-8F, 10F, -17F); - body.setTextureSize(128, 128); - body.mirror = true; - setRotation(body, -0.2268928F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 0); - body2.addBox(0F, 0F, 0F, 14, 6, 12); - body2.setRotationPoint(-7F, 18F, -19F); - body2.setTextureSize(128, 128); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body3 = new ModelRenderer(this, 70, 90); - body3.addBox(0F, 0F, 0F, 16, 9, 10); - body3.setRotationPoint(-8F, 10F, -17F); - body3.setTextureSize(128, 128); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - headlight = new ModelRenderer(this, 0, 120); - headlight.addBox(-2F, -2F, -3F, 4, 4, 3); - headlight.setRotationPoint(0F, 19F, -17F); - headlight.setTextureSize(128, 128); - headlight.mirror = true; - setRotation(headlight, 0F, 0F, 0F); - box = new ModelRenderer(this, 0, 43); - box.addBox(0F, 0F, 0F, 14, 7, 9); - box.setRotationPoint(-7F, 15F, 9F); - box.setTextureSize(128, 128); - box.mirror = true; - setRotation(box, 0F, 0F, 0F); - boxLid = new ModelRenderer(this, 47, 43); - boxLid.addBox(0F, -2F, 0F, 14, 2, 9); - boxLid.setRotationPoint(-7F, 15F, 9F); - boxLid.setTextureSize(128, 128); - boxLid.mirror = true; - setRotation(boxLid, 0.0872665F, 0F, 0F); - frontRightAxil = new ModelRenderer(this, 0, 110); - frontRightAxil.addBox(-1F, -1F, -1F, 1, 2, 2); - frontRightAxil.setRotationPoint(-7F, 23F, -12F); - frontRightAxil.setTextureSize(128, 128); - frontRightAxil.mirror = true; - setRotation(frontRightAxil, 0F, 0F, 0F); - frontRightWheel = new ModelRenderer(this, 60, 60); - frontRightWheel.addBox(-1F, -3F, -3F, 2, 6, 6); - frontRightWheel.setRotationPoint(-9F, 23F, -12F); - frontRightWheel.setTextureSize(128, 128); - frontRightWheel.mirror = true; - setRotation(frontRightWheel, 0F, 0F, 0F); - frontLefttAxil = new ModelRenderer(this, 0, 110); - frontLefttAxil.addBox(0F, -1F, -1F, 1, 2, 2); - frontLefttAxil.setRotationPoint(7F, 23F, -12F); - frontLefttAxil.setTextureSize(128, 128); - frontLefttAxil.mirror = true; - setRotation(frontLefttAxil, 0F, 0F, 0F); - frontLeftWheel = new ModelRenderer(this, 60, 60); - frontLeftWheel.addBox(-1F, -3F, -3F, 2, 6, 6); - frontLeftWheel.setRotationPoint(9F, 23F, -12F); - frontLeftWheel.setTextureSize(128, 128); - frontLeftWheel.mirror = true; - setRotation(frontLeftWheel, 0F, 0F, 0F); - backRightAxil = new ModelRenderer(this, 0, 110); - backRightAxil.addBox(-1F, -1F, -1F, 1, 2, 2); - backRightAxil.setRotationPoint(-7F, 23F, 11F); - backRightAxil.setTextureSize(128, 128); - backRightAxil.mirror = true; - setRotation(backRightAxil, 0F, 0F, 0F); - backRightWheel = new ModelRenderer(this, 60, 60); - backRightWheel.addBox(-1F, -3F, -3F, 2, 6, 6); - backRightWheel.setRotationPoint(-9F, 23F, 11F); - backRightWheel.setTextureSize(128, 128); - backRightWheel.mirror = true; - setRotation(backRightWheel, 0F, 0F, 0F); - backleftAxil = new ModelRenderer(this, 110, 0); - backleftAxil.addBox(0F, -1F, -1F, 1, 2, 2); - backleftAxil.setRotationPoint(7F, 23F, 11F); - backleftAxil.setTextureSize(128, 128); - backleftAxil.mirror = true; - setRotation(backleftAxil, 0F, 0F, 0F); - backLeftWheel = new ModelRenderer(this, 60, 60); - backLeftWheel.addBox(-1F, -3F, -3F, 2, 6, 6); - backLeftWheel.setRotationPoint(9F, 23F, 11F); - backLeftWheel.setTextureSize(128, 128); - backLeftWheel.mirror = true; - setRotation(backLeftWheel, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - base.render(f5); - base2.render(f5); - seat.render(f5); - seatback.render(f5); - engineWall.render(f5); - dash.render(f5); - body.render(f5); - body2.render(f5); - body3.render(f5); - headlight.render(f5); - box.render(f5); - boxLid.render(f5); - frontRightAxil.render(f5); - frontRightWheel.render(f5); - frontLefttAxil.render(f5); - frontLeftWheel.render(f5); - backRightAxil.render(f5); - backRightWheel.render(f5); - backleftAxil.render(f5); - backLeftWheel.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/archive/java/resonantinduction/old/client/model/ModelTurkey.java b/archive/java/resonantinduction/old/client/model/ModelTurkey.java deleted file mode 100644 index 6fc9f89e..00000000 --- a/archive/java/resonantinduction/old/client/model/ModelTurkey.java +++ /dev/null @@ -1,172 +0,0 @@ -// Date: 11/28/2013 6:18:31 AM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package resonantinduction.old.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelTurkey extends ModelBase -{ - // fields - ModelRenderer head; - ModelRenderer bill; - ModelRenderer chin; - ModelRenderer body; - ModelRenderer body2; - ModelRenderer rightLeg; - ModelRenderer leftLeg; - ModelRenderer rightWing; - ModelRenderer leftWing; - ModelRenderer neck; - ModelRenderer fan; - - public ModelTurkey() - { - textureWidth = 128; - textureHeight = 128; - - head = new ModelRenderer(this, 0, 0); - head.addBox(0F, -1F, -4F, 4, 6, 3); - head.setRotationPoint(-2F, 6F, -3F); - head.setTextureSize(128, 128); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - bill = new ModelRenderer(this, 14, 0); - bill.addBox(0F, -1F, -4F, 4, 2, 2); - bill.setRotationPoint(-2F, 8F, -5F); - bill.setTextureSize(128, 128); - bill.mirror = true; - setRotation(bill, 0F, 0F, 0F); - chin = new ModelRenderer(this, 14, 4); - chin.addBox(0F, -1F, -4F, 2, 2, 2); - chin.setRotationPoint(-1F, 10F, -4F); - chin.setTextureSize(128, 128); - chin.mirror = true; - setRotation(chin, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 9); - body.addBox(0F, 0F, 0F, 8, 10, 9); - body.setRotationPoint(-4F, 9F, -3F); - body.setTextureSize(128, 128); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 54, 9); - body2.addBox(0F, 0F, 0F, 8, 8, 2); - body2.setRotationPoint(-4F, 11F, -5F); - body2.setTextureSize(128, 128); - body2.mirror = true; - setRotation(body2, 0.1396263F, 0F, 0F); - rightLeg = new ModelRenderer(this, 0, 32); - rightLeg.addBox(2F, 3F, 1F, 2, 5, 2); - rightLeg.setRotationPoint(-1F, 16F, -2F); - rightLeg.setTextureSize(128, 128); - rightLeg.mirror = true; - setRotation(rightLeg, 0F, 0F, 0F); - leftLeg = new ModelRenderer(this, 0, 32); - leftLeg.addBox(-2F, 3F, 1F, 2, 5, 2); - leftLeg.setRotationPoint(-1F, 16F, -2F); - leftLeg.setTextureSize(128, 128); - leftLeg.mirror = true; - setRotation(leftLeg, 0F, 0F, 0F); - rightWing = new ModelRenderer(this, 36, 13); - rightWing.addBox(-5F, -6F, 0F, 1, 7, 7); - rightWing.setRotationPoint(0F, 16F, -2F); - rightWing.setTextureSize(128, 128); - rightWing.mirror = true; - setRotation(rightWing, -0.1745329F, 0F, 0F); - leftWing = new ModelRenderer(this, 36, 13); - leftWing.addBox(5F, -6F, 0F, 1, 7, 7); - leftWing.setRotationPoint(-1F, 16F, -2F); - leftWing.setTextureSize(128, 128); - leftWing.mirror = true; - setRotation(leftWing, -0.1745329F, 0F, 0F); - neck = new ModelRenderer(this, 34, 0); - neck.addBox(0F, 0F, -4F, 3, 4, 4); - neck.setRotationPoint(-1.5F, 8F, -2F); - neck.setTextureSize(128, 128); - neck.mirror = true; - setRotation(neck, 0F, 0F, 0F); - fan = new ModelRenderer(this, 0, 43); - fan.addBox(0F, 0F, 0.05F, 12, 11, 0); - fan.setRotationPoint(-6F, 4F, 6F); - fan.setTextureSize(128, 128); - fan.mirror = true; - setRotation(fan, 0F, 0F, 0F); - } - - @Override - public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) - { - this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); - - if (this.isChild) - { - float f6 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 5.0F * par7, 2.0F * par7); - this.head.render(par7); - this.bill.render(par7); - this.chin.render(par7); - this.neck.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); - GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); - this.body.render(par7); - this.body2.render(par7); - this.fan.render(par7); - this.rightLeg.render(par7); - this.leftLeg.render(par7); - this.rightWing.render(par7); - this.leftWing.render(par7); - GL11.glPopMatrix(); - } - else - { - this.head.render(par7); - this.bill.render(par7); - this.chin.render(par7); - this.body.render(par7); - this.body2.render(par7); - this.fan.render(par7); - this.rightLeg.render(par7); - this.leftLeg.render(par7); - this.rightWing.render(par7); - this.leftWing.render(par7); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) - { - this.head.rotateAngleX = par5 / (180F / (float) Math.PI); - this.head.rotateAngleY = par4 / (180F / (float) Math.PI); - this.bill.rotateAngleX = this.head.rotateAngleX; - this.bill.rotateAngleY = this.head.rotateAngleY; - this.chin.rotateAngleX = this.head.rotateAngleX; - this.chin.rotateAngleY = this.head.rotateAngleY; - // this.body.rotateAngleX = ((float)Math.PI / 2F); - // this.body2.rotateAngleX = ((float)Math.PI / 2F); - // this.fan.rotateAngleX = ((float)Math.PI / 2F); - // this.neck.rotateAngleX = ((float)Math.PI / 2F); - this.rightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; - this.leftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float) Math.PI) * 1.4F * par2; - this.rightWing.rotateAngleZ = par3; - this.leftWing.rotateAngleZ = -par3; - } - -} diff --git a/archive/java/resonantinduction/old/client/render/BlockRenderHelper.java b/archive/java/resonantinduction/old/client/render/BlockRenderHelper.java deleted file mode 100644 index 6626ed18..00000000 --- a/archive/java/resonantinduction/old/client/render/BlockRenderHelper.java +++ /dev/null @@ -1,98 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelConstructionPump; -import resonantinduction.old.client.model.ModelGearRod; -import resonantinduction.old.client.model.ModelGenerator; -import resonantinduction.old.client.model.ModelPump; -import resonantinduction.old.client.model.ModelSink; -import resonantinduction.old.core.recipe.RecipeLoader; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class BlockRenderHelper implements ISimpleBlockRenderingHandler -{ - public static BlockRenderHelper instance = new BlockRenderHelper(); - public static int renderID = RenderingRegistry.getNextAvailableRenderId(); - private ModelPump modelPump = new ModelPump(); - private ModelGearRod modelRod = new ModelGearRod(); - private ModelGenerator modelGen = new ModelGenerator(); - private ModelSink sink = new ModelSink(); - private ModelConstructionPump conPump = new ModelConstructionPump(); - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) - { - GL11.glPushMatrix(); - if (RecipeLoader.blockPumpMachine != null && block.blockID == RecipeLoader.blockPumpMachine.blockID && metadata < 4) - { - GL11.glTranslatef(0.0F, 1.1F, 0.0F); - GL11.glRotatef(180f, 0f, 0f, 1f); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "pumps/WaterPump.png")); - modelPump.render(0.0725F); - modelPump.renderMotion(0.0725F, 0); - } - else if (RecipeLoader.blockSink != null && block.blockID == RecipeLoader.blockSink.blockID) - { - GL11.glTranslatef(0.0F, .8F, 0.0F); - GL11.glRotatef(180f, 0f, 0f, 1f); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "Sink.png")); - sink.render(0.0565F); - } - else if (RecipeLoader.blockRod != null && block.blockID == RecipeLoader.blockRod.blockID) - { - GL11.glTranslatef(0.0F, 1.5F, 0.0F); - GL11.glRotatef(180f, 0f, 0f, 1f); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "mechanical/GearRod.png")); - modelRod.render(0.0825F, 0); - } - else if (RecipeLoader.blockConPump != null && block.blockID == RecipeLoader.blockConPump.blockID && metadata < 4) - { - GL11.glTranslatef(0.0F, 1.2F, 0.0F); - GL11.glRotatef(180f, 0f, 0f, 1f); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "ConstructionPump.png")); - conPump.render(0.0725F); - conPump.renderMotor(0.0725F); - - } - else if (RecipeLoader.frackingPipe != null && block.blockID == RecipeLoader.frackingPipe.blockID) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderFrackingPipe.TEXTURE); - GL11.glTranslatef(0, 1F, 0); - GL11.glScalef(1.0F, -1F, -1F); - RenderFrackingPipe.model.renderAll(); - } - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) - { - return false; - } - - @Override - public boolean shouldRender3DInInventory() - { - - return true; - } - - @Override - public int getRenderId() - { - return renderID; - } -} diff --git a/archive/java/resonantinduction/old/client/render/BlockRenderInfo.java b/archive/java/resonantinduction/old/client/render/BlockRenderInfo.java deleted file mode 100644 index 16c31196..00000000 --- a/archive/java/resonantinduction/old/client/render/BlockRenderInfo.java +++ /dev/null @@ -1,56 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import universalelectricity.api.vector.Vector3; - -/** Used to store info on a block mainly used for rendering */ -public class BlockRenderInfo -{ - /** Block lower corner size */ - public Vector3 min = new Vector3(0, 0, 0); - /** Block higher corner size */ - public Vector3 max = new Vector3(1, 1, 1); - /** Block to pull info from */ - public Block baseBlock = Block.sand; - /** Override render texture */ - public Icon texture = null; - /** meta data to use for block the block */ - public int meta = 0; - - /** Gets the block brightness at the given location */ - public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k) - { - return baseBlock.getBlockBrightness(iblockaccess, i, j, k); - } - - /** Gets the block texture from the given side */ - public Icon getBlockTextureFromSide(int side) - { - return this.getBlockIconFromSideAndMetadata(side, meta); - } - - /** Gets the block texture from side and meta */ - public Icon getBlockIconFromSideAndMetadata(int side, int meta) - { - return this.getIconSafe(baseBlock.getIcon(side, meta)); - } - - /** Gets the icon and does some safty checks */ - public Icon getIconSafe(Icon par1Icon) - { - Icon icon = par1Icon; - if (this.texture != null) - { - icon = texture; - } - if (par1Icon == null) - { - icon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); - } - return icon; - } -} diff --git a/archive/java/resonantinduction/old/client/render/EntityFakeBlock.java b/archive/java/resonantinduction/old/client/render/EntityFakeBlock.java deleted file mode 100644 index ec8220a6..00000000 --- a/archive/java/resonantinduction/old/client/render/EntityFakeBlock.java +++ /dev/null @@ -1,99 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EntityFakeBlock extends Entity -{ - - @SideOnly(Side.CLIENT) - public Icon texture; - public float shadowSize = 0; - public float rotationX = 0; - public float rotationY = 0; - public float rotationZ = 0; - public double iSize, jSize, kSize; - private int brightness = -1; - - public EntityFakeBlock(World world) - { - super(world); - preventEntitySpawning = false; - noClip = true; - isImmuneToFire = true; - } - - public EntityFakeBlock(World world, double xPos, double yPos, double zPos) - { - super(world); - setPositionAndRotation(xPos, yPos, zPos, 0, 0); - } - - public EntityFakeBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize) - { - this(world); - this.iSize = iSize; - this.jSize = jSize; - this.kSize = kSize; - setPositionAndRotation(i, j, k, 0, 0); - this.motionX = 0.0; - this.motionY = 0.0; - this.motionZ = 0.0; - } - - @Override - public void setPosition(double d, double d1, double d2) - { - super.setPosition(d, d1, d2); - boundingBox.minX = posX; - boundingBox.minY = posY; - boundingBox.minZ = posZ; - - boundingBox.maxX = posX + iSize; - boundingBox.maxY = posY + jSize; - boundingBox.maxZ = posZ + kSize; - } - - @Override - public void moveEntity(double d, double d1, double d2) - { - setPosition(posX + d, posY + d1, posZ + d2); - } - - public void setBrightness(int brightness) - { - this.brightness = brightness; - } - - @Override - protected void entityInit() - { - // TODO Auto-generated method stub - } - - @Override - protected void readEntityFromNBT(NBTTagCompound data) - { - iSize = data.getDouble("iSize"); - jSize = data.getDouble("jSize"); - kSize = data.getDouble("kSize"); - } - - @Override - protected void writeEntityToNBT(NBTTagCompound data) - { - data.setDouble("iSize", iSize); - data.setDouble("jSize", jSize); - data.setDouble("kSize", kSize); - } - - @Override - public int getBrightnessForRender(float par1) - { - return brightness > 0 ? brightness : super.getBrightnessForRender(par1); - } -} diff --git a/archive/java/resonantinduction/old/client/render/ItemPipeRenderer.java b/archive/java/resonantinduction/old/client/render/ItemPipeRenderer.java deleted file mode 100644 index 3f77f95a..00000000 --- a/archive/java/resonantinduction/old/client/render/ItemPipeRenderer.java +++ /dev/null @@ -1,76 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.mechanical.fluid.pipes.FluidPartsMaterial; -import resonantinduction.old.client.model.ModelReleaseValve; -import resonantinduction.old.core.recipe.RecipeLoader; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ItemPipeRenderer implements IItemRenderer -{ - private ModelReleaseValve valve = new ModelReleaseValve(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) - { - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) - { - GL11.glPushMatrix(); - GL11.glRotatef(180f, 0f, 0f, 1f); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderPipe.getTexture(item.getItemDamage())); - int meta = item.getItemDamage(); - if (RecipeLoader.blockReleaseValve != null && item.itemID == RecipeLoader.blockReleaseValve.blockID) - { - meta = FluidPartsMaterial.IRON.getMeta(); - } - if (type == ItemRenderType.ENTITY) - { - GL11.glTranslatef(-.5F, -1F, -.5F); - RenderPipe.render(meta, new boolean[] { false, false, false, false, true, true }); - } - else if (type == ItemRenderType.INVENTORY) - { - GL11.glTranslatef(0F, -1F, 0F); - RenderPipe.render(meta, new boolean[] { false, false, false, false, true, true }); - } - else if (type == ItemRenderType.EQUIPPED) - { - GL11.glTranslatef(-1F, -1.2F, 0.5F); - RenderPipe.render(meta, new boolean[] { false, false, true, true, false, false }); - } - else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) - { - GL11.glTranslatef(-2F, -1.5F, 0.2F); - RenderPipe.render(meta, new boolean[] { false, false, true, true, false, false }); - } - else - { - RenderPipe.render(item.getItemDamage(), new boolean[] { false, false, true, true, false, false }); - } - if (RecipeLoader.blockReleaseValve != null && item.itemID == RecipeLoader.blockReleaseValve.blockID) - { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "ReleaseValve.png")); - valve.render(); - } - GL11.glPopMatrix(); - } -} diff --git a/archive/java/resonantinduction/old/client/render/ItemRenderFluidCan.java b/archive/java/resonantinduction/old/client/render/ItemRenderFluidCan.java deleted file mode 100644 index f488beeb..00000000 --- a/archive/java/resonantinduction/old/client/render/ItemRenderFluidCan.java +++ /dev/null @@ -1,110 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fluids.FluidStack; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.mechanical.fluid.ItemFluidCan; -import resonantinduction.old.client.model.ModelSmallFluidCan; -import resonantinduction.old.core.recipe.RecipeLoader; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ItemRenderFluidCan implements IItemRenderer -{ - public static final ModelSmallFluidCan CAN_MODEL = new ModelSmallFluidCan(); - - public static final ResourceLocation CAN_TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "FluidCanA.png"); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) - { - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) - { - if (RecipeLoader.itemFluidCan != null && item.itemID == RecipeLoader.itemFluidCan.itemID) - { - FluidStack liquid = ((ItemFluidCan) RecipeLoader.itemFluidCan).drain(item, Integer.MAX_VALUE, false); - - if (liquid != null && liquid.amount > 100) - { - - int[] displayList = RenderFluidHelper.getFluidDisplayLists(liquid, Minecraft.getMinecraft().theWorld, false); - - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glScalef(0.4F, 1.5F, 0.4F); - - if (type == ItemRenderType.ENTITY) - { - GL11.glTranslatef(-.5F, 0F, -.5F); - } - else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) - { - GL11.glTranslatef(1.8F, 0.25F, 1.8F); - } - else if (type == ItemRenderType.EQUIPPED) - { - GL11.glTranslatef(0.9F, 0.4F, 1.2F); - } - else - { - GL11.glTranslatef(0.6F, 0F, 0.6F); - } - - FMLClientHandler.instance().getClient().renderEngine.bindTexture((RenderFluidHelper.getFluidSheet(liquid))); - - int cap = ((ItemFluidCan) RecipeLoader.itemFluidCan).getCapacity(item); - if (liquid.getFluid().isGaseous()) - { - cap = liquid.amount; - } - GL11.glCallList(displayList[(int) ((float) liquid.amount / (float) (cap) * (RenderFluidHelper.DISPLAY_STAGES - 1))]); - - GL11.glPopAttrib(); - GL11.glPopMatrix(); - } - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(CAN_TEXTURE); - float scale = 1.8f; - GL11.glScalef(scale, scale, scale); - if (type == ItemRenderType.ENTITY) - { - GL11.glTranslatef(0F, -1F, 0F); - } - else if (type == ItemRenderType.EQUIPPED) - { - GL11.glTranslatef(0.3F, -0.7F, 0.37F); - } - else - { - GL11.glTranslatef(0.5F, -0.8F, 0.5F); - } - CAN_MODEL.render(0.0625F); - GL11.glPopMatrix(); - } - - } -} diff --git a/archive/java/resonantinduction/old/client/render/ItemTankRenderer.java b/archive/java/resonantinduction/old/client/render/ItemTankRenderer.java deleted file mode 100644 index b470d758..00000000 --- a/archive/java/resonantinduction/old/client/render/ItemTankRenderer.java +++ /dev/null @@ -1,124 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.mechanical.fluid.BlockTank; -import resonantinduction.old.client.model.ModelTankSide; -import resonantinduction.old.core.recipe.RecipeLoader; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ItemTankRenderer implements IItemRenderer -{ - private ModelTankSide tank = new ModelTankSide(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) - { - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) - { - if (item.itemID == RecipeLoader.blockTank.blockID) - { - - GL11.glPushMatrix(); - GL11.glScalef(1.0F, 1.0F, 1.0F); - if (type == ItemRenderType.ENTITY) - { - GL11.glTranslatef(0F, 0.2F, 0F); - } - else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) - { - GL11.glTranslatef(0.4F, 0.6F, 0.2F); - } - else if (type == ItemRenderType.EQUIPPED) - { - GL11.glTranslatef(0.1F, 0.4F, 1.2F); - } - else - { - GL11.glTranslatef(0.7F, .4F, 0.7F); - } - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Reference.DOMAIN, item.getItemDamage() == 1 ? "textures/blocks/obsidian.png" : "textures/blocks/iron_block.png")); - GL11.glTranslatef(0.0F, -0.9F, 0.0F); - tank.render(0.0625F, false, false, false, false); - GL11.glRotatef(90f, 0f, 1f, 0f); - tank.render(0.0625F, false, false, false, false); - GL11.glRotatef(90f, 0f, 1f, 0f); - tank.render(0.0625F, false, false, false, false); - GL11.glRotatef(90f, 0f, 1f, 0f); - tank.render(0.0625F, false, false, false, false); - GL11.glPopMatrix(); - - } - - if (item.getTagCompound() != null && item.getTagCompound().hasKey("fluid")) - { - FluidStack liquid = FluidStack.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("fluid")); - - if (liquid != null && liquid.amount > 100) - { - - int[] displayList = RenderFluidHelper.getFluidDisplayLists(liquid, Minecraft.getMinecraft().theWorld, false); - - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - // GL11.glScalef(0.80F, 0.9F, 0.80F); - if (type == ItemRenderType.ENTITY) - { - GL11.glTranslatef(-.5F, -0.2F, -.5F); - } - else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) - { - GL11.glTranslatef(-0.1F, 0.2F, -.3F); - } - else if (type == ItemRenderType.EQUIPPED) - { - GL11.glScalef(0.9F, 0.9F, 0.9F); - GL11.glTranslatef(-0.4F, 0.1F, 0.9F); - } - else - { - GL11.glScalef(0.80F, 0.9F, 0.80F); - GL11.glTranslatef(0.5F, .2F, 0.5F); - } - - FMLClientHandler.instance().getClient().renderEngine.bindTexture((RenderFluidHelper.getFluidSheet(liquid))); - - int cap = BlockTank.tankVolume * FluidContainerRegistry.BUCKET_VOLUME; - if (liquid.getFluid().isGaseous()) - { - cap = liquid.amount; - } - GL11.glCallList(displayList[(int) Math.min(((float) liquid.amount / (float) (cap) * (RenderFluidHelper.DISPLAY_STAGES - 1)), displayList.length - 1)]); - - GL11.glPopAttrib(); - GL11.glPopMatrix(); - } - } - } -} diff --git a/archive/java/resonantinduction/old/client/render/RenderAdvancedHopper.java b/archive/java/resonantinduction/old/client/render/RenderAdvancedHopper.java deleted file mode 100644 index f3b64b65..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderAdvancedHopper.java +++ /dev/null @@ -1,56 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelAdvancedHopper; -import resonantinduction.old.transport.hopper.TileEntityAdvancedHopper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderAdvancedHopper extends RenderImprintable -{ - private static final ModelAdvancedHopper MODEL = new ModelAdvancedHopper(); - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "AdvancedHopper.png"); - - private void renderAModelAt(TileEntityAdvancedHopper tileEntity, double x, double y, double z, float f) - { - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - GL11.glRotatef(180f, 0f, 0f, 1f); - - bindTexture(TEXTURE); - - MODEL.render(0.0625F); - - if (tileEntity.singleConnection) - { - MODEL.render(0.0625F, tileEntity.connection); - } - else - { - for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) - { - if (tileEntity.connections[direction.ordinal()]) - { - MODEL.render(0.0625F, direction); - } - } - } - - GL11.glPopMatrix(); - - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) - { - this.renderAModelAt((TileEntityAdvancedHopper) tileEntity, var2, var4, var6, var8); - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderArmbot.java b/archive/java/resonantinduction/old/client/render/RenderArmbot.java deleted file mode 100644 index 8b9bee7e..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderArmbot.java +++ /dev/null @@ -1,83 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.electrical.armbot.TileEntityArmbot; -import resonantinduction.old.client.model.ModelArmbot; -import universalelectricity.api.vector.Vector3; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderArmbot extends TileEntitySpecialRenderer -{ - public static final ModelArmbot MODEL = new ModelArmbot(); - public static final String TEXTURE = "armbot.png"; - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) - { - if (tileEntity instanceof TileEntityArmbot) - { - String cmdText = ((TileEntityArmbot) tileEntity).getCommandDisplayText(); - if (cmdText != null && !cmdText.isEmpty()) - { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - MovingObjectPosition objectPosition = player.rayTrace(8, 1); - - if (objectPosition != null) - { - if (objectPosition.blockX == tileEntity.xCoord && (objectPosition.blockY == tileEntity.yCoord || objectPosition.blockY == tileEntity.yCoord + 1) && objectPosition.blockZ == tileEntity.zCoord) - { - RenderHelper.renderFloatingText(cmdText, (float) x + 0.5f, ((float) y) + 0.25f, (float) z + 0.5f, 0xFFFFFF); - } - } - } - ResourceLocation name = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + TEXTURE); - bindTexture(name); - - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - - MODEL.render(0.0625f, (float) ((TileEntityArmbot) tileEntity).getRotation().x, (float) ((TileEntityArmbot) tileEntity).getRotation().y); - - GL11.glPopMatrix(); - - Vector3 handPosition = ((TileEntityArmbot) tileEntity).getDeltaHandPosition(); - handPosition.add(0.5); - handPosition.add(new Vector3(x, y, z)); - RenderItem renderItem = ((RenderItem) RenderManager.instance.getEntityClassRenderObject(EntityItem.class)); - TextureManager renderEngine = Minecraft.getMinecraft().renderEngine; - - // Items don't move right, so we render them manually. Client side this can only be one - // object so the bot should return its preferred render item client side - if (((TileEntityArmbot) tileEntity).getHeldObject() instanceof ItemStack) - { - ItemStack itemStack = (ItemStack) ((TileEntityArmbot) tileEntity).getHeldObject(); - if (((TileEntityArmbot) tileEntity).renderEntityItem == null) - { - ((TileEntityArmbot) tileEntity).renderEntityItem = new EntityItem(tileEntity.worldObj, 0, 0, 0, itemStack); - } - else if (!itemStack.isItemEqual(((TileEntityArmbot) tileEntity).renderEntityItem.getEntityItem())) - { - ((TileEntityArmbot) tileEntity).renderEntityItem = new EntityItem(tileEntity.worldObj, 0, 0, 0, itemStack); - } - renderItem.doRenderItem(((TileEntityArmbot) tileEntity).renderEntityItem, handPosition.x, handPosition.y, handPosition.z, 0, f); - } - } - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderBlockEntity.java b/archive/java/resonantinduction/old/client/render/RenderBlockEntity.java deleted file mode 100644 index b03cbc6b..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderBlockEntity.java +++ /dev/null @@ -1,193 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import universalelectricity.api.vector.Vector3; - -public class RenderBlockEntity extends Render -{ - - public static RenderBlockEntity INSTANCE = new RenderBlockEntity(); - - private RenderBlockEntity() - { - } - - @Override - public void doRender(Entity entity, double i, double j, double k, float f, float f1) - { - doRenderBlock((EntityFakeBlock) entity, i, j, k); - } - - public void doRenderBlock(EntityFakeBlock entity, double i, double j, double k) - { - if (entity.isDead) - return; - - shadowSize = entity.shadowSize; - World world = entity.worldObj; - BlockRenderInfo util = new BlockRenderInfo(); - util.texture = entity.texture; - this.bindTexture(TextureMap.locationBlocksTexture); - - for (int iBase = 0; iBase < entity.iSize; ++iBase) - { - for (int jBase = 0; jBase < entity.jSize; ++jBase) - { - for (int kBase = 0; kBase < entity.kSize; ++kBase) - { - - util.min = new Vector3(); - util.max = new Vector3(); - - double remainX = entity.iSize - iBase; - double remainY = entity.jSize - jBase; - double remainZ = entity.kSize - kBase; - - util.max.x = (remainX > 1.0 ? 1.0 : remainX); - util.max.y = (remainY > 1.0 ? 1.0 : remainY); - util.max.z = (remainZ > 1.0 ? 1.0 : remainZ); - - GL11.glPushMatrix(); - GL11.glTranslatef((float) i, (float) j, (float) k); - GL11.glRotatef(entity.rotationX, 1, 0, 0); - GL11.glRotatef(entity.rotationY, 0, 1, 0); - GL11.glRotatef(entity.rotationZ, 0, 0, 1); - GL11.glTranslatef(iBase, jBase, kBase); - - int lightX, lightY, lightZ; - - lightX = (int) (Math.floor(entity.posX) + iBase); - lightY = (int) (Math.floor(entity.posY) + jBase); - lightZ = (int) (Math.floor(entity.posZ) + kBase); - - GL11.glDisable(2896 /* GL_LIGHTING */); - renderBlock(util, world, lightX, lightY, lightZ, false, true); - GL11.glEnable(2896 /* GL_LIGHTING */); - GL11.glPopMatrix(); - - } - } - } - } - - public void renderBlock(BlockRenderInfo block, IBlockAccess blockAccess, int x, int y, int z, boolean doLight, boolean doTessellating) - { - float f = 0.5F; - float f1 = 1.0F; - float f2 = 0.8F; - float f3 = 0.6F; - - renderBlocks.renderMaxX = block.max.x; - renderBlocks.renderMinX = block.min.x; - - renderBlocks.renderMaxY = block.max.y; - renderBlocks.renderMinY = block.min.y; - - renderBlocks.renderMaxZ = block.max.z; - renderBlocks.renderMinZ = block.min.z; - - renderBlocks.enableAO = false; - - Tessellator tessellator = Tessellator.instance; - - if (doTessellating) - { - tessellator.startDrawingQuads(); - } - - float f4 = 0, f5 = 0; - - if (doLight) - { - f4 = block.getBlockBrightness(blockAccess, x, y, z); - f5 = block.getBlockBrightness(blockAccess, x, y, z); - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f * f5, f * f5, f * f5); - } - - renderBlocks.renderFaceYNeg(null, 0, 0, 0, block.getBlockTextureFromSide(0)); - - if (doLight) - { - f5 = block.getBlockBrightness(blockAccess, x, y, z); - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f1 * f5, f1 * f5, f1 * f5); - } - - renderBlocks.renderFaceYPos(null, 0, 0, 0, block.getBlockTextureFromSide(1)); - - if (doLight) - { - f5 = block.getBlockBrightness(blockAccess, x, y, z); - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5); - } - - renderBlocks.renderFaceZNeg(null, 0, 0, 0, block.getBlockTextureFromSide(2)); - - if (doLight) - { - f5 = block.getBlockBrightness(blockAccess, x, y, z); - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5); - } - - renderBlocks.renderFaceZPos(null, 0, 0, 0, block.getBlockTextureFromSide(3)); - - if (doLight) - { - f5 = block.getBlockBrightness(blockAccess, x, y, z); - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5); - } - - renderBlocks.renderFaceXNeg(null, 0, 0, 0, block.getBlockTextureFromSide(4)); - - if (doLight) - { - f5 = block.getBlockBrightness(blockAccess, x, y, z); - if (f5 < f4) - { - f5 = f4; - } - tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5); - } - - renderBlocks.renderFaceXPos(null, 0, 0, 0, block.getBlockTextureFromSide(5)); - - if (doTessellating) - { - tessellator.draw(); - } - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) - { - throw new UnsupportedOperationException("Not supported yet."); - } -} diff --git a/archive/java/resonantinduction/old/client/render/RenderConstructionPump.java b/archive/java/resonantinduction/old/client/render/RenderConstructionPump.java deleted file mode 100644 index 773f2c14..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderConstructionPump.java +++ /dev/null @@ -1,59 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.mechanical.fluid.pump.TileEntityConstructionPump; -import resonantinduction.old.client.model.ModelConstructionPump; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderConstructionPump extends TileEntitySpecialRenderer -{ - int type = 0; - private ModelConstructionPump model; - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "ConstructionPump.png"); - - public RenderConstructionPump() - { - model = new ModelConstructionPump(); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) - { - bindTexture(TEXTURE); - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.45F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); - switch (meta) - { - case 0: - GL11.glRotatef(0f, 0f, 1f, 0f); - break; - case 1: - GL11.glRotatef(90f, 0f, 1f, 0f); - break; - case 2: - GL11.glRotatef(180f, 0f, 1f, 0f); - break; - case 3: - GL11.glRotatef(270f, 0f, 1f, 0f); - break; - } - model.render(0.0625F); - if (tileEntity instanceof TileEntityConstructionPump) - { - // TODO animation life - } - model.renderMotor(0.0625F); - GL11.glPopMatrix(); - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderConveyorBelt.java b/archive/java/resonantinduction/old/client/render/RenderConveyorBelt.java deleted file mode 100644 index 802b5cf8..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderConveyorBelt.java +++ /dev/null @@ -1,134 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.mechanical.belt.TileConveyorBelt; -import resonantinduction.mechanical.belt.TileConveyorBelt.SlantType; -import resonantinduction.old.client.model.ModelAngledBelt; -import resonantinduction.old.client.model.ModelConveyorBelt; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderConveyorBelt extends TileEntitySpecialRenderer -{ - public static final ModelConveyorBelt MODEL = new ModelConveyorBelt(); - public static final ModelAngledBelt MODEL2 = new ModelAngledBelt(); - - @Override - public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) - { - TileConveyorBelt tileEntity = (TileConveyorBelt) t; - SlantType slantType = tileEntity.getSlant(); - int face = tileEntity.getDirection().ordinal(); - - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - GL11.glRotatef(180f, 0f, 0f, 1f); - - int frame = tileEntity.getAnimationFrame(); - - if (slantType != null && slantType != SlantType.NONE) - { - switch (face) - { - case 2: - GL11.glRotatef(180f, 0f, 1f, 0f); - break; - case 3: - GL11.glRotatef(0f, 0f, 1f, 0f); - break; - case 4: - GL11.glRotatef(90f, 0f, 1f, 0f); - break; - case 5: - GL11.glRotatef(-90f, 0f, 1f, 0f); - break; - } - - if (slantType == SlantType.UP) - { - ResourceLocation name = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "slantedbelt/frame" + frame + ".png"); - bindTexture(name); - - GL11.glTranslatef(0f, 0.8f, -0.8f); - GL11.glRotatef(180f, 0f, 1f, 1f); - boolean slantAdjust = false; - TileEntity test = tileEntity.worldObj.getBlockTileEntity(tileEntity.xCoord + tileEntity.getDirection().offsetX, tileEntity.yCoord, tileEntity.zCoord + tileEntity.getDirection().offsetZ); - if (test != null) - { - if (test instanceof TileConveyorBelt) - { - if (((TileConveyorBelt) test).getSlant() == SlantType.TOP) - { - GL11.glRotatef(10f, 1f, 0f, 0f); - slantAdjust = true; - } - } - } - MODEL2.render(0.0625F, true); - } - else if (slantType == SlantType.DOWN) - { - ResourceLocation name = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "slantedbelt/frame" + frame + ".png"); - bindTexture(name); - GL11.glRotatef(180f, 0f, 1f, 0f); - boolean slantAdjust = false; - TileEntity test = tileEntity.worldObj.getBlockTileEntity(tileEntity.xCoord - tileEntity.getDirection().offsetX, tileEntity.yCoord, tileEntity.zCoord - tileEntity.getDirection().offsetZ); - if (test != null) - { - if (test instanceof TileConveyorBelt) - { - if (((TileConveyorBelt) test).getSlant() == SlantType.TOP) - { - GL11.glRotatef(-10f, 1f, 0f, 0f); - GL11.glTranslatef(0f, 0.25f, 0f); - slantAdjust = true; - } - } - } - MODEL2.render(0.0625F, slantAdjust); - } - else - { - ResourceLocation name = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "belt/frame" + frame + ".png"); - bindTexture(name); - GL11.glRotatef(180, 0f, 1f, 0f); - GL11.glTranslatef(0f, -0.68f, 0f); - MODEL.render(0.0625f, (float) Math.toRadians(tileEntity.wheelRotation), false, false, false, false); - } - } - else - { - switch (face) - { - case 2: - GL11.glRotatef(0f, 0f, 1f, 0f); - break; - case 3: - GL11.glRotatef(180f, 0f, 1f, 0f); - break; - case 4: - GL11.glRotatef(-90f, 0f, 1f, 0f); - break; - case 5: - GL11.glRotatef(90f, 0f, 1f, 0f); - break; - } - ResourceLocation name = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "belt/frame" + frame + ".png"); - bindTexture(name); - MODEL.render(0.0625F, (float) Math.toRadians(tileEntity.wheelRotation), false, false, false, true); - - } - - int ent = tileEntity.worldObj.getBlockId(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); - - GL11.glPopMatrix(); - - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderCrate.java b/archive/java/resonantinduction/old/client/render/RenderCrate.java deleted file mode 100644 index 596aa7ed..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderCrate.java +++ /dev/null @@ -1,199 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.client.ForgeHooksClient; -import net.minecraftforge.common.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.old.transport.crate.TileEntityCrate; -import universalelectricity.api.vector.Vector3; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderCrate extends TileEntitySpecialRenderer -{ - private final RenderBlocks renderBlocks = new RenderBlocks(); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8) - { - Vector3 vec = new Vector3(x, y, z); - double distance = vec.distance(new Vector3(0, 0, 0)); - if (tileEntity instanceof TileEntityCrate) - { - - TileEntityCrate tileCrate = (TileEntityCrate) tileEntity; - - RenderItem renderItem = ((RenderItem) RenderManager.instance.getEntityClassRenderObject(EntityItem.class)); - - String itemName = "Empty"; - String amount = ""; - ItemStack itemStack = tileCrate.getSampleStack(); - - if (itemStack != null) - { - itemName = itemStack.getDisplayName(); - amount = Integer.toString(itemStack.stackSize); - } - - for (int side = 2; side < 6; side++) - { - ForgeDirection direction = ForgeDirection.getOrientation(side); - if (tileCrate.worldObj.isBlockSolidOnSide(tileCrate.xCoord + direction.offsetX, tileCrate.yCoord, tileCrate.zCoord + direction.offsetZ, direction.getOpposite())) - { - continue; - } - this.setupLight(tileCrate, direction.offsetX, direction.offsetZ); - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); - - if (itemStack != null) - { - GL11.glPushMatrix(); - - switch (side) - { - case 2: - GL11.glTranslated(x + 0.65, y + 0.9, z - 0.01); - break; - case 3: - GL11.glTranslated(x + 0.35, y + 0.9, z + 1.01); - GL11.glRotatef(180, 0, 1, 0); - break; - case 4: - GL11.glTranslated(x - 0.01, y + 0.9, z + 0.35); - GL11.glRotatef(90, 0, 1, 0); - break; - case 5: - GL11.glTranslated(x + 1.01, y + 0.9, z + 0.65); - GL11.glRotatef(-90, 0, 1, 0); - break; - } - - float scale = 0.03125F; - GL11.glScalef(0.6f * scale, 0.6f * scale, 0); - GL11.glRotatef(180, 0, 0, 1); - - TextureManager renderEngine = Minecraft.getMinecraft().renderEngine; - - GL11.glDisable(2896); - if (!ForgeHooksClient.renderInventoryItem(this.renderBlocks, renderEngine, itemStack, true, 0.0F, 0.0F, 0.0F)) - { - renderItem.renderItemIntoGUI(this.getFontRenderer(), renderEngine, itemStack, 0, 0); - } - GL11.glEnable(2896); - - GL11.glPopMatrix(); - } - - this.renderText(itemName, side, 0.02f, x, y - 0.35f, z); - this.renderText(amount, side, 0.02f, x, y - 0.15f, z); - } - } - } - - private void setupLight(TileEntity tileEntity, int xDifference, int zDifference) - { - World world = tileEntity.worldObj; - - if (world.isBlockOpaqueCube(tileEntity.xCoord + xDifference, tileEntity.yCoord, tileEntity.zCoord + zDifference)) - { - return; - } - - int br = world.getLightBrightnessForSkyBlocks(tileEntity.xCoord + xDifference, tileEntity.yCoord, tileEntity.zCoord + zDifference, 0); - int var11 = br % 65536; - int var12 = br / 65536; - float scale = 0.6F; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, var11 * scale, var12 * scale); - } - - private void renderText(String text, int side, float maxScale, double x, double y, double z) - { - GL11.glPushMatrix(); - - GL11.glPolygonOffset(-10, -10); - GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); - - float displayWidth = 1 - (2 / 16); - float displayHeight = 1 - (2 / 16); - GL11.glTranslated(x, y, z); - - switch (side) - { - case 3: - GL11.glTranslatef(0, 1, 0); - GL11.glRotatef(0, 0, 1, 0); - GL11.glRotatef(90, 1, 0, 0); - - break; - case 2: - GL11.glTranslatef(1, 1, 1); - GL11.glRotatef(180, 0, 1, 0); - GL11.glRotatef(90, 1, 0, 0); - - break; - case 5: - GL11.glTranslatef(0, 1, 1); - GL11.glRotatef(90, 0, 1, 0); - GL11.glRotatef(90, 1, 0, 0); - - break; - case 4: - GL11.glTranslatef(1, 1, 0); - GL11.glRotatef(-90, 0, 1, 0); - GL11.glRotatef(90, 1, 0, 0); - break; - } - - // Find Center - GL11.glTranslatef(displayWidth / 2, 1F, displayHeight / 2); - GL11.glRotatef(-90, 1, 0, 0); - - FontRenderer fontRenderer = this.getFontRenderer(); - - int requiredWidth = Math.max(fontRenderer.getStringWidth(text), 1); - int lineHeight = fontRenderer.FONT_HEIGHT + 2; - int requiredHeight = lineHeight * 1; - float scaler = 0.8f; - float scaleX = (displayWidth / requiredWidth); - float scaleY = (displayHeight / requiredHeight); - float scale = scaleX * scaler; - - if (maxScale > 0) - { - scale = Math.min(scale, maxScale); - } - - GL11.glScalef(scale, -scale, scale); - GL11.glDepthMask(false); - - int offsetX; - int offsetY; - int realHeight = (int) Math.floor(displayHeight / scale); - int realWidth = (int) Math.floor(displayWidth / scale); - - offsetX = (realWidth - requiredWidth) / 2; - offsetY = (realHeight - requiredHeight) / 2; - - GL11.glDisable(GL11.GL_LIGHTING); - fontRenderer.drawString("\u00a7f" + text, offsetX - (realWidth / 2), 1 + offsetY - (realHeight / 2), 1); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthMask(true); - GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL); - - GL11.glPopMatrix(); - } -} diff --git a/archive/java/resonantinduction/old/client/render/RenderDetector.java b/archive/java/resonantinduction/old/client/render/RenderDetector.java deleted file mode 100644 index d72127d0..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderDetector.java +++ /dev/null @@ -1,56 +0,0 @@ -package resonantinduction.old.client.render; - -import static org.lwjgl.opengl.GL11.glPopMatrix; -import static org.lwjgl.opengl.GL11.glPushMatrix; -import static org.lwjgl.opengl.GL11.glTranslated; -import static resonantinduction.old.client.model.ModelHelper.drawCuboid; -import static resonantinduction.old.client.model.ModelHelper.setGlobalTextureResolution; -import static resonantinduction.old.client.model.ModelHelper.setTextureClip; -import static resonantinduction.old.client.model.ModelHelper.setTextureSubResolution; -import net.minecraft.tileentity.TileEntity; -import resonantinduction.old.client.model.ModelHelper; -import universalelectricity.api.vector.Vector3; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderDetector extends RenderImprintable -{ - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8) - { - super.renderTileEntityAt(tileEntity, x, y, z, var8); - } - - public static void render(boolean isInverted, Vector3 position) - { - glPushMatrix(); - glTranslated(position.x, position.y, position.z); - - if (isInverted) - { - // ForgeHooksClient.bindTexture(AssemblyLine.BLOCK_TEXTURES_PATH + "detector_red.png", - // 0); - } - else - { - // ForgeHooksClient.bindTexture(AssemblyLine.BLOCK_TEXTURES_PATH + "detector_green.png", - // 0); - - } - - setGlobalTextureResolution(128, 128); - setTextureClip(false); - ModelHelper.setTextureOffset(0, 64); - setTextureSubResolution(64, 64); - drawCuboid(0.45f, 12f / 16f, 0.45f, 2f / 16f, 4f / 16f, 2f / 16f); // stand - ModelHelper.setTextureOffset(0, 0); - setTextureSubResolution(128, 64); - drawCuboid(0.25f, 0.25f, 0.25f, 8f / 16f, 8f / 16f, 8f / 16f); // block - ModelHelper.setTextureOffset(64, 64); - setTextureSubResolution(64, 32); - drawCuboid(0.375f, 0.25f - (1f / 16f), 0.375f, 4f / 16f, 1f / 16f, 4f / 16f); // lens - - glPopMatrix(); - } -} diff --git a/archive/java/resonantinduction/old/client/render/RenderFluidHelper.java b/archive/java/resonantinduction/old/client/render/RenderFluidHelper.java deleted file mode 100644 index 3904fc43..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderFluidHelper.java +++ /dev/null @@ -1,125 +0,0 @@ -package resonantinduction.old.client.render; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GLAllocation; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.Icon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -import org.lwjgl.opengl.GL11; - -public class RenderFluidHelper -{ - - private static final ResourceLocation BLOCK_TEXTURE = TextureMap.locationBlocksTexture; - - private static Map flowingRenderCache = new HashMap(); - private static Map stillRenderCache = new HashMap(); - - public static final int DISPLAY_STAGES = 100; - - private static final BlockRenderInfo liquidBlock = new BlockRenderInfo(); - - public static ResourceLocation getFluidSheet(FluidStack liquid) - { - return BLOCK_TEXTURE; - } - - public static Icon getFluidTexture(Fluid fluid, boolean flowing) - { - if (fluid == null) - { - return null; - } - Icon icon = flowing ? fluid.getFlowingIcon() : fluid.getStillIcon(); - if (icon == null) - { - icon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); - } - return icon; - } - - public static void setColorForFluidStack(FluidStack fluidstack) - { - if (fluidstack == null) - { - return; - } - - int color = fluidstack.getFluid().getColor(fluidstack); - float red = (color >> 16 & 255) / 255.0F; - float green = (color >> 8 & 255) / 255.0F; - float blue = (color & 255) / 255.0F; - GL11.glColor4f(red, green, blue, 1); - } - - public static int[] getFluidDisplayLists(FluidStack fluidStack, World world, boolean flowing) - { - if (fluidStack == null) - { - return null; - } - Fluid fluid = fluidStack.getFluid(); - if (fluid == null) - { - return null; - } - Map cache = flowing ? flowingRenderCache : stillRenderCache; - int[] diplayLists = cache.get(fluid); - if (diplayLists != null) - { - return diplayLists; - } - - diplayLists = new int[DISPLAY_STAGES]; - - if (fluid.getBlockID() > 0) - { - liquidBlock.baseBlock = Block.blocksList[fluid.getBlockID()]; - liquidBlock.texture = getFluidTexture(fluidStack.getFluid(), flowing); - } - else - { - liquidBlock.baseBlock = Block.waterStill; - liquidBlock.texture = getFluidTexture(fluidStack.getFluid(), flowing); - } - - cache.put(fluid, diplayLists); - - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_CULL_FACE); - - for (int s = 0; s < DISPLAY_STAGES; ++s) - { - diplayLists[s] = GLAllocation.generateDisplayLists(1); - GL11.glNewList(diplayLists[s], 4864 /* GL_COMPILE */); - - liquidBlock.min.x = 0.01f; - liquidBlock.min.y = 0; - liquidBlock.min.z = 0.01f; - - liquidBlock.max.x = 0.99f; - liquidBlock.max.y = (float) s / (float) DISPLAY_STAGES; - liquidBlock.max.z = 0.99f; - - RenderBlockEntity.INSTANCE.renderBlock(liquidBlock, world, 0, 0, 0, false, true); - - GL11.glEndList(); - } - - GL11.glColor4f(1, 1, 1, 1); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - - return diplayLists; - } -} diff --git a/archive/java/resonantinduction/old/client/render/RenderFrackingPipe.java b/archive/java/resonantinduction/old/client/render/RenderFrackingPipe.java deleted file mode 100644 index c897457e..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderFrackingPipe.java +++ /dev/null @@ -1,31 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelFrackingPipe; - -/** @author Archadia */ -public class RenderFrackingPipe extends TileEntitySpecialRenderer -{ - - public static final ModelFrackingPipe model = new ModelFrackingPipe(); - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "frackingpipe.png"); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) - { - bindTexture(TEXTURE); - - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - - model.renderAll(); - GL11.glPopMatrix(); // end - } -} diff --git a/archive/java/resonantinduction/old/client/render/RenderFurnace.java b/archive/java/resonantinduction/old/client/render/RenderFurnace.java deleted file mode 100644 index 180af429..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderFurnace.java +++ /dev/null @@ -1,52 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelFurnace; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderFurnace extends TileEntitySpecialRenderer -{ - int type = 0; - private ModelFurnace model; - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "Furnace.png"); - - public RenderFurnace() - { - model = new ModelFurnace(); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) - { - bindTexture(TEXTURE); - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); - switch (meta) - { - case 0: - GL11.glRotatef(0f, 0f, 1f, 0f); - break; - case 1: - GL11.glRotatef(90f, 0f, 1f, 0f); - break; - case 2: - GL11.glRotatef(180f, 0f, 1f, 0f); - break; - case 3: - GL11.glRotatef(270f, 0f, 1f, 0f); - break; - } - model.genRender(0.0625F); - GL11.glPopMatrix(); - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderGearPiston.java b/archive/java/resonantinduction/old/client/render/RenderGearPiston.java deleted file mode 100644 index b0cdc082..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderGearPiston.java +++ /dev/null @@ -1,59 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelGearPiston; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderGearPiston extends TileEntitySpecialRenderer -{ - private ModelGearPiston model; - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "GearShaftPiston.png"); - - public RenderGearPiston() - { - model = new ModelGearPiston(); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) - { - bindTexture(TEXTURE); - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); - - switch (meta) - { - case 1: - GL11.glRotatef(0f, 0f, 1f, 0f); - break; - case 2: - GL11.glRotatef(90f, 0f, 1f, 0f); - break; - case 3: - GL11.glRotatef(180f, 0f, 1f, 0f); - break; - case 0: - GL11.glRotatef(270f, 0f, 1f, 0f); - break; - } - model.renderGear(0.0625F); - model.renderR(0.0625F, 0);// TODO fix - model.renderBody(0.0625F); - model.renderBack(0.0625F); - model.renderFront(0.0625F); - model.renderLeft(0.0625F); - model.renderRight(0.0625F); - GL11.glPopMatrix(); - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderGearRod.java b/archive/java/resonantinduction/old/client/render/RenderGearRod.java deleted file mode 100644 index 56f8a14e..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderGearRod.java +++ /dev/null @@ -1,73 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.old.client.model.ModelGearRod; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderGearRod extends TileEntitySpecialRenderer -{ - private ModelGearRod model; - - public RenderGearRod() - { - model = new ModelGearRod(); - } - - public void renderAModelAt(TileEntity tileEntity, double d, double d1, double d2, float f) - { - // bindTextureByName(FluidMech.MODEL_TEXTURE_DIRECTORY + "mechanical/GearRod.png"); - GL11.glPushMatrix(); - - int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); - if (meta == 0) - { - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 0.5F, (float) d2 + 1.5F); - } - else if (meta == 1) - { - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 0.5F, (float) d2 - 0.5F); - } - else - { - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - } - GL11.glScalef(1.0F, -1F, -1F); - switch (meta) - { - case 0: - GL11.glRotatef(90f, 1f, 0f, 0f); - break; - case 1: - GL11.glRotatef(-90f, 1f, 0f, 0f); - break; - case 2: - GL11.glRotatef(0f, 0f, 1f, 0f); - break; - case 5: - GL11.glRotatef(90f, 0f, 1f, 0f); - break; - case 3: - GL11.glRotatef(180f, 0f, 1f, 0f); - break; - case 4: - GL11.glRotatef(270f, 0f, 1f, 0f); - break; - } - model.render(0.0625F, 0); - GL11.glPopMatrix(); - - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) - { - this.renderAModelAt(tileEntity, var2, var4, var6, var8); - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderGenerator.java b/archive/java/resonantinduction/old/client/render/RenderGenerator.java deleted file mode 100644 index b7bcaabc..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderGenerator.java +++ /dev/null @@ -1,50 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.old.client.model.ModelGenerator; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderGenerator extends TileEntitySpecialRenderer -{ - int type = 0; - private ModelGenerator model; - - public RenderGenerator() - { - model = new ModelGenerator(); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float d3) - { - // bindTextureByName(FluidMech.MODEL_TEXTURE_DIRECTORY + "mechanical/Generator.png"); - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.45F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); - switch (meta) - { - case 0: - GL11.glRotatef(0f, 0f, 1f, 0f); - break; - case 1: - GL11.glRotatef(90f, 0f, 1f, 0f); - break; - case 2: - GL11.glRotatef(180f, 0f, 1f, 0f); - break; - case 3: - GL11.glRotatef(270f, 0f, 1f, 0f); - break; - } - model.render(tileEntity); - GL11.glPopMatrix(); - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderHelper.java b/archive/java/resonantinduction/old/client/render/RenderHelper.java deleted file mode 100644 index aa448d1a..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderHelper.java +++ /dev/null @@ -1,64 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** @author Briman0094 */ -@SideOnly(Side.CLIENT) -public class RenderHelper -{ - public static void renderFloatingText(String text, float x, float y, float z) - { - renderFloatingText(text, x, y, z, 0xFFFFFF); - } - - /** Renders a floating text in a specific position. */ - public static void renderFloatingText(String text, float x, float y, float z, int color) - { - RenderManager renderManager = RenderManager.instance; - FontRenderer fontRenderer = renderManager.getFontRenderer(); - float scale = 0.027f; - GL11.glColor4f(1f, 1f, 1f, 0.5f); - GL11.glPushMatrix(); - GL11.glTranslatef(x + 0.0F, y + 2.3F, z); - GL11.glNormal3f(0.0F, 1.0F, 0.0F); - GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - GL11.glScalef(-scale, -scale, scale); - GL11.glDisable(GL11.GL_LIGHTING); - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); - GL11.glDepthMask(false); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - Tessellator tessellator = Tessellator.instance; - int yOffset = 0; - - GL11.glDisable(GL11.GL_TEXTURE_2D); - tessellator.startDrawingQuads(); - int stringMiddle = fontRenderer.getStringWidth(text) / 2; - tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.5F); - tessellator.addVertex((-stringMiddle - 1), (-1 + yOffset), 0.0D); - tessellator.addVertex((-stringMiddle - 1), (8 + yOffset), 0.0D); - tessellator.addVertex((stringMiddle + 1), (8 + yOffset), 0.0D); - tessellator.addVertex((stringMiddle + 1), (-1 + yOffset), 0.0D); - tessellator.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glColor4f(1f, 1f, 1f, 0.5f); - fontRenderer.drawString(text, -fontRenderer.getStringWidth(text) / 2, yOffset, color); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glDepthMask(true); - fontRenderer.drawString(text, -fontRenderer.getStringWidth(text) / 2, yOffset, color); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - } -} diff --git a/archive/java/resonantinduction/old/client/render/RenderImprintable.java b/archive/java/resonantinduction/old/client/render/RenderImprintable.java deleted file mode 100644 index d2bc5332..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderImprintable.java +++ /dev/null @@ -1,59 +0,0 @@ -package resonantinduction.old.client.render; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import resonantinduction.core.prefab.tile.TileEntityFilterable; -import resonantinduction.old.transport.imprinter.ItemImprinter; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** @author Briman0094 */ -@SideOnly(Side.CLIENT) -public abstract class RenderImprintable extends TileEntitySpecialRenderer -{ - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8) - { - if (tileEntity != null) - { - if (tileEntity instanceof TileEntityFilterable) - { - TileEntityFilterable tileFilterable = (TileEntityFilterable) tileEntity; - - ItemStack filter = tileFilterable.getFilter(); - - if (filter != null) - { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - MovingObjectPosition objectPosition = player.rayTrace(8, 1); - - if (objectPosition != null) - { - if (objectPosition.blockX == tileFilterable.xCoord && objectPosition.blockY == tileFilterable.yCoord && objectPosition.blockZ == tileFilterable.zCoord) - { - ArrayList filters = ItemImprinter.getFilters(filter); - for (int i = 0; i < filters.size(); i++) - { - if (((TileEntityFilterable) tileEntity).isInverted()) - { - RenderHelper.renderFloatingText(filters.get(i).getTooltip(player, Minecraft.getMinecraft().gameSettings.advancedItemTooltips).get(0).toString(), (float) x + 0.5f, ((float) y + (i * 0.25f)) - 1f, (float) z + 0.5f, 0xFF8888); - } - else - { - RenderHelper.renderFloatingText(filters.get(i).getTooltip(player, Minecraft.getMinecraft().gameSettings.advancedItemTooltips).get(0).toString(), (float) x + 0.5f, ((float) y + (i * 0.25f)) - 1f, (float) z + 0.5f, 0x88FF88); - } - } - } - } - } - } - } - } - -} diff --git a/archive/java/resonantinduction/old/client/render/RenderManipulator.java b/archive/java/resonantinduction/old/client/render/RenderManipulator.java deleted file mode 100644 index 3acd7605..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderManipulator.java +++ /dev/null @@ -1,68 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelManipulator; -import resonantinduction.old.transport.logistic.TileEntityManipulator; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderManipulator extends RenderImprintable -{ - private ModelManipulator model = new ModelManipulator(); - - private void renderAModelAt(TileEntityManipulator tileEntity, double x, double y, double z, float f) - { - int face = tileEntity.getDirection().ordinal(); - - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - GL11.glRotatef(180f, 0f, 0f, 1f); - - if (tileEntity.isOutput()) - { - ResourceLocation name = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "manipulator1.png"); - bindTexture(name); - } - else - { - ResourceLocation name = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "manipulator2.png"); - bindTexture(name); - } - - if (face == 2) - { - GL11.glRotatef(0f, 0f, 1f, 0f); - } - else if (face == 3) - { - GL11.glRotatef(180f, 0f, 1f, 0f); - } - else if (face == 4) - { - GL11.glRotatef(270f, 0f, 1f, 0f); - } - else if (face == 5) - { - GL11.glRotatef(90f, 0f, 1f, 0f); - } - - model.render(0.0625F, true, 0); - - GL11.glPopMatrix(); - - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) - { - this.renderAModelAt((TileEntityManipulator) tileEntity, var2, var4, var6, var8); - super.renderTileEntityAt(tileEntity, var2, var4, var6, var8); - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderMiningLaserGun.java b/archive/java/resonantinduction/old/client/render/RenderMiningLaserGun.java deleted file mode 100644 index a87d0c1c..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderMiningLaserGun.java +++ /dev/null @@ -1,84 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelMiningLaserGun; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderMiningLaserGun implements IItemRenderer -{ - - private static final ModelMiningLaserGun MODEL = new ModelMiningLaserGun(); - private static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "LaserGun.png"); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) - { - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - - if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) - { - float scale = 3f; - - if (Minecraft.getMinecraft().thePlayer.getItemInUse() != item) - { - GL11.glScalef(scale, scale, scale); - GL11.glTranslatef(0, 1.5f, .5f); - GL11.glRotatef(180, 0, 0, 1); - GL11.glRotatef(30, 0, 1, 0); - GL11.glRotatef(10, 1, 0, 0); - } - else - { - scale = 8f; - GL11.glScalef(scale, scale, scale); - GL11.glTranslatef(-.01f, 1.0f, .8f); - GL11.glRotatef(180, 0, 0, 1); - GL11.glRotatef(40, 0, 1, 0); - GL11.glRotatef(-20, 1, 0, 0); - } - } - else if (type == ItemRenderType.EQUIPPED) - { - float scale = 3f; - GL11.glScalef(scale, scale, scale); - GL11.glRotatef(-105, 0, 0, 1); - GL11.glRotatef(-70, 0, 1, 0); - GL11.glTranslatef(0.3f, -0.9f, 0.42f); - } - else if (type == ItemRenderType.INVENTORY) - { - float scale = 2f; - GL11.glScalef(scale, scale, scale); - GL11.glRotatef(180, 0, 0, 1); - GL11.glRotatef(-70, 0, 1, 0); - GL11.glTranslatef(-0.07f, -1.2f, 0.52f); - } - MODEL.render(0.0625F); - - GL11.glPopMatrix(); - } -} diff --git a/archive/java/resonantinduction/old/client/render/RenderPipe.java b/archive/java/resonantinduction/old/client/render/RenderPipe.java deleted file mode 100644 index 8b55ce23..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderPipe.java +++ /dev/null @@ -1,204 +0,0 @@ -package resonantinduction.old.client.render; - -import java.util.HashMap; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.mechanical.fluid.pipes.EnumPipeType; -import resonantinduction.mechanical.fluid.pipes.FluidPartsMaterial; -import resonantinduction.mechanical.fluid.pipes.TileEntityPipe; -import resonantinduction.old.client.model.ModelLargePipe; -import resonantinduction.old.client.model.ModelOpenTrough; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderPipe extends TileEntitySpecialRenderer -{ - public static ModelLargePipe MODEL_PIPE = new ModelLargePipe(); - public static ModelOpenTrough MODEL_TROUGH_PIPE = new ModelOpenTrough(); - private static HashMap, ResourceLocation> TEXTURES = new HashMap, ResourceLocation>(); - public static ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "pipes/Pipe.png"); - - @Override - public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float f) - { - // Texture file - - FluidPartsMaterial mat = FluidPartsMaterial.IRON; - if (te.getBlockMetadata() < FluidPartsMaterial.values().length) - { - mat = FluidPartsMaterial.values()[te.getBlockMetadata()]; - } - if (te instanceof TileEntityPipe) - { - boolean[] sides = ((TileEntityPipe) te).renderConnection; - if (mat == FluidPartsMaterial.WOOD || mat == FluidPartsMaterial.STONE) - { - FluidStack liquid = ((TileEntityPipe) te).getTank().getFluid(); - int cap = ((TileEntityPipe) te).getTankInfo()[0].capacity; - // FluidStack liquid = new FluidStack(FluidRegistry.WATER, cap); - if (liquid != null && liquid.amount > 100) - { - float per = Math.max(1, (float) liquid.amount / (float) (cap)); - int[] displayList = RenderFluidHelper.getFluidDisplayLists(liquid, te.worldObj, false); - bindTexture(RenderFluidHelper.getFluidSheet(liquid)); - - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glTranslatef((float) d + 0.3F, (float) d1 + 0.1F, (float) d2 + 0.3F); - GL11.glScalef(0.4F, 0.4F, 0.4F); - - GL11.glCallList(displayList[(int) (per * (RenderFluidHelper.DISPLAY_STAGES - 1))]); - - GL11.glPopAttrib(); - GL11.glPopMatrix(); - if (sides[4]) - { - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glTranslatef((float) d + 0F, (float) d1 + 0.1F, (float) d2 + 0.3F); - GL11.glScalef(0.3F, 0.4F, 0.4F); - - GL11.glCallList(displayList[(int) (per * (RenderFluidHelper.DISPLAY_STAGES - 1))]); - - GL11.glPopAttrib(); - GL11.glPopMatrix(); - } - if (sides[5]) - { - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glTranslatef((float) d + 0.7F, (float) d1 + 0.1F, (float) d2 + 0.3F); - GL11.glScalef(0.3F, 0.4F, 0.4F); - - GL11.glCallList(displayList[(int) (per * (RenderFluidHelper.DISPLAY_STAGES - 1))]); - - GL11.glPopAttrib(); - GL11.glPopMatrix(); - } - - if (sides[2]) - { - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glTranslatef((float) d + 0.3F, (float) d1 + 0.1F, (float) d2 + 0F); - GL11.glScalef(0.4F, 0.4F, 0.3F); - - GL11.glCallList(displayList[(int) (per * (RenderFluidHelper.DISPLAY_STAGES - 1))]); - - GL11.glPopAttrib(); - GL11.glPopMatrix(); - } - if (sides[3]) - { - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - GL11.glTranslatef((float) d + 0.3F, (float) d1 + 0.1F, (float) d2 + 0.7F); - GL11.glScalef(0.4F, 0.4F, 0.3F); - - GL11.glCallList(displayList[(int) (per * (RenderFluidHelper.DISPLAY_STAGES - 1))]); - - GL11.glPopAttrib(); - GL11.glPopMatrix(); - } - } - } - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - bindTexture(RenderPipe.getTexture(mat, 0)); - RenderPipe.render(mat, ((TileEntityPipe) te).getSubID(), sides); - GL11.glPopMatrix(); - } - else - { - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - RenderPipe.render(mat, 0, new boolean[6]); - GL11.glPopMatrix(); - } - - } - - public static ResourceLocation getTexture(FluidPartsMaterial mat, int pipeID) - { - if (mat != null) - { - Pair index = new Pair(mat, pipeID); - if (!TEXTURES.containsKey(index)) - { - String pipeName = ""; - if (EnumPipeType.get(pipeID) != null) - { - pipeName = EnumPipeType.get(pipeID).getName(pipeID); - } - TEXTURES.put(index, new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "pipes/" + mat.matName + "/" + pipeName + "Pipe.png")); - } - return TEXTURES.get(index); - } - return TEXTURE; - } - - public static ResourceLocation getTexture(int meta) - { - return getTexture(FluidPartsMaterial.getFromItemMeta(meta), FluidPartsMaterial.getType(meta)); - } - - public static void render(FluidPartsMaterial mat, int pipeID, boolean[] side) - { - if (mat == FluidPartsMaterial.WOOD) - { - MODEL_TROUGH_PIPE.render(side, false); - } - else if (mat == FluidPartsMaterial.STONE) - { - MODEL_TROUGH_PIPE.render(side, true); - } - else - { - MODEL_PIPE.render(side); - } - } - - public static void render(int meta, boolean[] bs) - { - render(FluidPartsMaterial.getFromItemMeta(meta), FluidPartsMaterial.getType(meta), bs); - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderProcessor.java b/archive/java/resonantinduction/old/client/render/RenderProcessor.java deleted file mode 100644 index aba8e6fd..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderProcessor.java +++ /dev/null @@ -1,99 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelCrusher; -import resonantinduction.old.client.model.ModelGrinder; -import resonantinduction.old.mechanics.processor.TileEntityProcessor; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderProcessor extends TileEntitySpecialRenderer -{ - private ModelCrusher crusherModel; - private ModelGrinder grinderModel; - - public RenderProcessor() - { - this.crusherModel = new ModelCrusher(); - this.grinderModel = new ModelGrinder(); - } - - private void renderAModelAt(TileEntityProcessor tileEntity, double x, double y, double z, float f) - { - bindTexture(this.getTexture(tileEntity.getBlockType().blockID, tileEntity.getBlockMetadata())); - - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - - if (tileEntity.getDirection() == ForgeDirection.NORTH) - { - GL11.glRotatef(180f, 0f, 1f, 0f); - } - else if (tileEntity.getDirection() == ForgeDirection.SOUTH) - { - GL11.glRotatef(0f, 0f, 1f, 0f); - } - else if (tileEntity.getDirection() == ForgeDirection.WEST) - { - GL11.glRotatef(90f, 0f, 1f, 0f); - } - else if (tileEntity.getDirection() == ForgeDirection.EAST) - { - GL11.glRotatef(270f, 0f, 1f, 0f); - } - - int g = tileEntity.blockMetadata / 4; - if (g == 0) - { - crusherModel.renderBody(0.0625F); - crusherModel.renderPiston(0.0625F, tileEntity.renderStage); - } - else if (g == 1) - { - grinderModel.renderBody(0.0625F); - grinderModel.renderRotation(0.0625F, tileEntity.renderStage); - } - else if (g == 2) - { - - } - else if (g == 3) - { - - } - - GL11.glPopMatrix(); - } - - public ResourceLocation getTexture(int block, int meta) - { - int g = meta / 4; - if (g == 0) - { - return new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "CrusherBlock.png"); - } - else if (g == 1) - { - return new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "GrinderBlock.png"); - } - return null; - - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) - { - if (tileEntity instanceof TileEntityProcessor) - this.renderAModelAt((TileEntityProcessor) tileEntity, var2, var4, var6, var8); - - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderPump.java b/archive/java/resonantinduction/old/client/render/RenderPump.java deleted file mode 100644 index df751a20..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderPump.java +++ /dev/null @@ -1,60 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.mechanical.fluid.pump.TileEntityStarterPump; -import resonantinduction.old.client.model.ModelPump; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderPump extends TileEntitySpecialRenderer -{ - int type = 0; - private ModelPump model; - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "pumps/WaterPump.png"); - - public RenderPump() - { - model = new ModelPump(); - } - - @Override - public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float f) - { - int meta = te.worldObj.getBlockMetadata(te.xCoord, te.yCoord, te.zCoord); - - bindTexture(TEXTURE); - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - switch (meta) - { - case 2: - GL11.glRotatef(0f, 0f, 1f, 0f); - break; - case 3: - GL11.glRotatef(90f, 0f, 1f, 0f); - break; - case 0: - GL11.glRotatef(180f, 0f, 1f, 0f); - break; - case 1: - GL11.glRotatef(270f, 0f, 1f, 0f); - break; - } - model.render(0.0625F); - if (te instanceof TileEntityStarterPump) - { - model.renderMotion(0.0625F, ((TileEntityStarterPump) te).rotation); - } - GL11.glPopMatrix(); - - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderRejector.java b/archive/java/resonantinduction/old/client/render/RenderRejector.java deleted file mode 100644 index ae26eb57..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderRejector.java +++ /dev/null @@ -1,62 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelRejectorPiston; -import resonantinduction.old.transport.logistic.TileEntityRejector; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderRejector extends RenderImprintable -{ - private ModelRejectorPiston model = new ModelRejectorPiston(); - - private void renderAModelAt(TileEntityRejector tileEntity, double x, double y, double z, float f) - { - boolean fire = tileEntity.firePiston; - int face = tileEntity.getDirection().ordinal(); - int pos = 0; - - if (fire) - { - pos = 8; - } - ResourceLocation name = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "rejector.png"); - bindTexture(name); - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - if (face == 2) - { - GL11.glRotatef(180f, 0f, 1f, 0f); - } - if (face == 3) - { - GL11.glRotatef(0f, 0f, 1f, 0f); - } - else if (face == 4) - { - GL11.glRotatef(90f, 0f, 1f, 0f); - } - else if (face == 5) - { - GL11.glRotatef(270f, 0f, 1f, 0f); - } - model.render(0.0625F); - model.renderPiston(0.0625F, pos); - GL11.glPopMatrix(); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) - { - this.renderAModelAt((TileEntityRejector) tileEntity, var2, var4, var6, var8); - super.renderTileEntityAt(tileEntity, var2, var4, var6, var8); - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderReleaseValve.java b/archive/java/resonantinduction/old/client/render/RenderReleaseValve.java deleted file mode 100644 index 2aa77029..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderReleaseValve.java +++ /dev/null @@ -1,62 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.mechanical.fluid.TileEntityReleaseValve; -import resonantinduction.old.client.model.ModelLargePipe; -import resonantinduction.old.client.model.ModelReleaseValve; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderReleaseValve extends TileEntitySpecialRenderer -{ - private ModelLargePipe SixPipe; - private ModelReleaseValve valve; - private TileEntity[] ents = new TileEntity[6]; - - public static final ResourceLocation VALVE_TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "ReleaseValve.png"); - - public RenderReleaseValve() - { - SixPipe = new ModelLargePipe(); - valve = new ModelReleaseValve(); - } - - @Override - public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float f) - { - // Texture file - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - if (te instanceof TileEntityReleaseValve) - { - ents = ((TileEntityReleaseValve) te).connected; - } - bindTexture(RenderPipe.TEXTURE); - if (ents[0] != null) - SixPipe.renderBottom(); - if (ents[1] != null) - SixPipe.renderTop(); - if (ents[3] != null) - SixPipe.renderFront(); - if (ents[2] != null) - SixPipe.renderBack(); - if (ents[5] != null) - SixPipe.renderRight(); - if (ents[4] != null) - SixPipe.renderLeft(); - SixPipe.renderMiddle(); - bindTexture(VALVE_TEXTURE); - if (ents[1] == null) - valve.render(); - GL11.glPopMatrix(); - - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderSink.java b/archive/java/resonantinduction/old/client/render/RenderSink.java deleted file mode 100644 index f0eb1425..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderSink.java +++ /dev/null @@ -1,57 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelSink; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderSink extends TileEntitySpecialRenderer -{ - int type = 0; - private ModelSink model; - - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "Sink.png"); - - public RenderSink() - { - model = new ModelSink(); - } - - @Override - public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float f) - { - int meta = te.worldObj.getBlockMetadata(te.xCoord, te.yCoord, te.zCoord); - - bindTexture(TEXTURE); - GL11.glPushMatrix(); - GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - switch (meta) - { - case 3: - GL11.glRotatef(90f, 0f, 1f, 0f); - break; - case 0: - GL11.glRotatef(180f, 0f, 1f, 0f); - break; - case 1: - GL11.glRotatef(270f, 0f, 1f, 0f); - break; - case 2: - GL11.glRotatef(0f, 0f, 1f, 0f); - break; - } - model.render(0.0625F); - // TODO render fluid using fluid renderer - GL11.glPopMatrix(); - - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderSteamGen.java b/archive/java/resonantinduction/old/client/render/RenderSteamGen.java deleted file mode 100644 index 92577f50..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderSteamGen.java +++ /dev/null @@ -1,114 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.core.prefab.tile.TileEntityMachine; -import resonantinduction.old.client.model.ModelMachine; -import resonantinduction.old.client.model.ModelSteamGen; -import resonantinduction.old.client.model.ModelSteamTurbine; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderSteamGen extends TileEntitySpecialRenderer -{ - public static final ModelSteamTurbine TURBINE_MODEL = new ModelSteamTurbine(); - public static final ModelSteamGen STEAM_GEN_MODEL = new ModelSteamGen(); - - public static final ResourceLocation TURBINE_TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "SmallSteamFan.png"); - public static final ResourceLocation STEAM_GEN_TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "SteamGenerator.png"); - private static float rot1 = 0; - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float size) - { - int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); - int face = meta % 4; - ModelMachine model = getModel(meta); - - if (model != null) - { - bindTexture(RenderSteamGen.getTexture(meta)); - rot1 = MathHelper.wrapAngleTo180_float(rot1 + 1); - - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - - if (face == 0) - { - GL11.glRotatef(180f, 0f, 1f, 0f); - } - if (face == 2) - { - GL11.glRotatef(0f, 0f, 1f, 0f); - } - else if (face == 3) - { - GL11.glRotatef(90f, 0f, 1f, 0f); - } - else if (face == 1) - { - GL11.glRotatef(270f, 0f, 1f, 0f); - } - - model.render(0.0625F); - - if (tileEntity instanceof TileEntityMachine) - { - if (model instanceof ModelSteamTurbine) - { - if (((TileEntityMachine) tileEntity).isFunctioning()) - { - GL11.glRotatef(RenderSteamGen.rot1, 0f, 1f, 0f); - } - ((ModelSteamTurbine) model).renderFan(0.0625F); - } - } - - GL11.glPopMatrix(); - } - - } - - public static ModelMachine getModel(int meta) - { - switch (meta / 4) - { - - case 0: - return TURBINE_MODEL; - case 1: - return TURBINE_MODEL; - case 2: - return STEAM_GEN_MODEL; - case 3: - return STEAM_GEN_MODEL; - } - return null; - } - - public static ResourceLocation getTexture(int meta) - { - switch (meta / 4) - { - - case 0: - return TURBINE_TEXTURE; - case 1: - return TURBINE_TEXTURE; - case 2: - return STEAM_GEN_TEXTURE; - case 3: - return STEAM_GEN_TEXTURE; - } - return null; - } - -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderTank.java b/archive/java/resonantinduction/old/client/render/RenderTank.java deleted file mode 100644 index 956a8f61..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderTank.java +++ /dev/null @@ -1,126 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.mechanical.fluid.TileEntityTank; -import resonantinduction.old.client.model.ModelTankSide; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.helpers.ColorCode; - -@SideOnly(Side.CLIENT) -public class RenderTank extends TileEntitySpecialRenderer -{ - private ModelTankSide model; - - // TODO https://www.opengl.org/sdk/docs/man/xhtml/glDepthMask.xml <- fix z fighting - public RenderTank() - { - model = new ModelTankSide(); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8) - { - FluidStack liquid = tileEntity instanceof TileEntityTank ? ((TileEntityTank) tileEntity).getTankInfo()[0].fluid : null; - this.renderTank(tileEntity, x, y, z, 0, liquid); - } - - public void renderTank(TileEntity tileEntity, double x, double y, double z, int meta, FluidStack liquid) - { - boolean[] render = new boolean[6]; - if (tileEntity instanceof TileEntityTank) - { - render = ((TileEntityTank) tileEntity).renderConnection; - } - if (liquid != null && liquid.amount > 100) - { - - int[] displayList = RenderFluidHelper.getFluidDisplayLists(liquid, tileEntity.worldObj, false); - - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - bindTexture(RenderFluidHelper.getFluidSheet(liquid)); - - GL11.glTranslatef((float) x, (float) y, (float) z); - GL11.glScalef(1.01F, 1.01F, 1.01F); - int cap = tileEntity instanceof TileEntityTank ? ((TileEntityTank) tileEntity).getTankInfo()[0].capacity : liquid.amount; - GL11.glCallList(displayList[(int) ((float) liquid.amount / (float) (cap) * (RenderFluidHelper.DISPLAY_STAGES - 1))]); - - GL11.glPopAttrib(); - GL11.glPopMatrix(); - } - - boolean bot = render[1]; - boolean top = render[0]; - boolean north = render[2]; - boolean south = render[3]; - boolean east = render[5]; - boolean west = render[4]; - for (int i = 0; i < 4; i++) - { - ForgeDirection dir = ForgeDirection.getOrientation(i + 2); - if (!render[dir.getOpposite().ordinal()]) - { - GL11.glPushMatrix(); - - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - GL11.glScalef(1.0F, -1F, -1F); - boolean left = false; - boolean right = false; - switch (dir) - { - case NORTH: - GL11.glRotatef(180f, 0f, 1f, 0f); - left = west; - right = east; - break; - case SOUTH: - GL11.glRotatef(0f, 0f, 1f, 0f); - left = east; - right = west; - break; - case WEST: - GL11.glRotatef(90f, 0f, 1f, 0f); - left = south; - right = north; - break; - case EAST: - GL11.glRotatef(270f, 0f, 1f, 0f); - left = north; - right = south; - break; - } - bindTexture(this.getTexture(tileEntity.getBlockType().blockID, tileEntity.getBlockMetadata())); - model.render(0.0625F, left, right, top, bot); - GL11.glPopMatrix(); - } - } - - } - - public ResourceLocation getTexture(int block, int meta) - { - String texture = ""; - if (ColorCode.get(meta) == ColorCode.RED) - { - texture = "textures/blocks/obsidian.png"; - } - else - { - texture = "textures/blocks/iron_block.png"; - } - return new ResourceLocation(texture); - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/client/render/RenderTestCar.java b/archive/java/resonantinduction/old/client/render/RenderTestCar.java deleted file mode 100644 index ba77b302..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderTestCar.java +++ /dev/null @@ -1,67 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelTestCar; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderTestCar extends Render -{ - private static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "TestCar.png"); - - /** instance of ModelBoat for rendering */ - protected ModelBase modelBoat; - - public RenderTestCar() - { - this.shadowSize = 0.0F; - this.modelBoat = new ModelTestCar(); - } - - @Override - public void doRender(Entity entity, double rx, double ry, double rz, float rYaw, float rPitch) - { - - GL11.glPushMatrix(); - GL11.glTranslatef((float) rx, (float) ry + 1.2f, (float) rz); - GL11.glRotatef(180.0F - rYaw, 0.0F, 1.0F, 0.0F); - if (entity instanceof EntityAdvanced) - { - float f2 = ((EntityAdvanced) entity).getTimeSinceHit() - rPitch; - float f3 = ((EntityAdvanced) entity).getHealth() - rPitch; - - if (f3 < 0.0F) - { - f3 = 0.0F; - } - - if (f2 > 0.0F) - { - GL11.glRotatef(MathHelper.sin(f2) * f2 * f3 / 10.0F * ((EntityAdvanced) entity).getForwardDirection(), 1.0F, 0.0F, 0.0F); - } - } - - float f4 = 0.75F; - GL11.glScalef(f4, f4, f4); - GL11.glScalef(1.0F / f4, 1.0F / f4, 1.0F / f4); - this.bindEntityTexture(entity); - GL11.glScalef(-1.0F, -1.0F, 1.0F); - this.modelBoat.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); - } - - @Override - protected ResourceLocation getEntityTexture(Entity par1Entity) - { - return TEXTURE; - } -} diff --git a/archive/java/resonantinduction/old/client/render/RenderTurkey.java b/archive/java/resonantinduction/old/client/render/RenderTurkey.java deleted file mode 100644 index 39c535a0..00000000 --- a/archive/java/resonantinduction/old/client/render/RenderTurkey.java +++ /dev/null @@ -1,83 +0,0 @@ -package resonantinduction.old.client.render; - -import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import resonantinduction.core.Reference; -import resonantinduction.old.client.model.ModelTurkey; -import resonantinduction.old.core.misc.EntityTurkey; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderTurkey extends RenderLiving -{ - private static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "Turkey.png"); - - public RenderTurkey() - { - super(new ModelTurkey(), 0.3f); - } - - public void renderChicken(EntityTurkey par1EntityChicken, double par2, double par4, double par6, float par8, float par9) - { - super.doRenderLiving(par1EntityChicken, par2, par4, par6, par8, par9); - } - - protected ResourceLocation getChickenTextures(EntityTurkey par1EntityChicken) - { - return TEXTURE; - } - - protected float getWingRotation(EntityTurkey par1EntityChicken, float par2) - { - float f1 = par1EntityChicken.field_70888_h + (par1EntityChicken.field_70886_e - par1EntityChicken.field_70888_h) * par2; - float f2 = par1EntityChicken.field_70884_g + (par1EntityChicken.destPos - par1EntityChicken.field_70884_g) * par2; - return (MathHelper.sin(f1) + 1.0F) * f2; - } - - @Override - public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) - { - this.renderChicken((EntityTurkey) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** Defines what float the third param in setRotationAngles of ModelBase is */ - @Override - protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2) - { - return this.getWingRotation((EntityTurkey) par1EntityLivingBase, par2); - } - - @Override - public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) - { - this.renderChicken((EntityTurkey) par1EntityLivingBase, par2, par4, par6, par8, par9); - } - - /** - * Returns the location of an entity's texture. Doesn't seem to be called unless you call - * Render.bindEntityTexture. - */ - @Override - protected ResourceLocation getEntityTexture(Entity par1Entity) - { - return this.getChickenTextures((EntityTurkey) par1Entity); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down - * its argument and then handing it off to a worker function which does the actual work. In all - * probabilty, the class Render is generic (Render 1.0F) - { - this.destPos = 1.0F; - } - - if (!this.onGround && this.field_70889_i < 1.0F) - { - this.field_70889_i = 1.0F; - } - - this.field_70889_i = (float) (this.field_70889_i * 0.9D); - - if (!this.onGround && this.motionY < 0.0D) - { - this.motionY *= 0.6D; - } - - this.field_70886_e += this.field_70889_i * 2.0F; - - if (!this.isChild() && !this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) - { - this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - this.dropItem(Item.egg.itemID, 1); - this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; - } - } - - /** Called when the mob is falling. Calculates and applies fall damage. */ - @Override - protected void fall(float par1) - { - } - - /** Returns the sound this mob makes while it's alive. */ - @Override - protected String getLivingSound() - { - return "mob.chicken.say"; - } - - /** Returns the sound this mob makes when it is hurt. */ - @Override - protected String getHurtSound() - { - return "mob.chicken.hurt"; - } - - /** Returns the sound this mob makes on death. */ - @Override - protected String getDeathSound() - { - return "mob.chicken.hurt"; - } - - /** Plays step sound at given x, y, z for the entity */ - @Override - protected void playStepSound(int par1, int par2, int par3, int par4) - { - this.playSound("mob.chicken.step", 0.15F, 1.0F); - } - - /** Returns the item ID for the item the mob drops on death. */ - @Override - protected int getDropItemId() - { - return Item.feather.itemID; - } - - /** - * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit - * by a player. @param par2 - Level of Looting used to kill this mob. - */ - @Override - protected void dropFewItems(boolean par1, int par2) - { - int j = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); - - for (int k = 0; k < j; ++k) - { - this.dropItem(Item.feather.itemID, 1); - } - - if (this.isBurning()) - { - this.dropItem(Item.chickenCooked.itemID, 1); - } - else - { - this.dropItem(Item.chickenRaw.itemID, 1); - } - } - - /** - * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots - * or seeds depending on the animal type) - */ - @Override - public boolean isBreedingItem(ItemStack par1ItemStack) - { - return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds; - } - - @Override - public EntityAgeable createChild(EntityAgeable par1EntityAgeable) - { - return new EntityTurkey(this.worldObj); - } - -} diff --git a/archive/java/resonantinduction/old/core/misc/EnumBird.java b/archive/java/resonantinduction/old/core/misc/EnumBird.java deleted file mode 100644 index 067c715e..00000000 --- a/archive/java/resonantinduction/old/core/misc/EnumBird.java +++ /dev/null @@ -1,106 +0,0 @@ -package resonantinduction.old.core.misc; - -import java.awt.Color; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.passive.EntityChicken; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import resonantinduction.old.transport.ResonantInductionTransport; -import cpw.mods.fml.common.registry.EntityRegistry; - -/** - * Enum of different birds that can be spawned by an egg or in the world threw normal spawning - * - * @author DarkGuardsman - */ -public enum EnumBird -{ - - VANILLA_CHICKEN("", new SpawnEntity() - { - @Override - public void register() - { - // Vanilla chicken is already registered - } - - @Override - public Entity getNew(World world) - { - return new EntityChicken(world); - } - - }), TURKEY("Turkey", new SpawnEntity() - { - @Override - public void register() - { - EntityRegistry.registerGlobalEntityID(EntityTurkey.class, "FTTurkey", EntityRegistry.findGlobalUniqueEntityId(), 5651507, Color.red.getRGB()); - EntityRegistry.registerModEntity(EntityTurkey.class, "FTTurkey", ResonantInductionTransport.entitiesIds++, ResonantInductionTransport.instance, 64, 1, true); - EntityRegistry.addSpawn(EntityTurkey.class, 3, 1, 10, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.river); - } - - @Override - public Entity getNew(World world) - { - return new EntityTurkey(world); - } - }); - - private SpawnEntity entity; - private String name; - - private EnumBird(String name, SpawnEntity entity) - { - this.entity = entity; - this.name = name; - } - - public Entity getNewEntity(World world) - { - return this.entity.getNew(world); - } - - public void register() - { - this.entity.register(); - } - - public static Entity getNewEntity(World world, int id) - { - if (get(id) != null) - { - return get(id).getNewEntity(world); - } - return null; - } - - public static EnumBird get(int id) - { - if (id >= 0 && id < EnumBird.values().length) - { - return EnumBird.values()[id]; - } - return null; - } - - public String getName() - { - return this.name; - } - - /** - * Quick interface to allow each enum to define how the entity is created without using - * reflection - */ - public static interface SpawnEntity - { - /** Anything that needs registered including spawning and event calls */ - public void register(); - - /** Return a new entity for this enum instance */ - public Entity getNew(World world); - } -} diff --git a/archive/java/resonantinduction/old/core/misc/EnumTool.java b/archive/java/resonantinduction/old/core/misc/EnumTool.java deleted file mode 100644 index 9d2e2823..00000000 --- a/archive/java/resonantinduction/old/core/misc/EnumTool.java +++ /dev/null @@ -1,124 +0,0 @@ -package resonantinduction.old.core.misc; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.material.Material; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import resonantinduction.old.core.recipe.RecipeLoader; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.EnumMaterial; - -/** - * Enum to store tools that can be created from the material sheet. - * - * @author DarkGuardsman - */ -public enum EnumTool -{ - PICKAX("pickaxe", Material.rock, Material.iron, Material.ice, Material.anvil, Material.glass, Material.tnt, Material.piston), - AX("axe", Material.wood, Material.pumpkin, Material.plants, Material.vine), - SPADE("shovel", Material.sand, Material.snow, Material.clay, Material.craftedSnow, Material.grass, Material.ground), - HOE("hoe", Material.plants, Material.pumpkin), - SHEAR("shear", Material.cloth, Material.circuits, Material.web), - SWORD("sword", false, Material.web, Material.vine, Material.coral, Material.pumpkin, Material.leaves, Material.plants), - NA6(), NA7(), NA8(), NA9(); - - public final List effecticVsMaterials = new ArrayList(); - public String name = "tool"; - public boolean enabled = false; - public static final int toolCountPerMaterial = 10; - - @SideOnly(Side.CLIENT) - public Icon[] toolIcons; - - private EnumTool() - { - - } - - private EnumTool(String name, boolean enabled, Material... mats) - { - this.name = name; - this.enabled = true; - this.setEffectiveList(mats); - } - - private EnumTool(String name, Material... mats) - { - this(name, true, mats); - } - - public void setEffectiveList(Material... blocks) - { - for (Material block : blocks) - { - this.addEffectiveBlock(block); - } - } - - public void addEffectiveBlock(Material block) - { - if (block != null) - { - this.effecticVsMaterials.add(block); - } - } - - public static String getFullName(int meta) - { - EnumMaterial mat = getToolMatFromMeta(meta); - EnumTool tool = getToolFromMeta(meta); - if (mat != null && tool != null) - { - return mat.simpleName + tool.name; - } - return "CommonTool[" + meta + "]"; - } - - public static ItemStack getTool(EnumTool tool, EnumMaterial mat) - { - return tool.getTool(mat); - } - - public ItemStack getTool(EnumMaterial mat) - { - ItemStack stack = null; - if (RecipeLoader.itemDiggingTool instanceof ItemCommonTool) - { - stack = new ItemStack(RecipeLoader.itemDiggingTool.itemID, 1, (mat.ordinal() * toolCountPerMaterial) + this.ordinal()); - } - return stack; - } - - public static EnumTool getToolFromMeta(int meta) - { - return EnumTool.values()[meta % toolCountPerMaterial]; - } - - public static EnumMaterial getToolMatFromMeta(int meta) - { - return EnumMaterial.values()[meta / toolCountPerMaterial]; - } - - public static Icon getToolIcon(int metadata) - { - if (metadata < EnumMaterial.values().length) - { - int mat = getToolMatFromMeta(metadata).ordinal(); - int tool = getToolFromMeta(metadata).ordinal(); - if (EnumTool.values()[tool].toolIcons == null) - { - EnumTool.values()[tool].toolIcons = new Icon[EnumMaterial.values().length]; - } - if (tool < EnumTool.values()[tool].toolIcons.length) - { - return EnumTool.values()[tool].toolIcons[mat]; - } - } - return null; - } - -} diff --git a/archive/java/resonantinduction/old/core/misc/ItemColoredDust.java b/archive/java/resonantinduction/old/core/misc/ItemColoredDust.java deleted file mode 100644 index 086ccb2b..00000000 --- a/archive/java/resonantinduction/old/core/misc/ItemColoredDust.java +++ /dev/null @@ -1,71 +0,0 @@ -package resonantinduction.old.core.misc; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import resonantinduction.core.Reference; -import resonantinduction.core.Settings; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.helpers.ColorCode; - -public class ItemColoredDust extends Item -{ - @SideOnly(Side.CLIENT) - private Icon theIcon; - - public ItemColoredDust() - { - super(Settings.CONFIGURATION.getItem("GlowingRefinedSand", Settings.getNextItemID()).getInt()); - this.setMaxDamage(0); - this.setHasSubtypes(true); - this.setCreativeTab(CreativeTabs.tabMaterials); - } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) - { - return ColorCode.get(par1ItemStack.getItemDamage() % 16).color.getRGB(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() - { - return true; - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister par1IconRegister) - { - this.itemIcon = par1IconRegister.registerIcon(Reference.PREFIX + "dust"); - this.theIcon = par1IconRegister.registerIcon("glowingPowder_overlay"); - } - - @Override - public int getMetadata(int meta) - { - return meta; - } - - @Override - public final String getUnlocalizedName(ItemStack par1ItemStack) - { - return this.getUnlocalizedName() + "." + ColorCode.get(par1ItemStack.getItemDamage()).name; - } - - @Override - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (int i = 0; i < ColorCode.values().length - 1; i++) - { - par3List.add(new ItemStack(par1, 1, i)); - } - } -} diff --git a/archive/java/resonantinduction/old/core/misc/ItemCommonTool.java b/archive/java/resonantinduction/old/core/misc/ItemCommonTool.java deleted file mode 100644 index ac28a89f..00000000 --- a/archive/java/resonantinduction/old/core/misc/ItemCommonTool.java +++ /dev/null @@ -1,541 +0,0 @@ -package resonantinduction.old.core.misc; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.enchantment.EnchantmentDurability; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.stats.StatList; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.common.IShearable; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.Event.Result; -import net.minecraftforge.event.entity.player.UseHoeEvent; -import net.minecraftforge.oredict.OreDictionary; -import resonantinduction.core.Reference; -import resonantinduction.core.Settings; - -import com.google.common.collect.Multimap; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.EnumMaterial; -import dark.lib.IExtraInfo.IExtraItemInfo; - -/** - * Flexible tool class that uses NBT to store damage and effect rather than metadata. Metadata - * instead is used to store sub items allowing several different tools to exist within the same item - * - * @author DarkGuardsman - */ -public class ItemCommonTool extends Item implements IExtraItemInfo -{ - protected int enchant = 5; - public static final String TOOL_DAMAGE = "toolDamage"; - public static final String BROKEN_NBT = "broken"; - public static final String REINFORCED_NBT = "reinforced"; - public static final String HEATTREATED_NBT = "heattreated"; - public static final String HANDLE_NBT = "handle"; - - public ItemCommonTool() - { - super(Settings.CONFIGURATION.getItem("Items", "CommonTools", Settings.getNextItemID()).getInt()); - this.maxStackSize = 1; - this.setCreativeTab(CreativeTabs.tabTools); - } - - @Override - public void onCreated(ItemStack itemStack, World world, EntityPlayer entityPlayer) - { - if (itemStack.stackTagCompound == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - itemStack.getTagCompound().setString("Creator", (entityPlayer != null ? entityPlayer.username : "Magical Dwarfs")); - itemStack.getTagCompound().setInteger("ToolID", itemStack.getItemDamage()); - } - - @Override - public Multimap getItemAttributeModifiers() - { - Multimap multimap = super.getItemAttributeModifiers(); - multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", 6, 0)); - return multimap; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) - { - if (itemStack != null) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - if (itemStack.getTagCompound().hasKey("Creator")) - { - list.add("Created by " + itemStack.getTagCompound().getString("Creator")); - } - if (itemStack.getTagCompound().getBoolean(BROKEN_NBT)) - { - list.add("Blunted"); - } - else - { - EnumMaterial mat = EnumTool.getToolMatFromMeta(itemStack.getItemDamage()); - int currentDamage = itemStack.getTagCompound().getInteger(TOOL_DAMAGE); - list.add("D: " + currentDamage + "/" + mat.maxUses); - } - } - } - - @SideOnly(Side.CLIENT) - @Override - public int getColorFromItemStack(ItemStack itemStack, int par2) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - if (itemStack.getTagCompound().getBoolean(BROKEN_NBT)) - { - return Color.RED.getRGB(); - } - return super.getColorFromItemStack(itemStack, par2); - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - if (itemStack.getTagCompound().getBoolean(BROKEN_NBT)) - { - return false; - } - if (EnumTool.getToolFromMeta(itemStack.getItemDamage()) == EnumTool.HOE) - { - if (!player.canPlayerEdit(x, y, z, par7, itemStack)) - { - return false; - } - else - { - UseHoeEvent event = new UseHoeEvent(player, itemStack, world, x, y, z); - if (MinecraftForge.EVENT_BUS.post(event)) - { - return false; - } - - if (event.getResult() == Result.ALLOW) - { - this.damage(itemStack, 1, player); - return true; - } - - int blockID = world.getBlockId(x, y, z); - boolean air = world.isAirBlock(x, y + 1, z); - - if (par7 != 0 && air && (blockID == Block.grass.blockID || blockID == Block.dirt.blockID)) - { - Block block = Block.tilledField; - world.playSoundEffect((x + 0.5F), (y + 0.5F), (z + 0.5F), block.stepSound.getStepSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); - - if (world.isRemote) - { - return true; - } - else - { - world.setBlock(x, y, z, block.blockID); - this.damage(itemStack, 1, player); - return true; - } - } - } - } - return false; - } - - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) - { - if (EnumTool.getToolFromMeta(par1ItemStack.getItemDamage()) == EnumTool.SWORD) - { - return EnumAction.block; - } - return super.getItemUseAction(par1ItemStack); - } - - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) - { - if (EnumTool.getToolFromMeta(par1ItemStack.getItemDamage()) == EnumTool.SWORD) - { - return 72000; - } - return super.getMaxItemUseDuration(par1ItemStack); - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) - { - if (EnumTool.getToolFromMeta(par1ItemStack.getItemDamage()) == EnumTool.SWORD) - { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - } - return par1ItemStack; - } - - @Override - public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) - { - if (entity.worldObj.isRemote) - { - return false; - } - if (entity instanceof IShearable && EnumTool.getToolFromMeta(itemstack.getItemDamage()) == EnumTool.SHEAR) - { - IShearable target = (IShearable) entity; - if (target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) - { - ArrayList drops = target.onSheared(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); - - Random rand = new Random(); - for (ItemStack stack : drops) - { - EntityItem ent = entity.entityDropItem(stack, 1.0F); - ent.motionY += rand.nextFloat() * 0.05F; - ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F; - ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F; - } - this.damage(itemstack, 1, entity); - } - return true; - } - return false; - } - - @Override - public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) - { - if (player.worldObj.isRemote) - { - return false; - } - int id = player.worldObj.getBlockId(x, y, z); - if (Block.blocksList[id] instanceof IShearable && EnumTool.getToolFromMeta(itemstack.getItemDamage()) == EnumTool.SHEAR) - { - IShearable target = (IShearable) Block.blocksList[id]; - if (target.isShearable(itemstack, player.worldObj, x, y, z)) - { - ArrayList drops = target.onSheared(itemstack, player.worldObj, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); - Random rand = new Random(); - - for (ItemStack stack : drops) - { - float f = 0.7F; - double d = (rand.nextFloat() * f) + (1.0F - f) * 0.5D; - double d1 = (rand.nextFloat() * f) + (1.0F - f) * 0.5D; - double d2 = (rand.nextFloat() * f) + (1.0F - f) * 0.5D; - EntityItem entityitem = new EntityItem(player.worldObj, x + d, y + d1, z + d2, stack); - entityitem.delayBeforeCanPickup = 10; - player.worldObj.spawnEntityInWorld(entityitem); - } - - itemstack.damageItem(1, player); - player.addStat(StatList.mineBlockStatArray[id], 1); - } - } - return false; - } - - /** Applies damage to the item using NBT as well uses the normal ItemStack damage checks */ - public void damage(ItemStack itemStack, int damage, EntityLivingBase entity) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - EnumMaterial mat = EnumTool.getToolMatFromMeta(itemStack.getItemDamage()); - if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode) - { - return; - } - if (damage > 0) - { - int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, itemStack); - int k = 0; - - for (int l = 0; j > 0 && l < damage; ++l) - { - if (EnchantmentDurability.negateDamage(itemStack, j, entity.worldObj.rand)) - { - ++k; - } - } - - damage -= k; - - if (damage <= 0) - { - return; - } - } - int currentDamage = itemStack.getTagCompound().getInteger(TOOL_DAMAGE) + damage; - damage = Math.max(Math.min(damage, mat.maxUses), 0); - itemStack.getTagCompound().setInteger(TOOL_DAMAGE, currentDamage); - if (entity instanceof EntityPlayer) - { - ((EntityPlayer) entity).inventory.onInventoryChanged(); - } - if (currentDamage > mat.maxUses) - { - entity.renderBrokenItemStack(itemStack); - itemStack.getTagCompound().setBoolean(BROKEN_NBT, true); - if (entity instanceof EntityPlayer) - { - EntityPlayer entityplayer = (EntityPlayer) entity; - entityplayer.addStat(StatList.objectBreakStats[this.itemID], 1); - } - } - - } - - @Override - public boolean isDamaged(ItemStack itemStack) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - if (itemStack.getTagCompound().getBoolean(BROKEN_NBT)) - { - return true; - } - return itemStack.getTagCompound().getInteger(TOOL_DAMAGE) > 0; - } - - @Override - public boolean hitEntity(ItemStack itemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) - { - this.damage(itemStack, EnumTool.getToolFromMeta(itemStack.getItemDamage()) == EnumTool.SWORD ? 1 : 2, par2EntityLivingBase); - return true; - } - - @Override - public boolean onBlockDestroyed(ItemStack itemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) - { - if (EnumTool.getToolFromMeta(itemStack.getItemDamage()) == EnumTool.SHEAR && par3 != Block.leaves.blockID && par3 != Block.web.blockID && par3 != Block.tallGrass.blockID && par3 != Block.vine.blockID && par3 != Block.tripWire.blockID && !(Block.blocksList[par3] instanceof IShearable)) - { - return false; - } - if (Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D) - { - this.damage(itemStack, EnumTool.getToolFromMeta(itemStack.getItemDamage()) == EnumTool.SWORD ? 2 : 1, par7EntityLivingBase); - } - - return true; - } - - @Override - public int getItemEnchantability() - { - return this.enchant; - } - - @SideOnly(Side.CLIENT) - @Override - public boolean isFull3D() - { - return true; - } - - @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) - { - // TODO,, We will have to check on how this is done to prevent issues with the way damage is - // actually saved - return false; - } - - @Override - public float getStrVsBlock(ItemStack itemStack, Block block) - { - if (itemStack != null && block != null) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - if (itemStack.getTagCompound().getBoolean(BROKEN_NBT)) - { - return 0; - } - EnumTool tool = EnumTool.getToolFromMeta(itemStack.getItemDamage()); - EnumMaterial mat = EnumTool.getToolMatFromMeta(itemStack.getItemDamage()); - if (tool.effecticVsMaterials.contains(block.blockMaterial)) - { - return mat.materialEffectiveness + (tool == EnumTool.SHEAR && block.blockMaterial == Material.leaves ? 9f : 0f); - } - return 1.0F; - } - return 0; - - } - - @Override - public boolean canHarvestBlock(Block par1Block) - { - return true; - } - - @Override - public boolean canHarvestBlock(Block block, ItemStack itemStack) - { - if (itemStack != null && block != null) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - if (itemStack.getTagCompound().getBoolean(BROKEN_NBT)) - { - return false; - } - EnumTool tool = EnumTool.getToolFromMeta(itemStack.getItemDamage()); - EnumMaterial mat = EnumTool.getToolMatFromMeta(itemStack.getItemDamage()); - if (tool.effecticVsMaterials.contains(block.blockMaterial)) - { - return true; - } - } - return false; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) - { - if (itemStack != null) - { - return "item." + Reference.PREFIX + EnumTool.getFullName(itemStack.getItemDamage()); - } - else - { - return this.getUnlocalizedName(); - } - } - - @Override - public int getDisplayDamage(ItemStack itemStack) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - int damage = itemStack.getTagCompound().getInteger(TOOL_DAMAGE); - EnumMaterial mat = EnumTool.getToolMatFromMeta(itemStack.getItemDamage()); - return (damage / mat.maxUses) * 100; - } - - @Override - public Icon getIconFromDamage(int i) - { - return EnumTool.getToolIcon(i); - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister iconRegister) - { - for (EnumTool tool : EnumTool.values()) - { - for (EnumMaterial mat : EnumMaterial.values()) - { - if (mat.hasTools) - { - tool.toolIcons = new Icon[EnumMaterial.values().length]; - - if (tool.enabled) - { - tool.toolIcons[mat.ordinal()] = iconRegister.registerIcon(Reference.PREFIX + "tool." + mat.simpleName + tool.name); - } - } - } - } - } - - @Override - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (EnumMaterial mat : EnumMaterial.values()) - { - if (mat.hasTools) - { - for (EnumTool tool : EnumTool.values()) - { - ItemStack stack = tool.getTool(mat); - if (tool.enabled && stack != null) - { - this.onCreated(stack, null, null); - par3List.add(stack); - } - } - } - } - } - - @Override - public boolean hasExtraConfigs() - { - // TODO Add configs such as enable broken tools, and allow tools to be salvaged - return false; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - // TODO Auto-generated method stub - - } - - @Override - public void loadOreNames() - { - for (EnumMaterial mat : EnumMaterial.values()) - { - if (mat.hasTools) - { - for (EnumTool tool : EnumTool.values()) - { - ItemStack stack = tool.getTool(mat); - if (tool.enabled && stack != null) - { - OreDictionary.registerOre(EnumTool.getFullName(stack.getItemDamage()), stack); - } - } - } - } - - } -} diff --git a/archive/java/resonantinduction/old/core/misc/ItemFarmEgg.java b/archive/java/resonantinduction/old/core/misc/ItemFarmEgg.java deleted file mode 100644 index 591c1e67..00000000 --- a/archive/java/resonantinduction/old/core/misc/ItemFarmEgg.java +++ /dev/null @@ -1,42 +0,0 @@ -package resonantinduction.old.core.misc; - -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; - -public class ItemFarmEgg extends Item -{ - public ItemFarmEgg(int par1) - { - super(par1); - this.maxStackSize = 16; - this.setCreativeTab(CreativeTabs.tabMaterials); - this.setHasSubtypes(true); - this.setUnlocalizedName("egg"); - this.setTextureName("egg"); - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, - * world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) - { - if (!player.capabilities.isCreativeMode) - { - --itemStack.stackSize; - } - - world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - - if (!world.isRemote) - { - world.spawnEntityInWorld(new EntityFarmEgg(world, player, itemStack.getItemDamage())); - } - - return itemStack; - } -} diff --git a/archive/java/resonantinduction/old/core/recipe/RecipeLoader.java b/archive/java/resonantinduction/old/core/recipe/RecipeLoader.java deleted file mode 100644 index adaffbc3..00000000 --- a/archive/java/resonantinduction/old/core/recipe/RecipeLoader.java +++ /dev/null @@ -1,453 +0,0 @@ -package resonantinduction.old.core.recipe; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import resonantinduction.core.resource.item.ItemParts.Parts; -import resonantinduction.mechanical.fluid.pipes.FluidPartsMaterial; -import resonantinduction.old.core.ItemOreDirv; -import resonantinduction.old.core.misc.EnumTool; -import resonantinduction.old.mechanics.processor.BlockProcessor; -import resonantinduction.old.transport.crate.BlockCrate; -import cpw.mods.fml.common.registry.GameRegistry; -import dark.lib.EnumMaterial; -import dark.lib.EnumOrePart; -import dark.lib.helpers.ColorCode; -import dark.lib.interfaces.IReadOut.EnumTools; -import dark.lib.recipes.MachineRecipeHandler; -import dark.lib.recipes.ProcessorType; - -public class RecipeLoader -{ - - public static Block blockConveyorBelt; - public static Block blockManipulator; - public static BlockCrate blockCrate; - public static Block blockImprinter; - public static Block blockEncoder; - public static Block blockDetector; - public static Block blockRejector; - public static Block blockArmbot; - public static Block blockTurntable; - public static Block processorMachine; - public static Block blockAdvancedHopper; - public static Block blockPipe; - public static Block blockTank; - public static Block blockPumpMachine; - public static Block blockRod; - public static Block blockGenerator; - public static Block blockReleaseValve; - public static Block blockSink; - public static Block blockDrain; - public static Block blockConPump; - public static Block blockHeater; - public static Block blockPiston; - public static Block blockBoiler; - public static Block blockWasteLiquid; - public static Block blockOilLiquid; - public static Block blockFuelLiquid; - public static Block blockOre, blockDebug, blockWire; - public static Block blockStainGlass; - public static Block blockColorSand; - public static Block blockBasalt; - public static Block blockGlowGlass; - public static Block blockSteamGen, blockSolar, blockBatBox; - public static Block blockGas; - public static Block frackingPipe; - public static Block laserSentry = null; - - public static Item itemImprint; - public static Item itemDisk; - public static Item itemFluidCan; - public static Item itemTool; - public static Item itemParts; - public static Item itemMetals; - public static Item battery; - public static Item wrench; - public static Item itemGlowingSand; - public static Item itemDiggingTool; - public static Item itemVehicleTest; - public static Item itemMPWire; - - private static RecipeLoader instance; - - public static final String COPPER_WIRE = "wireCopper"; - - public static RecipeLoader instance() - { - if (instance == null) - { - instance = new RecipeLoader(); - } - return instance; - } - - public void loadRecipes() - { - this.setupAutomationRecipes(); - this.createUERecipes(); - - this.registerPipes(); - this.registerTanks(); - - if (blockPumpMachine != null) - GameRegistry.addRecipe(new ShapedOreRecipe(blockPumpMachine, "IGI", "VMV", "IGI", 'G', EnumMaterial.IRON.getOreName(EnumOrePart.GEARS), 'I', EnumMaterial.IRON.getOreName(EnumOrePart.PLATES), 'V', Parts.Valve.name, 'M', "motor")); - if (blockConPump != null) - GameRegistry.addRecipe(new ShapedOreRecipe(blockConPump, "@G@", "GPG", "@G@", '@', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES), 'P', blockPumpMachine, 'G', EnumMaterial.STEEL.getOreName(EnumOrePart.GEARS))); - if (blockDrain != null) - GameRegistry.addRecipe(new ShapelessOreRecipe(blockDrain, Block.dispenser, Parts.Valve.name)); - if (blockReleaseValve != null) - GameRegistry.addRecipe(new ShapedOreRecipe(blockReleaseValve, "RGR", "TVT", "RGR", 'G', EnumMaterial.IRON.getOreName(EnumOrePart.GEARS), 'T', EnumMaterial.IRON.getOreName(EnumOrePart.TUBE), 'V', Parts.Valve.name, 'R', Item.redstone)); - // sink - // GameRegistry.addRecipe(new ItemStack(blockSink, 1), new Object[] { "I I", "SIS", "SPS", - // 'P', new ItemStack(blockPipe, 1), 'I', Item.ingotIron, 'S', Block.stone }); - - if (itemParts != null) - { - // seal - GameRegistry.addRecipe(new ItemStack(itemParts, 16, Parts.Seal.ordinal()), new Object[] { "LL", "LL", 'L', Item.leather }); - // slime steal - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 4, Parts.GasSeal.ordinal()), " # ", "#S#", " # ", '#', Parts.Seal.name, 'S', Item.slimeBall)); - // part valve - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.Valve.ordinal()), "PLP", 'P', EnumMaterial.IRON.getOreName(EnumOrePart.TUBE), 'L', Block.lever)); - // Basic Circuit - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.CircuitBasic.ordinal()), "!#!", "#@#", "!#!", '@', EnumMaterial.COPPER.getOreName(EnumOrePart.PLATES), '#', Block.glass, '!', COPPER_WIRE)); - // Advanced Circuit - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.CircuitAdvanced.ordinal()), "!#!", "#@#", "!#!", '@', EnumMaterial.COPPER.getOreName(EnumOrePart.PLATES), '#', Item.redstone, '!', COPPER_WIRE)); - // Elite Circuit - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.CircuitElite.ordinal()), "!#!", "#@#", "!#!", '@', EnumMaterial.GOLD.getOreName(EnumOrePart.PLATES), '#', Item.redstone, '!', COPPER_WIRE)); - - // unfinished tank - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.Tank.ordinal()), " # ", "# #", " # ", '#', EnumMaterial.BRONZE.getOreName(EnumOrePart.INGOTS))); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.Tank.ordinal()), " # ", "# #", " # ", '#', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS))); - // Motor - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 1, Parts.Motor.ordinal()), "@!@", "!#!", "@!@", '!', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), '#', Item.ingotIron, '@', Parts.COIL.name)); - // Laser Diode - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 4, Parts.LASER.ordinal()), " G ", "!S!", " C ", '!', COPPER_WIRE, 'G', Block.glass, 'S', Block.sand, 'C', Parts.CircuitBasic.name)); - // Coil - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemParts, 8, Parts.COIL.ordinal()), "WWW", "W W", "WWW", 'W', COPPER_WIRE)); - - } - if (itemMetals instanceof ItemOreDirv) - { - // Alt salvaging item list - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.GRINDER, Block.wood, EnumMaterial.getStack(itemMetals, EnumMaterial.WOOD, EnumOrePart.DUST, 3)); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.GRINDER, Block.planks, EnumMaterial.getStack(itemMetals, EnumMaterial.WOOD, EnumOrePart.DUST, 1)); - - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, Block.wood, EnumMaterial.getStack(itemMetals, EnumMaterial.WOOD, EnumOrePart.SCRAPS, 3)); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, Block.planks, EnumMaterial.getStack(itemMetals, EnumMaterial.WOOD, EnumOrePart.SCRAPS, 1)); - - // Stone recipes - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, Block.stone, EnumMaterial.getStack(itemMetals, EnumMaterial.STONE, EnumOrePart.DUST, 1)); - - // Wood recipes - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, Block.wood, EnumMaterial.getStack(itemMetals, EnumMaterial.WOOD, EnumOrePart.DUST, 3)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, Block.planks, EnumMaterial.getStack(itemMetals, EnumMaterial.WOOD, EnumOrePart.DUST, 1)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, Block.wood, EnumMaterial.getStack(itemMetals, EnumMaterial.WOOD, EnumOrePart.SCRAPS, 3)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, Block.planks, EnumMaterial.getStack(itemMetals, EnumMaterial.WOOD, EnumOrePart.SCRAPS, 1)); - - // Gold Recipes - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, Block.blockIron, EnumMaterial.getStack(itemMetals, EnumMaterial.IRON, EnumOrePart.SCRAPS, 8)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, Block.oreIron, EnumMaterial.getStack(itemMetals, EnumMaterial.IRON, EnumOrePart.RUBBLE, 1)); - // Iron Recipes - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, Block.blockGold, EnumMaterial.getStack(itemMetals, EnumMaterial.GOLD, EnumOrePart.SCRAPS, 8)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, Block.oreGold, EnumMaterial.getStack(itemMetals, EnumMaterial.GOLD, EnumOrePart.RUBBLE, 1)); - // Dust recipes - GameRegistry.addShapelessRecipe(EnumMaterial.getStack(itemMetals, EnumMaterial.STEEL, EnumOrePart.DUST, 1), EnumMaterial.getStack(itemMetals, EnumMaterial.IRON, EnumOrePart.DUST, 1), new ItemStack(Item.coal, 1, 0), new ItemStack(Item.coal, 1, 0)); - GameRegistry.addShapelessRecipe(EnumMaterial.getStack(itemMetals, EnumMaterial.STEEL, EnumOrePart.DUST, 1), EnumMaterial.getStack(itemMetals, EnumMaterial.IRON, EnumOrePart.DUST, 1), new ItemStack(Item.coal, 1, 1), new ItemStack(Item.coal, 1, 1)); - GameRegistry.addShapelessRecipe(EnumMaterial.getStack(itemMetals, EnumMaterial.STEEL, EnumOrePart.DUST, 1), EnumMaterial.getStack(itemMetals, EnumMaterial.IRON, EnumOrePart.DUST, 1), new ItemStack(Item.coal, 1, 1), new ItemStack(Item.coal, 1, 0)); - GameRegistry.addShapelessRecipe(EnumMaterial.getStack(itemMetals, EnumMaterial.BRONZE, EnumOrePart.DUST, 4), EnumMaterial.getStack(itemMetals, EnumMaterial.COPPER, EnumOrePart.DUST, 1), EnumMaterial.getStack(itemMetals, EnumMaterial.COPPER, EnumOrePart.DUST, 1), EnumMaterial.getStack(itemMetals, EnumMaterial.COPPER, EnumOrePart.DUST, 1), EnumMaterial.getStack(itemMetals, EnumMaterial.TIN, EnumOrePart.DUST, 1)); - - // Ore material recipe loop - for (EnumMaterial mat : EnumMaterial.values()) - { - // Dust recipes - if (mat.shouldCreateItem(EnumOrePart.DUST)) - { - FurnaceRecipes.smelting().addSmelting(mat.getStack(itemMetals, EnumOrePart.DUST, 1).itemID, mat.getStack(itemMetals, EnumOrePart.DUST, 1).getItemDamage(), mat.getStack(itemMetals, EnumOrePart.INGOTS, 1), 0.6f); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, mat.getStack(itemMetals, EnumOrePart.RUBBLE, 1), mat.getStack(itemMetals, EnumOrePart.DUST, 1), 1, 4); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1), mat.getStack(itemMetals, EnumOrePart.DUST, 1)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, mat.getStack(itemMetals, EnumOrePart.INGOTS, 1), mat.getStack(itemMetals, EnumOrePart.DUST, 1)); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.GRINDER, mat.getStack(itemMetals, EnumOrePart.INGOTS, 1), mat.getStack(itemMetals, EnumOrePart.DUST, 1)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, mat.getStack(itemMetals, EnumOrePart.PLATES, 1), mat.getStack(itemMetals, EnumOrePart.DUST, 1), 2, 4); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.GRINDER, mat.getStack(itemMetals, EnumOrePart.PLATES, 1), mat.getStack(itemMetals, EnumOrePart.DUST, 3)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, mat.getStack(itemMetals, EnumOrePart.ROD, 1), mat.getStack(itemMetals, EnumOrePart.DUST, 1)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, mat.getStack(itemMetals, EnumOrePart.TUBE, 1), mat.getStack(itemMetals, EnumOrePart.DUST, 1)); - } - - // Salvaging recipe - - if (mat.shouldCreateItem(EnumOrePart.SCRAPS)) - { - FurnaceRecipes.smelting().addSmelting(mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1).itemID, mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1).getItemDamage(), mat.getStack(itemMetals, EnumOrePart.INGOTS, 1), 0.6f); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, mat.getStack(itemMetals, EnumOrePart.PLATES, 1), mat.getStack(itemMetals, EnumOrePart.SCRAPS, 3)); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, mat.getStack(itemMetals, EnumOrePart.PLATES, 1), mat.getStack(itemMetals, EnumOrePart.SCRAPS, 3)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, mat.getStack(itemMetals, EnumOrePart.RUBBLE, 1), mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1), 1, 5); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, mat.getStack(itemMetals, EnumOrePart.INGOTS, 1), mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, mat.getStack(itemMetals, EnumOrePart.ROD, 1), mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, mat.getStack(itemMetals, EnumOrePart.TUBE, 1), mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1)); - } - if (mat.shouldCreateItem(EnumOrePart.TUBE)) - { - GameRegistry.addRecipe(new ShapedOreRecipe(mat.getStack(itemMetals, EnumOrePart.TUBE, 6), "I", "I", "I", 'I', mat.getOreName(EnumOrePart.INGOTS))); - GameRegistry.addRecipe(new ShapedOreRecipe(mat.getStack(itemMetals, EnumOrePart.TUBE, 1), "I", 'I', mat.getOreName(EnumOrePart.ROD))); - } - if (mat.shouldCreateItem(EnumOrePart.ROD)) - { - GameRegistry.addRecipe(new ShapedOreRecipe(mat.getStack(itemMetals, EnumOrePart.ROD, 4), "I", "I", 'I', mat.getOreName(EnumOrePart.INGOTS))); - } - if (mat.shouldCreateItem(EnumOrePart.PLATES)) - { - GameRegistry.addRecipe(new ShapedOreRecipe(mat.getStack(itemMetals, EnumOrePart.PLATES, 1), "II", "II", 'I', mat.getOreName(EnumOrePart.INGOTS))); - } - if (mat.shouldCreateItem(EnumOrePart.GEARS)) - { - GameRegistry.addRecipe(new ShapedOreRecipe(mat.getStack(itemMetals, EnumOrePart.GEARS, 4), " I ", "IRI", " I ", 'I', mat.getOreName(EnumOrePart.INGOTS), 'R', mat.shouldCreateItem(EnumOrePart.ROD) ? mat.getOreName(EnumOrePart.ROD) : Item.stick)); - } - - } - } - if (itemTool != null) - { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemTool, 1, EnumTools.PIPE_GUAGE.ordinal()), "TVT", " T ", 'T', EnumMaterial.IRON.getOreName(EnumOrePart.TUBE), 'V', Parts.Valve.name)); - - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemTool, 1, EnumTools.MULTI_METER.ordinal()), "PGP", "WCW", "PRP", 'P', Block.planks, 'G', Block.glass, 'C', Parts.CircuitBasic.name, 'R', COPPER_WIRE, 'W', Parts.COIL.name)); - } - if (wrench != null) - { - GameRegistry.addRecipe(new ShapedOreRecipe(wrench, "S S", " S ", " S ", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS))); - } - if (blockSolar != null) - { - GameRegistry.addRecipe(new ShapedOreRecipe(blockSolar, "GGG", "SCS", "SWS", 'G', Block.glass, 'W', "copperWire", 'C', Parts.CircuitBasic.name, 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS))); - } - if (blockWire != null) - { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWire, 16, 0), "III", "WWW", "III", 'I', Block.cloth, 'W', EnumMaterial.COPPER.getOreName(EnumOrePart.INGOTS))); - } - if (itemDiggingTool != null) - { - - for (EnumMaterial mat : EnumMaterial.values()) - { - if (mat.shouldCreateTool()) - { - GameRegistry.addRecipe(new ShapedOreRecipe(EnumTool.PICKAX.getTool(mat), "III", " S ", " S ", 'I', mat.getOreName(EnumOrePart.INGOTS), 'S', Item.stick)); - GameRegistry.addRecipe(new ShapedOreRecipe(EnumTool.HOE.getTool(mat), "II ", " S ", " S ", 'I', mat.getOreName(EnumOrePart.INGOTS), 'S', Item.stick)); - GameRegistry.addRecipe(new ShapedOreRecipe(EnumTool.SPADE.getTool(mat), " I ", " S ", " S ", 'I', mat.getOreName(EnumOrePart.INGOTS), 'S', Item.stick)); - GameRegistry.addRecipe(new ShapedOreRecipe(EnumTool.AX.getTool(mat), "II ", "IS ", " S ", 'I', mat.getOreName(EnumOrePart.INGOTS), 'S', Item.stick)); - // GameRegistry.addRecipe(new ShapedOreRecipe(mat.getTool(EnumTool.SHEAR), - // "III", " S ", 'I', mat.getStack(EnumOrePart.INGOTS, 1))); - } - } - } - - for (ColorCode code : ColorCode.values()) - { - // Stained Glass // - if (blockColorSand != null) - { - - if (blockStainGlass != null) - { - FurnaceRecipes.smelting().addSmelting(blockColorSand.blockID, code.ordinal(), new ItemStack(blockStainGlass, 1, code.ordinal()), 10F); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, new ItemStack(blockStainGlass, 1, code.ordinal()), new ItemStack(blockColorSand.blockID, 1, code.ordinal())); - } - GameRegistry.addShapelessRecipe(new ItemStack(blockColorSand.blockID, 1, code.ordinal()), new Object[] { new ItemStack(blockColorSand, 1, code.ordinal()) }); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, new ItemStack(blockColorSand, 1, code.ordinal()), new ItemStack(itemGlowingSand, 1, code.ordinal())); - - } - - // Glowing Glass // - if (itemGlowingSand != null) - { - if (blockGlowGlass != null) - { - FurnaceRecipes.smelting().addSmelting(itemGlowingSand.itemID, code.ordinal(), new ItemStack(blockGlowGlass, 1, code.ordinal()), 10F); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, new ItemStack(blockGlowGlass, 1, code.ordinal()), new ItemStack(itemGlowingSand, 1, code.ordinal())); - } - if (blockColorSand != null) - { - GameRegistry.addShapelessRecipe(new ItemStack(itemGlowingSand, 1, code.ordinal()), new ItemStack(blockColorSand.blockID, 1, code.ordinal()), Item.redstone); - GameRegistry.addShapelessRecipe(new ItemStack(itemGlowingSand, 1, code.ordinal()), new ItemStack(blockColorSand.blockID, 1, code.ordinal()), Item.glowstone); - MachineRecipeHandler.banProcessingOfItem(new ItemStack(itemGlowingSand, 1, code.ordinal())); - } - } - - // Colored Sand // - if (blockColorSand != null) - { - GameRegistry.addRecipe(new ItemStack(blockColorSand, 8, code.ordinal()), "SSS", "SDS", "SSS", 'S', Block.sand, 'D', new ItemStack(Item.dyePowder, 1, code.ordinal())); - - } - } - } - - private void createUERecipes() - { - - } - - private void setupAutomationRecipes() - { - // Imprint - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemImprint, 2), "RPI", 'P', Item.paper, 'R', Item.redstone, 'I', new ItemStack(Item.dyePowder, 1, 0))); - // Imprinter - GameRegistry.addRecipe(new ShapedOreRecipe(blockImprinter, "SSS", "GPG", "WCW", 'G', EnumMaterial.WOOD.getOreName(EnumOrePart.GEARS), 'S', Item.ingotIron, 'C', Block.chest, 'W', Block.workbench, 'P', Block.pistonBase)); - // Crate - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 0), "TST", "S S", "TST", 'S', Item.ingotIron, 'T', Block.planks)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 1), "SC", "SS", 'C', new ItemStack(blockCrate, 1, 0), 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS))); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 1), "TST", "S S", "TST", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'T', Block.wood)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 2), "SC", "SS", 'C', new ItemStack(blockCrate, 1, 1), 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES))); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 2), "TST", "S S", "TST", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES), 'T', Block.wood)); - // Armbot - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockArmbot), "II ", "SIS", "MCM", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES), 'C', Parts.CircuitAdvanced.name, 'I', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'M', Parts.Motor.name)); - // Disk - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemDisk), " I ", "ICI", " I ", 'I', Item.paper, 'C', EnumMaterial.COPPER.getOreName(EnumOrePart.INGOTS))); - // Encoder - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockEncoder), "SPS", "SSS", "SCS", 'P', Block.pistonBase, 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'C', Parts.CircuitAdvanced.name)); - // Detector - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockDetector), "SES", "SCS", "S S", 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'C', Parts.CircuitBasic.name, 'E', Item.enderPearl)); - // Conveyor Belt - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 10, 0), "III", "MCM", 'I', Item.ingotIron, 'C', Parts.CircuitBasic.name, 'M', Parts.Motor.name)); - // Rejector - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockRejector), "CPC", "@R@", '@', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'R', Item.redstone, 'P', Block.pistonBase, 'C', Parts.CircuitBasic.name)); - // Turntable - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockTurntable), "IMI", "ICI", 'M', Parts.Motor.name, 'C', Parts.CircuitBasic.name, 'I', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS))); - // Manipulator - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockManipulator, 2, 0), Block.dispenser, Parts.CircuitBasic.name)); - if (processorMachine != null) - { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(processorMachine, 1, BlockProcessor.ProcessorData.GRINDER.startMeta), "SSS", "PMP", "SCS", 'M', Parts.Motor.name, 'P', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES), 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'C', Parts.CircuitBasic.name)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(processorMachine, 1, BlockProcessor.ProcessorData.CRUSHER.startMeta), "SPS", "RPR", "SCS", 'R', Block.pistonBase, 'P', EnumMaterial.STEEL.getOreName(EnumOrePart.PLATES), 'S', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'C', Parts.CircuitBasic.name)); - } - } - - public void registerTanks() - { - if (blockTank != null) - { - GameRegistry.addRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.GLASS.getMeta()), "SXS", "X X", "SXS", 's', Item.silk, 'X', Block.glass); - GameRegistry.addRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.WOOD.getMeta()), "LXL", "X X", "LXL", 'L', Block.wood, 'X', Block.glass); - GameRegistry.addRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.STONE.getMeta()), "SXS", "X X", "SXS", 'S', Block.stone, 'X', Block.glass); - GameRegistry.addRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.IRON.getMeta()), "IXI", "X X", "IXI", 'I', Item.ingotIron, 'X', Block.glass); - - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.TIN.getMeta()), "IXI", "X X", "IXI", 'I', EnumMaterial.TIN.getOreName(EnumOrePart.INGOTS), 'X', Block.glass)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.COPPER.getMeta()), "IXI", "X X", "IXI", 'I', EnumMaterial.COPPER.getOreName(EnumOrePart.INGOTS), 'X', Block.glass)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.BRONZE.getMeta()), "IXI", "X X", "IXI", 'I', EnumMaterial.BRONZE.getOreName(EnumOrePart.INGOTS), 'X', Block.glass)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.GOLD.getMeta()), "IXI", "X X", "IXI", 'I', Item.ingotGold, 'X', Block.glass)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.STEEL.getMeta()), "IXI", "X X", "IXI", 'I', EnumMaterial.STEEL.getOreName(EnumOrePart.INGOTS), 'X', Block.glass)); - - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.OBBY.getMeta()), "IXI", "XEX", "IXI", 'I', Block.obsidian, 'X', Block.glass, 'E', Item.enderPearl)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockTank, 1, FluidPartsMaterial.HELL.getMeta()), "IXI", "XBX", "IXI", 'I', Block.obsidian, 'X', Block.netherBrick, 'B', Item.blazePowder)); - } - } - - public void registerPipes() - { - if (blockPipe != null) - { - GameRegistry.addRecipe(FluidPartsMaterial.WOOD.getStack(2), "LLL", "WWW", "LLL", 'W', Block.planks, 'L', Block.wood); - GameRegistry.addRecipe(FluidPartsMaterial.STONE.getStack(2), "SSS", "CCC", "SSS", 'S', Block.stone, 'C', Block.cobblestone); - GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.IRON.getStack(2), EnumMaterial.IRON.getOreName(EnumOrePart.TUBE), Parts.Seal.name)); - GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.GOLD.getStack(2), EnumMaterial.GOLD.getOreName(EnumOrePart.TUBE), Parts.Seal.name)); - GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.TIN.getStack(2), EnumMaterial.TIN.getOreName(EnumOrePart.TUBE), Parts.Seal.name)); - GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.COPPER.getStack(2), EnumMaterial.COPPER.getOreName(EnumOrePart.TUBE), Parts.Seal.name)); - GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.BRONZE.getStack(2), EnumMaterial.BRONZE.getOreName(EnumOrePart.TUBE), Parts.Seal.name)); - GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.STEEL.getStack(2), EnumMaterial.STEEL.getOreName(EnumOrePart.TUBE), Parts.Seal.name)); - GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.OBBY.getStack(2), new Object[] { EnumMaterial.OBBY.getOreName(EnumOrePart.TUBE), Block.netherBrick, Block.netherBrick })); - GameRegistry.addRecipe(new ShapedOreRecipe(FluidPartsMaterial.HELL.getStack(4), new Object[] { "OOO", "BNB", "OOO", 'N', Block.netherBrick, 'B', Item.blazeRod, 'O', Block.obsidian })); - - for (FluidPartsMaterial mat : FluidPartsMaterial.values()) - { - for (ColorCode color : ColorCode.values()) - { - GameRegistry.addRecipe(mat.getStack(color), new Object[] { " X ", "XIX", " X ", 'I', new ItemStack(Item.dyePowder, 1, color.ordinal()), 'X', blockPipe }); - GameRegistry.addShapelessRecipe(mat.getStack(), new Object[] { mat.getStack(color) }); - } - } - } - } - - public static void parseOreNames(Configuration config) - { - if (config.get("Ore", "processOreDictionary", true, "Scans the ore dictionary and adds recipes for other mod's items").getBoolean(true)) - { - for (EnumMaterial mat : EnumMaterial.values()) - { - List ingots = OreDictionary.getOres(mat.getOreName(EnumOrePart.INGOTS)); - List plates = OreDictionary.getOres(mat.getOreName(EnumOrePart.PLATES)); - List dusts = OreDictionary.getOres(mat.getOreName(EnumOrePart.DUST)); - List ores = OreDictionary.getOres("ore" + mat.simpleName); - if (config.get("Ore", "OverrideDustSmelthing", true, "Forces all mods to use the same ingot for dust smelting").getBoolean(true)) - { - for (ItemStack du : dusts) - { - if (mat.shouldCreateItem(EnumOrePart.INGOTS)) - { - FurnaceRecipes.smelting().addSmelting(du.itemID, du.getItemDamage(), mat.getStack(itemMetals, EnumOrePart.INGOTS, 1), 0.6f); - } - } - } - - for (ItemStack ing : ingots) - { - if (mat.shouldCreateItem(EnumOrePart.DUST)) - { - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, ing, mat.getStack(itemMetals, EnumOrePart.DUST, 1)); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.GRINDER, ing, mat.getStack(itemMetals, EnumOrePart.DUST, 1)); - } - if (mat.shouldCreateItem(EnumOrePart.SCRAPS)) - { - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, ing, mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1)); - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, ing, mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1)); - } - if (mat.shouldCreateItem(EnumOrePart.INGOTS) && config.get("Ore", "AddIngotConversionRecipe", true, "Creates a recipe to convert other mods ingots into AL ingots").getBoolean(true)) - { - GameRegistry.addShapelessRecipe(mat.getStack(itemMetals, EnumOrePart.INGOTS, 1), new Object[] { ing }); - } - } - for (ItemStack pla : plates) - { - if (mat.shouldCreateItem(EnumOrePart.DUST)) - { - - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, pla, mat.getStack(itemMetals, EnumOrePart.DUST, 1)); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.GRINDER, pla, mat.getStack(itemMetals, EnumOrePart.DUST, 1)); - - } - if (mat.shouldCreateItem(EnumOrePart.SCRAPS)) - { - - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, pla, mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1)); - MachineRecipeHandler.newAltProcessorOutput(ProcessorType.CRUSHER, pla, mat.getStack(itemMetals, EnumOrePart.SCRAPS, 1)); - - } - } - for (ItemStack ore : ores) - { - if (mat.shouldCreateItem(EnumOrePart.RUBBLE)) - { - MachineRecipeHandler.newProcessorRecipe(ProcessorType.CRUSHER, ore, mat.getStack(itemMetals, EnumOrePart.RUBBLE, 1), 1, 2); - } - if (mat.shouldCreateItem(EnumOrePart.DUST)) - { - MachineRecipeHandler.newProcessorRecipe(ProcessorType.GRINDER, ore, mat.getStack(itemMetals, EnumOrePart.DUST, 1), 1, 3); - } - if (mat.shouldCreateItem(EnumOrePart.INGOTS) && config.get("Ore", "OverrideOreSmelthing", true, "Forces other mods ores to smelt as one ingot").getBoolean(true)) - { - FurnaceRecipes.smelting().addSmelting(ore.itemID, ore.getItemDamage(), mat.getStack(itemMetals, EnumOrePart.INGOTS, 1), 0.6f); - } - } - - } - } - } -} diff --git a/archive/java/resonantinduction/old/core/render/RenderRIItem.java b/archive/java/resonantinduction/old/core/render/RenderRIItem.java deleted file mode 100644 index a86a96f1..00000000 --- a/archive/java/resonantinduction/old/core/render/RenderRIItem.java +++ /dev/null @@ -1,61 +0,0 @@ -package resonantinduction.old.core.render; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.electrical.multimeter.ItemMultimeter; -import resonantinduction.electrical.multimeter.RenderMultimeter; -import resonantinduction.electrical.transformer.ItemTransformer; -import resonantinduction.electrical.transformer.RenderTransformer; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -@SideOnly(Side.CLIENT) -public class RenderRIItem implements IItemRenderer -{ - public static final RenderRIItem INSTANCE = new RenderRIItem(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) - { - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) - { - if (item.getItem() instanceof ItemMultimeter) - { - GL11.glPushMatrix(); - GL11.glRotatef(180, 0, 1, 0); - GL11.glTranslated(0, -1, -0.7); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderMultimeter.TEXTURE); - RenderMultimeter.MODEL.render(0.0625f); - GL11.glPopMatrix(); - } - else if (item.getItem() instanceof ItemTransformer) - { - GL11.glPushMatrix(); - GL11.glRotatef(180, 0, 0, 1); - GL11.glTranslated(0, -1, 0); - GL11.glScaled(0.9f, 0.9f, 0.9f); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderTransformer.TEXTURE); - RenderTransformer.MODEL.render(0.0625f); - GL11.glPopMatrix(); - } - } - -} diff --git a/archive/java/resonantinduction/old/mechanics/furnace/BlockAdvancedFurnace.java b/archive/java/resonantinduction/old/mechanics/furnace/BlockAdvancedFurnace.java deleted file mode 100644 index ea0133cc..00000000 --- a/archive/java/resonantinduction/old/mechanics/furnace/BlockAdvancedFurnace.java +++ /dev/null @@ -1,134 +0,0 @@ -package resonantinduction.old.mechanics.furnace; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockFurnace; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * @author Calclavia - * - */ -public class BlockAdvancedFurnace extends BlockFurnace -{ - @SideOnly(Side.CLIENT) - private Icon furnaceIconTop; - @SideOnly(Side.CLIENT) - private Icon furnaceIconFront; - @SideOnly(Side.CLIENT) - private Icon furnaceIconFrontBurn; - - protected BlockAdvancedFurnace(int id, boolean isBurning) - { - super(id, isBurning); - this.setHardness(3.5F); - this.setStepSound(soundStoneFootstep); - this.setUnlocalizedName("furnace"); - - if (isBurning) - { - this.setLightValue(0.875F); - } - else - { - this.setCreativeTab(CreativeTabs.tabDecorations); - } - } - - public static BlockAdvancedFurnace createNew(boolean isBurning) - { - int id = Block.furnaceIdle.blockID; - - if (isBurning) - { - id = Block.furnaceBurning.blockID; - } - - Block.blocksList[id] = null; - Item.itemsList[id] = null; - return new BlockAdvancedFurnace(id, isBurning); - } - - @Override - public void registerIcons(IconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon("furnace_side"); - this.furnaceIconFront = par1IconRegister.registerIcon("furnace_front_off"); - this.furnaceIconFrontBurn = par1IconRegister.registerIcon("furnace_front_on"); - this.furnaceIconTop = par1IconRegister.registerIcon("furnace_top"); - } - - @Override - public Icon getBlockTexture(IBlockAccess access, int x, int y, int z, int side) - { - TileEntity tileEntity = access.getBlockTileEntity(x, y, z); - int meta = access.getBlockMetadata(x, y, z); - - if (((TileAdvancedFurnace) tileEntity).isBurning()) - { - return side == 1 ? this.furnaceIconTop : (side == 0 ? this.furnaceIconTop : (side != meta ? this.blockIcon : this.furnaceIconFrontBurn)); - } - else - { - return side == 1 ? this.furnaceIconTop : (side == 0 ? this.furnaceIconTop : (side != meta ? this.blockIcon : this.furnaceIconFront)); - } - } - - @Override - public Icon getIcon(int side, int meta) - { - return side == 1 ? this.furnaceIconTop : (side == 0 ? this.furnaceIconTop : (side != 3 ? this.blockIcon : this.furnaceIconFront)); - } - - @Override - public void randomDisplayTick(World world, int x, int y, int z, Random par5Random) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (((TileAdvancedFurnace) tileEntity).isBurning()) - { - int l = world.getBlockMetadata(x, y, z); - float f = x + 0.5F; - float f1 = y + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F; - float f2 = z + 0.5F; - float f3 = 0.52F; - float f4 = par5Random.nextFloat() * 0.6F - 0.3F; - - if (l == 4) - { - world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - } - else if (l == 5) - { - world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - } - else if (l == 2) - { - world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); - } - else if (l == 3) - { - world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); - } - } - } - - @Override - public TileEntity createNewTileEntity(World par1World) - { - return new TileAdvancedFurnace(); - } -} diff --git a/archive/java/resonantinduction/old/mechanics/furnace/TileAdvancedFurnace.java b/archive/java/resonantinduction/old/mechanics/furnace/TileAdvancedFurnace.java deleted file mode 100644 index 20bd7e51..00000000 --- a/archive/java/resonantinduction/old/mechanics/furnace/TileAdvancedFurnace.java +++ /dev/null @@ -1,203 +0,0 @@ -package resonantinduction.old.mechanics.furnace; - -import java.util.ArrayList; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.ResonantInduction; -import resonantinduction.core.Settings; -import universalelectricity.api.CompatibilityModule; -import universalelectricity.api.UniversalClass; -import universalelectricity.api.energy.EnergyStorageHandler; -import universalelectricity.api.energy.IEnergyContainer; -import universalelectricity.api.energy.IEnergyInterface; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.network.IPacketReceiver; -import calclavia.lib.network.IPacketSender; - -import com.google.common.io.ByteArrayDataInput; - -/** - * Meant to replace the furnace class. - * - * @author Calclavia - * - */ -@UniversalClass -public class TileAdvancedFurnace extends TileEntityFurnace implements IEnergyInterface, IEnergyContainer, IPacketSender, IPacketReceiver -{ - private static final float WATTAGE = 5; - - private EnergyStorageHandler energy = new EnergyStorageHandler(Settings.FURNACE_WATTAGE * 5); - - @Override - public void updateEntity() - { - /** - * Producing energy from coal. - */ - if (TileEntityFurnace.getItemBurnTime(this.getStackInSlot(1)) > 0) - { - boolean doBlockStateUpdate = this.furnaceBurnTime > 0; - - if (!this.energy.isFull() && this.furnaceBurnTime == 0) - { - int burnTime = TileEntityFurnace.getItemBurnTime(this.getStackInSlot(1)); - this.decrStackSize(1, 1); - this.furnaceBurnTime = burnTime; - } - - if (this.furnaceBurnTime > 0) - { - this.energy.receiveEnergy(Settings.FURNACE_WATTAGE / 20, true); - this.furnaceBurnTime--; - } - - if (doBlockStateUpdate != this.furnaceBurnTime > 0) - { - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - this.produce(); - } - - /** - * Consuming energy for smelting - */ - if (this.canSmelt()) - { - if (this.energy.checkExtract(Settings.FURNACE_WATTAGE / 20)) - { - this.furnaceCookTime++; - - if (this.furnaceCookTime == 200) - { - this.furnaceCookTime = 0; - this.smeltItem(); - } - - this.energy.extractEnergy(Settings.FURNACE_WATTAGE / 20, true); - } - } - else - { - this.furnaceCookTime = 0; - } - } - - private void produce() - { - for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) - { - if (this.energy.getEnergy() > 0) - { - TileEntity tileEntity = new Vector3(this).modifyPositionFromSide(direction).getTileEntity(this.worldObj); - - if (tileEntity != null) - { - long used = CompatibilityModule.receiveEnergy(tileEntity, direction.getOpposite(), this.energy.extractEnergy(this.energy.getEnergy(), false), true); - this.energy.extractEnergy(used, true); - } - } - } - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return true; - } - - private boolean canSmelt() - { - if (this.getStackInSlot(0) == null) - { - return false; - } - else - { - ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.getStackInSlot(0)); - if (itemstack == null) - return false; - if (this.getStackInSlot(2) == null) - return true; - if (!this.getStackInSlot(2).isItemEqual(itemstack)) - return false; - int result = getStackInSlot(2).stackSize + itemstack.stackSize; - return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); - } - } - - @Override - public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) - { - if (this.canSmelt() && this.getStackInSlot(1) == null && this.furnaceBurnTime == 0) - { - return this.energy.receiveEnergy(receive, doReceive); - } - - return 0; - } - - @Override - public long onExtractEnergy(ForgeDirection from, long request, boolean doProvide) - { - return this.energy.extractEnergy(request, doProvide); - } - - @Override - public void setEnergy(ForgeDirection from, long energy) - { - this.energy.setEnergy(energy); - } - - @Override - public long getEnergy(ForgeDirection from) - { - return this.energy.getEnergy(); - } - - @Override - public long getEnergyCapacity(ForgeDirection from) - { - return this.energy.getEnergyCapacity(); - } - - @Override - public Packet getDescriptionPacket() - { - return ResonantInduction.PACKET_TILE.getPacket(this, this.getPacketData(0).toArray()); - } - - /** - * 1 - Description Packet - * 2 - Energy Update - * 3 - Tesla Beam - */ - @Override - public ArrayList getPacketData(int type) - { - ArrayList data = new ArrayList(); - data.add(this.furnaceBurnTime); - return data; - } - - @Override - public void onReceivePacket(ByteArrayDataInput data, EntityPlayer player, Object... extra) - { - try - { - this.furnaceBurnTime = data.readInt(); - this.worldObj.markBlockForRenderUpdate(this.xCoord, this.yCoord, this.zCoord); - } - catch (Exception e) - { - e.printStackTrace(); - } - } -} diff --git a/archive/java/resonantinduction/old/mechanics/machine/mining/BlockApertureExcavator.java b/archive/java/resonantinduction/old/mechanics/machine/mining/BlockApertureExcavator.java deleted file mode 100644 index 9e324bd4..00000000 --- a/archive/java/resonantinduction/old/mechanics/machine/mining/BlockApertureExcavator.java +++ /dev/null @@ -1,64 +0,0 @@ -package resonantinduction.old.mechanics.machine.mining; - -import java.util.List; -import java.util.Set; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import resonantinduction.core.prefab.block.BlockMachine; - -import com.builtbroken.common.Pair; - -import dark.lib.IExtraInfo.IExtraBlockInfo; - -/** @author Archadia */ -public class BlockApertureExcavator extends BlockMachine implements IExtraBlockInfo -{ - - public BlockApertureExcavator() - { - super("Machine_ApertureExcavator"); - } - - @Override - public TileEntity createTileEntity(World world, int metadata) - { - return new TileApertureExcavator(); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("TileApertureExcavator", TileApertureExcavator.class)); - } - - @Override - public boolean hasExtraConfigs() - { - // TODO Auto-generated method stub - return false; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - // TODO Auto-generated method stub - - } - - @Override - public void loadOreNames() - { - // TODO Auto-generated method stub - - } - - @Override - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - // TODO Auto-generated method stub - - } -} diff --git a/archive/java/resonantinduction/old/mechanics/machine/mining/BlockFracker.java b/archive/java/resonantinduction/old/mechanics/machine/mining/BlockFracker.java deleted file mode 100644 index b9fa9b41..00000000 --- a/archive/java/resonantinduction/old/mechanics/machine/mining/BlockFracker.java +++ /dev/null @@ -1,75 +0,0 @@ -package resonantinduction.old.mechanics.machine.mining; - -import java.util.List; -import java.util.Set; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import resonantinduction.core.prefab.block.BlockMachine; - -import com.builtbroken.common.Pair; - -import dark.lib.IExtraInfo.IExtraBlockInfo; - -/** @author Archadia */ -public class BlockFracker extends BlockMachine implements IExtraBlockInfo -{ - - public BlockFracker() - { - super("Machine_Fracker"); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int a, float b, float c, float d) - { - // player.openGui(MechanizedMining.instance, 1, world, x, y, z); - TileFracker tile = (TileFracker) world.getBlockTileEntity(x, y, z); - - System.out.println(tile.tank.getFluidAmount()); - return true; - } - - @Override - public TileEntity createTileEntity(World world, int metadata) - { - return new TileFracker(); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("TileFracker", TileFracker.class)); - } - - @Override - public boolean hasExtraConfigs() - { - // TODO Auto-generated method stub - return false; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - // TODO Auto-generated method stub - - } - - @Override - public void loadOreNames() - { - // TODO Auto-generated method stub - - } - - @Override - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - // TODO Auto-generated method stub - - } -} diff --git a/archive/java/resonantinduction/old/mechanics/machine/mining/BlockFrackingPipe.java b/archive/java/resonantinduction/old/mechanics/machine/mining/BlockFrackingPipe.java deleted file mode 100644 index f3c875c2..00000000 --- a/archive/java/resonantinduction/old/mechanics/machine/mining/BlockFrackingPipe.java +++ /dev/null @@ -1,83 +0,0 @@ -package resonantinduction.old.mechanics.machine.mining; - -import java.util.List; -import java.util.Set; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.client.render.BlockRenderHelper; - -import com.builtbroken.common.Pair; - -import dark.lib.IExtraInfo.IExtraBlockInfo; - -/** @author Archadia */ -public class BlockFrackingPipe extends BlockMachine implements IExtraBlockInfo -{ - - public BlockFrackingPipe() - { - super("Fracking_Pipe"); - } - - @Override - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - - } - - @Override - public int getRenderType() - { - return BlockRenderHelper.instance.getRenderId(); - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public TileEntity createTileEntity(World world, int metadata) - { - return new TileFrackingPipe(); - } - - @Override - public boolean hasExtraConfigs() - { - // TODO Auto-generated method stub - return false; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - // TODO Auto-generated method stub - - } - - @Override - public void loadOreNames() - { - // TODO Auto-generated method stub - - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - // TODO Auto-generated method stub - - } -} diff --git a/archive/java/resonantinduction/old/mechanics/machine/mining/ItemMiningLaser.java b/archive/java/resonantinduction/old/mechanics/machine/mining/ItemMiningLaser.java deleted file mode 100644 index 92e1702f..00000000 --- a/archive/java/resonantinduction/old/mechanics/machine/mining/ItemMiningLaser.java +++ /dev/null @@ -1,271 +0,0 @@ -package resonantinduction.old.mechanics.machine.mining; - -import java.awt.Color; -import java.util.HashMap; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumMovingObjectType; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.oredict.OreDictionary; -import resonantinduction.api.events.LaserEvent; -import resonantinduction.old.transport.ResonantInductionTransport; -import universalelectricity.api.item.ItemElectric; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.RayTraceHelper; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.CoreRegistry; -import dark.lib.IExtraInfo.IExtraItemInfo; - -/** - * Stream laser mining tool, When held down it will slowly mine away at the block in front of it. - * - * - * TODO create model for this that is 3D. The front should spin around the barrel as its mines - * generating a laser. As well the player should be wearing a battery pack when the laser is out. - * Other option is to force the player to wear a battery pack as armor when using the tool - * - * TODO when the laser hits the block there should be a flaring effect that simi blinds the player. - * That way they are force to wear wielding googles. As well this will gear the player more towards - * mining and less to fighting. Though the laser should still be a very effect fighting weapon, with - * only down side being its battery, and that it slows you down when held. Eg its a heavy peace of - * mining gear and the player will be simi-stationary when using it - * - * @author DarkGuardsman - */ -public class ItemMiningLaser extends ItemElectric implements IExtraItemInfo -{ - long batterySize = 100000; - float wattPerShot = 1; - float damageToEntities = 3.3f; - int blockRange = 50; - int firingDelay = 5; - int breakTime = 15; - boolean createLava = true, setFire = true; - - HashMap> miningMap = new HashMap>(); - - public ItemMiningLaser() - { - super(ResonantInductionTransport.CONFIGURATION.getItem("LaserMiningGun", DarkCore.getNextItemId()).getInt()); - this.setUnlocalizedName("MiningLaser"); - this.setMaxStackSize(1); - this.setCreativeTab(CreativeTabs.tabTools); - } - - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) - { - return EnumAction.bow; - } - - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) - { - // TODO change render of the laser too show it slowly over heat, when it over heats eg gets - // to max use damage the player, and tool - return 1000; - } - - @Override - public void onUpdate(ItemStack itemStack, World par2World, Entity entity, int par4, boolean par5) - { - // Slow any entity that carries this down as a side effect of using heavy mining gear - if (entity instanceof EntityLivingBase) - { - boolean flag = entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode; - - if (!flag) - { - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5, 0)); - } - else - { - // ((EntityPlayer) entity).setItemInUse(itemStack, - // this.getMaxItemUseDuration(itemStack)); - } - } - } - - @Override - public void onCreated(ItemStack stack, World par2World, EntityPlayer entityPlayer) - { - this.setEnergy(stack, 0); - if (stack.getTagCompound() == null) - { - stack.setTagCompound(new NBTTagCompound()); - } - if (entityPlayer != null) - { - stack.getTagCompound().setString("Creator", entityPlayer.username); - } - } - - @Override - public void onUsingItemTick(ItemStack stack, EntityPlayer player, int count) - { - - if (count > 5) - { - Vec3 playerPosition = Vec3.createVectorHelper(player.posX, player.posY + player.getEyeHeight(), player.posZ); - Vec3 playerLook = RayTraceHelper.getLook(player, 1.0f); - Vec3 p = Vec3.createVectorHelper(playerPosition.xCoord + playerLook.xCoord, playerPosition.yCoord + playerLook.yCoord, playerPosition.zCoord + playerLook.zCoord); - - Vec3 playerViewOffset = Vec3.createVectorHelper(playerPosition.xCoord + playerLook.xCoord * blockRange, playerPosition.yCoord + playerLook.yCoord * blockRange, playerPosition.zCoord + playerLook.zCoord * blockRange); - MovingObjectPosition hit = RayTraceHelper.do_rayTraceFromEntity(player, new Vector3().toVec3(), blockRange, true); - - // TODO fix sound - if (hit != null) - { - LaserEvent event = new LaserEvent.LaserFiredPlayerEvent(player, hit, stack); - MinecraftForge.EVENT_BUS.post(event); - if (!player.worldObj.isRemote && !event.isCanceled()) - { - if (hit.typeOfHit == EnumMovingObjectType.ENTITY && hit.entityHit != null) - { - // TODO re-implements laser damage source - DamageSource damageSource = DamageSource.causeMobDamage(player); - hit.entityHit.attackEntityFrom(damageSource, damageToEntities); - hit.entityHit.setFire(5); - } - else if (hit.typeOfHit == EnumMovingObjectType.TILE) - { - int time = 1; - boolean mined = false; - if (miningMap.containsKey(player)) - { - Pair lastHit = miningMap.get(player); - if (lastHit != null && lastHit.left() != null && lastHit.left().equals(new Vector3(hit))) - { - time = lastHit.right() + 1; - if (time >= breakTime) - { - - LaserEvent.onBlockMinedByLaser(player.worldObj, player, new Vector3(hit)); - mined = true; - miningMap.remove(player); - } - else - { - // TODO get the actual hit side from the angle of the ray trace - LaserEvent.onLaserHitBlock(player.worldObj, player, new Vector3(hit), ForgeDirection.UP); - } - } - } - if (!mined) - { - miningMap.put(player, new Pair(new Vector3(hit), time)); - } - } - - } - playerViewOffset = hit.hitVec; - } - // TODO make beam brighter the longer it has been used - // TODO adjust the laser for the end of the gun - float x = (float) (MathHelper.cos((float) (player.rotationYawHead * 0.0174532925)) * (-.4) - MathHelper.sin((float) (player.rotationYawHead * 0.0174532925)) * (-.1)); - float z = (float) (MathHelper.sin((float) (player.rotationYawHead * 0.0174532925)) * (-.4) + MathHelper.cos((float) (player.rotationYawHead * 0.0174532925)) * (-.1)); - CoreRegistry.proxy().renderBeam(player.worldObj, new Vector3(p).translate(new Vector3(x, -.25, z)), new Vector3(playerViewOffset), Color.ORANGE, 1); - CoreRegistry.proxy().renderBeam(player.worldObj, new Vector3(p).translate(new Vector3(x, -.45, z)), new Vector3(playerViewOffset), Color.ORANGE, 1); - } - - } - - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World par2World, EntityPlayer player) - { - if (player.capabilities.isCreativeMode || this.getEnergy(itemStack) > this.wattPerShot) - { - player.setItemInUse(itemStack, this.getMaxItemUseDuration(itemStack)); - } - return itemStack; - } - - @Override - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer player, int par4) - { - if (miningMap.containsKey(player)) - { - miningMap.remove(player); - } - } - - @Override - public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) - { - return par1ItemStack; - } - - @SideOnly(Side.CLIENT) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) - { - super.addInformation(stack, player, list, par4); - if (stack.getTagCompound() == null) - { - stack.setTagCompound(new NBTTagCompound()); - } - String creator = stack.getTagCompound().getString("Creator"); - if (!creator.equalsIgnoreCase("creative") && creator != "") - { - list.add("Created by: " + creator); - } - else if (creator.equalsIgnoreCase("creative")) - { - list.add("Created by Magic Dwarfs"); - } - - } - - @Override - public long getEnergyCapacity(ItemStack theItem) - { - return this.batterySize; - } - - @Override - public boolean hasExtraConfigs() - { - return true; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - this.blockRange = config.get("Laser", "Range", this.blockRange).getInt(this.blockRange); - this.firingDelay = config.get("Laser", "Delay", this.firingDelay).getInt(this.firingDelay); - this.damageToEntities = (float) config.get("Laser", "Damage", this.damageToEntities).getDouble(this.damageToEntities); - this.batterySize = (config.get("Energy", "BatteryCap", this.batterySize).getInt()); - this.wattPerShot = (float) (config.get("Energy", "FiringCost", this.wattPerShot * 1000).getDouble(this.wattPerShot * 1000) / 1000); - this.setFire = config.get("Laser", "SetFire", true, "Set plants, and wood on fire").getBoolean(true); - this.createLava = config.get("Laser", "MakeLava", true, "Turn some blocks into lava like obby").getBoolean(true); - - } - - @Override - public void loadOreNames() - { - OreDictionary.registerOre("MiningLaserGun", this); - - } - -} diff --git a/archive/java/resonantinduction/old/mechanics/machine/mining/TileApertureExcavator.java b/archive/java/resonantinduction/old/mechanics/machine/mining/TileApertureExcavator.java deleted file mode 100644 index b52ffbf7..00000000 --- a/archive/java/resonantinduction/old/mechanics/machine/mining/TileApertureExcavator.java +++ /dev/null @@ -1,105 +0,0 @@ -package resonantinduction.old.mechanics.machine.mining; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.api.events.MachineMiningEvent; -import resonantinduction.core.prefab.tile.TileEntityEnergyMachine; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.InvInteractionHelper; - -/** @author Archadia */ -public class TileApertureExcavator extends TileEntityEnergyMachine -{ - private InvInteractionHelper invExtractionHelper; - private int lastY = -1; - - public TileApertureExcavator() - { - super(0, 3); - } - - public InvInteractionHelper invHelper() - { - if (invExtractionHelper == null || invExtractionHelper.world != this.worldObj) - { - this.invExtractionHelper = new InvInteractionHelper(this.worldObj, new Vector3(this), new ArrayList(), false); - } - return invExtractionHelper; - } - - @Override - public void updateEntity() - { - // TODO catch player place events and prevent them from placing blocks in the path of the - // drill head. This will save us time in coding blocks to represent the drill shafts - super.updateEntity(); - if (!worldObj.isRemote && this.isFunctioning()) - { - if (this.ticks % 20 == 0) - { - excavate(); - } - } - } - - @Override - public boolean canFunction() - { - return super.canFunction() && this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); - } - - public void excavate() - { - if (lastY == -1) - { - lastY = this.yCoord - 1; - } - for (int y = this.yCoord - 1; y > 0 && y < this.yCoord; y--) - { - Vector3 target = new Vector3(this.xCoord, y, this.zCoord); - if (this.consumePower(150, false)) - { - Block block = Block.blocksList[target.getBlockID(this.worldObj)]; - if (MachineMiningEvent.doMachineMiningCheck(this.worldObj, target, this)) - { - List items = MachineMiningEvent.getItemsMined(this, target); - if (items != null) - { - for (ItemStack stack : items) - { - this.dropItems(stack); - } - } - worldObj.setBlockToAir(target.intX(), target.intY(), target.intZ()); - this.consumePower(150, true); - } - else if (block != null) - { - break; - } - if (y < this.lastY) - { - this.lastY = y; - break; - } - } - } - } - - private void dropItems(ItemStack item) - { - if (item != null) - { - item = this.invHelper().storeItem(item, ForgeDirection.UP, ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST); - if (item != null) - { - this.invHelper().throwItem(new Vector3(this).modifyPositionFromSide(ForgeDirection.UP), item); - item = null; - } - } - } -} diff --git a/archive/java/resonantinduction/old/mechanics/machine/mining/TileFracker.java b/archive/java/resonantinduction/old/mechanics/machine/mining/TileFracker.java deleted file mode 100644 index 72d6efdd..00000000 --- a/archive/java/resonantinduction/old/mechanics/machine/mining/TileFracker.java +++ /dev/null @@ -1,133 +0,0 @@ -package resonantinduction.old.mechanics.machine.mining; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidBlock; -import net.minecraftforge.fluids.IFluidHandler; -import resonantinduction.core.prefab.tile.TileEntityEnergyMachine; -import resonantinduction.mechanical.fluid.EnumGas; -import resonantinduction.mechanical.fluid.GasTank; -import resonantinduction.old.core.recipe.RecipeLoader; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.multiblock.link.IBlockActivate; -import calclavia.lib.utility.FluidHelper; - -/** @author Archadia */ -public class TileFracker extends TileEntityEnergyMachine implements IFluidHandler, IBlockActivate -{ - public GasTank tank = new GasTank(10000); - - boolean autoEmpty = false; - - private Vector3 target; - - public TileFracker() - { - super(0, 5); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if (!worldObj.isRemote) - { - if (this.ticks % 20 == 0) - { - frack(); - System.out.println("Amt: " + tank.getFluidAmount()); - } - } - if (!this.worldObj.isRemote && autoEmpty && this.tank != null && this.tank.getFluid() != null) - { - FluidHelper.fillTanksAllSides(this.worldObj, new Vector3(this), FluidHelper.getStack(this.tank.getFluid(), 600), true); - } - } - - public void frack() - { - if (target == null) - { - target = new Vector3(xCoord, yCoord, zCoord); - } - if (target.intY() > 0) - { - if (this.getEnergyStored() >= 4) - { - target.translate(Vector3.DOWN()); - - int blockID = target.getBlockID(this.worldObj); - Block block = Block.blocksList[blockID]; - if (block != null) - { - if (block instanceof IFluidBlock) - { - FluidStack stack = ((IFluidBlock) block).drain(this.worldObj, target.intX(), target.intY(), target.intZ(), false); - if (stack != null && stack.getFluid().getID() == EnumGas.NATURAL_GAS.getGas().getID()) - { - tank.fill(new FluidStack(EnumGas.NATURAL_GAS.getGas(), 1000), true); - } - } - worldObj.setBlockToAir(target.intX(), target.intY(), target.intZ()); - this.consumePower(2, true); - } - worldObj.setBlock(target.intX(), target.intY(), target.intZ(), RecipeLoader.frackingPipe.blockID); - this.consumePower(500, true); - } - } - } - - @Override - public boolean onActivated(EntityPlayer entityPlayer) - { - entityPlayer.addChatMessage("Gas: " + tank.getFluidAmount()); - return 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.getFluid().containsFluid(resource)) - { - return tank.drain(resource.amount, true); - } - } - return null; - } - - @Override - public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) - { - return this.tank != null && this.tank.getFluid() != null ? this.drain(from, FluidHelper.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() }; - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/mechanics/machine/mining/TileFrackingPipe.java b/archive/java/resonantinduction/old/mechanics/machine/mining/TileFrackingPipe.java deleted file mode 100644 index 16f15852..00000000 --- a/archive/java/resonantinduction/old/mechanics/machine/mining/TileFrackingPipe.java +++ /dev/null @@ -1,9 +0,0 @@ -package resonantinduction.old.mechanics.machine.mining; - -import net.minecraft.tileentity.TileEntity; - -/** @author Archadia */ -public class TileFrackingPipe extends TileEntity -{ - -} diff --git a/archive/java/resonantinduction/old/mechanics/processor/BlockProcessor.java b/archive/java/resonantinduction/old/mechanics/processor/BlockProcessor.java deleted file mode 100644 index fd910b39..00000000 --- a/archive/java/resonantinduction/old/mechanics/processor/BlockProcessor.java +++ /dev/null @@ -1,204 +0,0 @@ -package resonantinduction.old.mechanics.processor; - -import java.util.List; -import java.util.Set; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.creativetab.CreativeTabs; -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.Configuration; -import net.minecraftforge.oredict.OreDictionary; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.mechanical.CommonProxy; -import resonantinduction.old.client.render.MechanicalBlockRenderingHandler; -import resonantinduction.old.client.render.RenderProcessor; -import resonantinduction.old.transport.ResonantInductionTransport; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dark.lib.IExtraInfo.IExtraBlockInfo; -import dark.lib.recipes.ProcessorType; - -public class BlockProcessor extends BlockMachine implements IExtraBlockInfo -{ - - public BlockProcessor() - { - super("OreProcessor"); - } - - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (entityPlayer != null) - { - if (world.isRemote) - { - return true; - } - else - { - entityPlayer.openGui(ResonantInductionTransport.instance, CommonProxy.GUI_PROCESSOR, world, x, y, z); - return true; - } - } - return false; - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (world.getBlockMetadata(x, y, z) % 4 < 3) - { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) + 1, 3); - return true; - } - else - { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) - 3, 3); - return true; - } - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("ALOreProcessor", TileEntityProcessor.class)); - } - - @Override - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - list.add(new Pair, TileEntitySpecialRenderer>(TileEntityProcessor.class, new RenderProcessor())); - } - - @Override - public TileEntity createTileEntity(World world, int metadata) - { - return new TileEntityProcessor(); - } - - @Override - public boolean hasExtraConfigs() - { - return true; - } - - @Override - public void loadExtraConfigs(Configuration config) - { - for (ProcessorData data : ProcessorData.values()) - { - data.enabled = config.get(data.unlocalizedName, "Enabled", true).getBoolean(true); - data.allowCrafting = config.get(data.unlocalizedName, "CanCraft", true).getBoolean(true); - data.wattPerTick = config.get(data.unlocalizedName, "WattPerTick", data.wattPerTick).getInt(); - data.processingTicks = config.get(data.unlocalizedName, "ProcessingTicks", data.processingTicks).getInt(); - if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) - { - data.doAnimation = config.get(data.unlocalizedName, "DoAnimation", true).getBoolean(true); - } - } - } - - @Override - public void loadOreNames() - { - for (ProcessorData data : ProcessorData.values()) - { - OreDictionary.registerOre(data.unlocalizedName + "OreProcessor", new ItemStack(this.blockID, 1, data.startMeta)); - } - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderType() - { - return MechanicalBlockRenderingHandler.BLOCK_RENDER_ID; - } - - @Override - public int damageDropped(int metadata) - { - return metadata / 4; - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - int id = idPicked(world, x, y, z); - - if (id == 0) - { - return null; - } - - Item item = Item.itemsList[id]; - - if (item == null) - { - return null; - } - - int metadata = getDamageValue(world, x, y, z); - - return new ItemStack(id, 1, metadata); - } - - @Override - public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List list) - { - for (ProcessorData data : ProcessorData.values()) - { - if (data.enabled) - { - list.add(new ItemStack(par1, 1, data.startMeta)); - } - } - } - - public static enum ProcessorData - { - CRUSHER(ProcessorType.CRUSHER, "crusher", 125, 100, 0), - GRINDER(ProcessorType.GRINDER, "grinder", 125, 120, 4); - // PRESS(ProcessorType.PRESS, "press", 200, 50, 8); - public ProcessorType type; - public String unlocalizedName; - public long wattPerTick; - public int processingTicks, startMeta; - public boolean enabled = true; - public boolean allowCrafting = true; - public boolean doAnimation = true; - - private ProcessorData(ProcessorType type, String name, long watts, int ticks, int meta) - { - this.type = type; - this.unlocalizedName = name; - this.wattPerTick = watts; - this.processingTicks = ticks; - this.startMeta = meta; - } - } - -} diff --git a/archive/java/resonantinduction/old/mechanics/processor/ContainerProcessor.java b/archive/java/resonantinduction/old/mechanics/processor/ContainerProcessor.java deleted file mode 100644 index 68271bca..00000000 --- a/archive/java/resonantinduction/old/mechanics/processor/ContainerProcessor.java +++ /dev/null @@ -1,160 +0,0 @@ -package resonantinduction.old.mechanics.processor; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.inventory.SlotFurnace; -import net.minecraft.item.ItemStack; -import universalelectricity.api.item.IEnergyItem; -import dark.lib.recipes.MachineRecipeHandler; - -public class ContainerProcessor extends Container -{ - private TileEntityProcessor tileEntity; - private int lastCookTime; - private int lastEnergyLevel; - private int lastItemBurnTime; - - public ContainerProcessor(InventoryPlayer par1InventoryPlayer, TileEntityProcessor tile) - { - this.tileEntity = tile; - this.addSlotToContainer(new Slot(tile, tile.slotInput, 37, 25)); - this.addSlotToContainer(new Slot(tile, tile.slotBatteryCharge, 144, 19)); - this.addSlotToContainer(new Slot(tile, tile.slotBatteryDrain, 144, 43)); - this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, tile, tile.slotOutput, 95, 27)); - - int i; - for (i = 0; i < 3; ++i) - { - for (int j = 0; j < 9; ++j) - { - this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (i = 0; i < 9; ++i) - { - this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public void addCraftingToCrafters(ICrafting par1ICrafting) - { - super.addCraftingToCrafters(par1ICrafting); - par1ICrafting.sendProgressBarUpdate(this, 0, this.tileEntity.processingTime); - par1ICrafting.sendProgressBarUpdate(this, 1, (int) this.tileEntity.getEnergyStored()); - par1ICrafting.sendProgressBarUpdate(this, 2, this.tileEntity.processingTicks); - } - - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - - if (this.lastCookTime != this.tileEntity.processingTime) - { - icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.processingTime); - } - - if (this.lastEnergyLevel != this.tileEntity.getEnergyStored()) - { - icrafting.sendProgressBarUpdate(this, 1, (int) this.tileEntity.getEnergyStored()); - } - - if (this.lastItemBurnTime != this.tileEntity.processingTicks) - { - icrafting.sendProgressBarUpdate(this, 2, this.tileEntity.processingTicks); - } - } - - this.lastCookTime = this.tileEntity.processingTime; - this.lastEnergyLevel = (int) this.tileEntity.getEnergyStored(); - this.lastItemBurnTime = this.tileEntity.processingTicks; - } - - @Override - public boolean canInteractWith(EntityPlayer par1EntityPlayer) - { - return this.tileEntity.isUseableByPlayer(par1EntityPlayer); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) - { - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(slotID); - - if (slot != null && slot.getHasStack()) - { - ItemStack slotStack = slot.getStack(); - itemstack = slotStack.copy(); - - if (slotID == 2) - { - if (!this.mergeItemStack(slotStack, 3, 39, true)) - { - return null; - } - - slot.onSlotChange(slotStack, itemstack); - } - else if (slotID != 1 && slotID != 0) - { - if (MachineRecipeHandler.getProcessorOutput(tileEntity.getProcessorData().type, slotStack) != null) - { - if (!this.mergeItemStack(slotStack, tileEntity.slotInput, 1, false)) - { - return null; - } - } - else if (slotStack.getItem() instanceof IEnergyItem) - { - if (!this.mergeItemStack(slotStack, tileEntity.slotBatteryCharge, 2, false)) - { - return null; - } - } - else if (slotID >= 3 && slotID < 30) - { - if (!this.mergeItemStack(slotStack, 30, 39, false)) - { - return null; - } - } - else if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(slotStack, 3, 30, false)) - { - return null; - } - } - else if (!this.mergeItemStack(slotStack, 3, 39, false)) - { - return null; - } - - if (slotStack.stackSize == 0) - { - slot.putStack((ItemStack) null); - } - else - { - slot.onSlotChanged(); - } - - if (slotStack.stackSize == itemstack.stackSize) - { - return null; - } - - slot.onPickupFromSlot(player, slotStack); - } - - return itemstack; - } -} diff --git a/archive/java/resonantinduction/old/mechanics/processor/TileEntityProcessor.java b/archive/java/resonantinduction/old/mechanics/processor/TileEntityProcessor.java deleted file mode 100644 index 82fc4d2a..00000000 --- a/archive/java/resonantinduction/old/mechanics/processor/TileEntityProcessor.java +++ /dev/null @@ -1,333 +0,0 @@ -package resonantinduction.old.mechanics.processor; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.tile.TileEntityEnergyMachine; -import resonantinduction.old.mechanics.processor.BlockProcessor.ProcessorData; -import universalelectricity.api.item.IEnergyItem; -import calclavia.lib.network.PacketHandler; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; -import dark.lib.interfaces.IInvBox; -import dark.lib.prefab.invgui.InvChest; -import dark.lib.recipes.MachineRecipeHandler; -import dark.lib.recipes.ProcessorType; - -/** - * Basic A -> B recipe processor machine designed mainly to handle ore blocks - * - * @author DarkGuardsman - */ -public class TileEntityProcessor extends TileEntityEnergyMachine -{ - public int slotInput = 0, slotOutput = 1, slotBatteryCharge = 2, slotBatteryDrain = 3; - - public int processingTicks = 0; - public int processingTime = 100; - public int renderStage = 1; - - public ProcessorData processorData; - - public boolean invertPiston = false; - protected ItemStack[] outputBuffer; - - public ProcessorData getProcessorData() - { - if (this.processorData == null) - { - this.processorData = ProcessorData.values()[this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) / 4]; - this.JOULES_PER_TICK = processorData.wattPerTick; - this.MAX_JOULES_STORED = this.JOULES_PER_TICK * 20; - - this.processingTime = processorData.processingTicks; - } - return processorData; - } - - @Override - public void updateEntity() - { - this.getProcessorData(); - super.updateEntity(); - if (!this.worldObj.isRemote) - { - if (this.outputBuffer != null) - { - int nullCount = 0; - for (int i = 0; i < outputBuffer.length; i++) - { - ItemStack outputStack = this.getInventory().getStackInSlot(this.slotOutput); - - if (outputBuffer[i] == null) - { - nullCount += 1; - } - else if (outputStack == null) - { - this.getInventory().setInventorySlotContents(this.slotOutput, outputBuffer[i].copy()); - outputBuffer[i] = null; - this.onInventoryChanged(); - } - else if (outputBuffer[i] != null && outputBuffer[i].isItemEqual(outputStack)) - { - ItemStack outStack = outputStack.copy(); - int room = Math.min(outputStack.getMaxStackSize() - outputStack.stackSize, this.getInventoryStackLimit()); - if (room >= outputBuffer[i].stackSize) - { - - outStack.stackSize += outputBuffer[i].stackSize; - outputBuffer[i] = null; - } - else - { - int extract = outputBuffer[i].stackSize - (outputBuffer[i].stackSize - room); - outputBuffer[i].stackSize -= extract; - outStack.stackSize += extract; - - } - - this.getInventory().setInventorySlotContents(this.slotOutput, outStack); - this.onInventoryChanged(); - } - - } - if (nullCount >= outputBuffer.length) - { - outputBuffer = null; - } - } - } - if (this.isFunctioning()) - { - - if (!this.worldObj.isRemote) - { - if (outputBuffer == null && this.processingTicks++ >= this.processingTime) - { - this.process(); - this.processingTicks = 0; - } - } - else - { - if (this.processorData.doAnimation) - { - this.updateAnimation(); - } - } - } - } - - /** Updates the animation calculation for the renderer to use */ - public void updateAnimation() - { - if (this.getProcessorData().type == ProcessorType.CRUSHER) - { - if (invertPiston) - { - if (renderStage-- <= 0) - { - invertPiston = false; - } - } - else - { - if (renderStage++ >= 8) - { - invertPiston = true; - } - } - } - else - { - if (renderStage++ >= 8) - { - renderStage = 1; - } - } - } - - @Override - public boolean canFunction() - { - return super.canFunction() && this.canProcess(); - } - - /** Can the machine process the itemStack */ - public boolean canProcess() - { - ItemStack inputStack = this.getInventory().getStackInSlot(this.slotInput); - ItemStack outputStack = this.getInventory().getStackInSlot(this.slotOutput); - if (inputStack != null) - { - inputStack = inputStack.copy(); - inputStack.stackSize = 1; - ItemStack[] outputResult = MachineRecipeHandler.getProcessorOutput(this.getProcessorData().type, inputStack); - if (outputResult != null) - { - if (outputStack == null) - { - return true; - } - else - { - for (int i = 0; i < outputResult.length; i++) - { - if (outputResult[i] != null && outputResult[i].isItemEqual(outputStack)) - { - if (Math.min(outputStack.getMaxStackSize() - outputStack.stackSize, this.getInventoryStackLimit()) >= outputResult[i].stackSize) - { - return true; - } - } - } - } - } - } - return false; - } - - /** Processes the itemStack */ - public void process() - { - ItemStack inputSlotStack = this.getInventory().getStackInSlot(this.slotInput); - if (inputSlotStack != null) - { - - inputSlotStack = inputSlotStack.copy(); - inputSlotStack.stackSize = 1; - ItemStack[] receipeResult = MachineRecipeHandler.getProcessorOutput(this.getProcessorData().type, inputSlotStack); - if (receipeResult != null && this.outputBuffer == null) - { - this.getInventory().decrStackSize(this.slotInput, 1); - this.outputBuffer = receipeResult; - } - } - } - - @Override - public IInvBox getInventory() - { - if (inventory == null) - { - inventory = new InvChest(this, 4); - } - return inventory; - } - - @Override - public boolean canStore(ItemStack stack, int slot, ForgeDirection side) - { - if (stack != null) - { - if (slotInput == slot && MachineRecipeHandler.getProcessorOutput(this.getProcessorData().type, stack) != null) - { - return true; - } - if (slotBatteryDrain == slot && stack.getItem() instanceof IEnergyItem) - { - return true; - } - } - return false; - } - - @Override - public boolean canRemove(ItemStack stack, int slot, ForgeDirection side) - { - return slot != slotInput; - } - - @Override - public int[] getAccessibleSlotsFromSide(int side) - { - if (side == ForgeDirection.DOWN.ordinal()) - { - return new int[] { slotOutput }; - } - if (side == ForgeDirection.UP.ordinal()) - { - return new int[] { slotInput }; - } - return new int[] { slotBatteryDrain, slotInput, slotOutput }; - } - - @Override - public ForgeDirection getDirection() - { - if (this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 0) - { - return ForgeDirection.NORTH; - } - return ForgeDirection.EAST; - } - - @Override - public String getInvName() - { - if (this.getProcessorData() != null) - { - return "gui." + getProcessorData().unlocalizedName + ".name"; - } - return "gui.processor.name"; - } - - @Override - public Packet getGUIPacket() - { - return PacketHandler.instance().getTilePacket(this.getChannel(), SimplePacketTypes.GUI.name, this, this.processingTicks, this.processingTime, this.energyStored); - - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput dis, Player player) - { - if (!super.simplePacket(id, dis, player)) - { - try - { - if (this.worldObj.isRemote) - { - if (id.equalsIgnoreCase(SimplePacketTypes.GUI.name)) - { - this.processingTicks = dis.readInt(); - this.processingTime = dis.readInt(); - this.setEnergy(ForgeDirection.UNKNOWN, dis.readLong()); - return true; - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - } - return false; - } - - /** NBT Data */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.processingTicks = nbt.getInteger("processingTicks"); - this.renderStage = nbt.getInteger("renderStage"); - this.getInventory().loadInv(nbt); - - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("processingTicks", this.processingTicks); - nbt.setInteger("renderStage", this.renderStage); - this.getInventory().saveInv(nbt); - - } - -} diff --git a/archive/java/resonantinduction/old/mechanics/purifier/BlockPurifier.java b/archive/java/resonantinduction/old/mechanics/purifier/BlockPurifier.java deleted file mode 100644 index 6edf32cd..00000000 --- a/archive/java/resonantinduction/old/mechanics/purifier/BlockPurifier.java +++ /dev/null @@ -1,79 +0,0 @@ -package resonantinduction.old.mechanics.purifier; - -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.block.BlockRotatableBase; -import resonantinduction.mechanical.grinder.TilePurifier; -import universalelectricity.api.vector.VectorWorld; - -/** - * A block used to build machines. - * - * @author Calclavia - * - */ -public class BlockPurifier extends BlockRotatableBase implements ITileEntityProvider -{ - public BlockPurifier(int id) - { - super("purifier", id); - } - - @Override - public void onBlockAdded(World world, int x, int y, int z) - { - this.checkConflicts(world, x, y, z); - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, int par5) - { - this.checkConflicts(world, x, y, z); - } - - /** - * Checks for any conflicting directions with other grinders. - */ - private void checkConflicts(World world, int x, int y, int z) - { - ForgeDirection facing = this.getDirection(world, x, y, z); - - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir != facing && dir != facing.getOpposite()) - { - VectorWorld checkPos = (VectorWorld) new VectorWorld(world, x, y, z).modifyPositionFromSide(dir); - TileEntity tileEntity = checkPos.getTileEntity(); - - if (tileEntity instanceof TilePurifier) - { - if (this.getDirection(world, checkPos.intX(), checkPos.intY(), checkPos.intZ()) == facing) - { - this.dropBlockAsItem(world, x, y, z, 0, 0); - world.setBlockToAir(x, y, z); - } - } - } - } - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TilePurifier(); - } -} diff --git a/archive/java/resonantinduction/old/transport/CommonProxy.java b/archive/java/resonantinduction/old/transport/CommonProxy.java deleted file mode 100644 index aa9b59b2..00000000 --- a/archive/java/resonantinduction/old/transport/CommonProxy.java +++ /dev/null @@ -1,168 +0,0 @@ -package resonantinduction.old.transport; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import resonantinduction.old.mechanics.processor.ContainerProcessor; -import resonantinduction.old.mechanics.processor.TileEntityProcessor; -import resonantinduction.old.transport.encoder.ContainerEncoder; -import resonantinduction.old.transport.encoder.TileEntityEncoder; -import resonantinduction.old.transport.imprinter.ContainerImprinter; -import resonantinduction.old.transport.imprinter.TileEntityImprinter; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.network.IGuiHandler; -import dark.lib.prefab.invgui.ContainerFake; - -public class CommonProxy implements IGuiHandler -{ - public static final int GUI_IMPRINTER = 1; - public static final int GUI_ENCODER = 2; - public static final int GUI_ENCODER_CODE = 3; - public static final int GUI_ENCODER_HELP = 4; - public static final int GUI_PROCESSOR = 5; - public static final int GUI_MANIPULATOR = 6; - public static final int GUI_COAL_GEN = 7; - public static final int GUI_FUEL_GEN = 8; - public static final int GUI_FURNACE_ELEC = 9; - public static final int GUI_BATTERY_BOX = 10; - - public void preInit() - { - - } - - public void init() - { - - } - - public void postInit() - { - - } - - private void extractZipToLocation(File zipFile, String sourceFolder, String destFolder) - { - try - { - - File destFile = new File(FMLCommonHandler.instance().getMinecraftServerInstance().getFile("."), destFolder); - String destinationName = destFile.getAbsolutePath(); - byte[] buf = new byte[1024]; - ZipInputStream zipinputstream = null; - ZipEntry zipentry; - zipinputstream = new ZipInputStream(new FileInputStream(zipFile)); - - zipentry = zipinputstream.getNextEntry(); - while (zipentry != null) - { - // for each entry to be extracted - String zipentryName = zipentry.getName(); - if (!zipentryName.startsWith(sourceFolder)) - { - zipentry = zipinputstream.getNextEntry(); - continue; - } - - String entryName = destinationName + zipentryName.substring(Math.min(zipentryName.length(), sourceFolder.length() - 1)); - entryName = entryName.replace('/', File.separatorChar); - entryName = entryName.replace('\\', File.separatorChar); - int n; - FileOutputStream fileoutputstream; - File newFile = new File(entryName); - if (zipentry.isDirectory()) - { - if (!newFile.mkdirs()) - { - break; - } - zipentry = zipinputstream.getNextEntry(); - continue; - } - - fileoutputstream = new FileOutputStream(entryName); - - while ((n = zipinputstream.read(buf, 0, 1024)) > -1) - { - fileoutputstream.write(buf, 0, n); - } - - fileoutputstream.close(); - zipinputstream.closeEntry(); - zipentry = zipinputstream.getNextEntry(); - - }// while - - zipinputstream.close(); - } - catch (Exception e) - { - System.out.println("Error while loading AssemblyLine Lua libraries: "); - e.printStackTrace(); - } - } - - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity != null) - { - switch (ID) - { - case GUI_IMPRINTER: - { - return new ContainerImprinter(player.inventory, (TileEntityImprinter) tileEntity); - } - case GUI_ENCODER: - { - if (tileEntity instanceof TileEntityEncoder) - { - return new ContainerEncoder(player.inventory, (TileEntityEncoder) tileEntity); - } - } - case GUI_PROCESSOR: - { - return new ContainerProcessor(player.inventory, (TileEntityProcessor) tileEntity); - } - case GUI_MANIPULATOR: - { - return new ContainerProcessor(player.inventory, (TileEntityProcessor) tileEntity); - } - case GUI_COAL_GEN: - if (tileEntity instanceof TileEntitySteamGen) - { - return new ContainerCoalGenerator(player.inventory, ((TileEntitySteamGen) tileEntity)); - } - case GUI_BATTERY_BOX: - if (tileEntity instanceof TileBatteryBox) - { - return new ContainerBatteryBox(player.inventory, (TileBatteryBox) tileEntity); - } - default: - return new ContainerFake(tileEntity); - } - } - - return null; - } - - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - return null; - } - - public boolean isCtrKeyDown() - { - return false; - } - -} diff --git a/archive/java/resonantinduction/old/transport/ContainerFilter.java b/archive/java/resonantinduction/old/transport/ContainerFilter.java deleted file mode 100644 index 82302663..00000000 --- a/archive/java/resonantinduction/old/transport/ContainerFilter.java +++ /dev/null @@ -1,53 +0,0 @@ -package resonantinduction.old.transport; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import resonantinduction.core.prefab.tile.TileEntityFilterable; - -public class ContainerFilter extends Container -{ - private TileEntityFilterable tileEntity; - - public ContainerFilter(InventoryPlayer playerInv, TileEntityFilterable tile) - { - this.tileEntity = tile; - this.addSlotToContainer(new Slot(tile, TileEntityFilterable.FILTER_SLOT, 37, 25)); - this.addSlotToContainer(new Slot(tile, TileEntityFilterable.BATERY_DRAIN_SLOT, 144, 43)); - - int i; - for (i = 0; i < 3; ++i) - { - for (int j = 0; j < 9; ++j) - { - this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (i = 0; i < 9; ++i) - { - this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142)); - } - } - - @Override - public void addCraftingToCrafters(ICrafting par1ICrafting) - { - super.addCraftingToCrafters(par1ICrafting); - } - - @Override - public boolean canInteractWith(EntityPlayer par1EntityPlayer) - { - return this.tileEntity.isUseableByPlayer(par1EntityPlayer); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) - { - return null; - } -} diff --git a/archive/java/resonantinduction/old/transport/NetworkAssembly.java b/archive/java/resonantinduction/old/transport/NetworkAssembly.java deleted file mode 100644 index d12323c4..00000000 --- a/archive/java/resonantinduction/old/transport/NetworkAssembly.java +++ /dev/null @@ -1,51 +0,0 @@ -package resonantinduction.old.transport; - -import resonantinduction.core.tilenetwork.INetworkPart; -import resonantinduction.core.tilenetwork.prefab.NetworkSharedPower; -import resonantinduction.core.tilenetwork.prefab.NetworkUpdateHandler; - -public class NetworkAssembly extends NetworkSharedPower -{ - private long networkPartEnergyRequest = 0; - private long lastUpdateTime = 0; - static - { - NetworkUpdateHandler.registerNetworkClass("AssemblyNet", NetworkAssembly.class); - } - - public NetworkAssembly() - { - super(); - } - - public NetworkAssembly(INetworkPart... parts) - { - super(parts); - } - - /** Gets the demand of all parts of the network including network parts */ - public float getNetworkDemand() - { - if (System.currentTimeMillis() - this.lastUpdateTime > 100) - { - this.networkPartEnergyRequest = 0; - this.lastUpdateTime = System.currentTimeMillis(); - for (INetworkPart part : this.getMembers()) - { - if (part instanceof TileEntityAssembly) - { - networkPartEnergyRequest += ((TileEntityAssembly) part).getWattLoad(); - networkPartEnergyRequest += ((TileEntityAssembly) part).getExtraLoad(); - } - } - } - return networkPartEnergyRequest; - } - - @Override - public boolean isValidMember(INetworkPart part) - { - return super.isValidMember(part) && part instanceof TileEntityAssembly; - } - -} diff --git a/archive/java/resonantinduction/old/transport/ResonantInductionTransport.java b/archive/java/resonantinduction/old/transport/ResonantInductionTransport.java deleted file mode 100644 index 2b191187..00000000 --- a/archive/java/resonantinduction/old/transport/ResonantInductionTransport.java +++ /dev/null @@ -1,379 +0,0 @@ -package resonantinduction.old.transport; - -import java.io.File; -import java.util.Arrays; -import java.util.logging.Logger; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockDispenser; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.Configuration; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.oredict.OreDictionary; - -import org.modstats.Modstats; - -import resonantinduction.archaic.blocks.BlockColorGlass; -import resonantinduction.archaic.blocks.BlockColorGlowGlass; -import resonantinduction.archaic.blocks.BlockColorSand; -import resonantinduction.archaic.blocks.BlockTurntable; -import resonantinduction.archaic.blocks.ItemBlockColored; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.debug.BlockDebug; -import resonantinduction.core.network.PacketIDTile; -import resonantinduction.core.resource.BlockGasOre; -import resonantinduction.core.resource.BlockOre; -import resonantinduction.core.resource.BlockOre.OreData; -import resonantinduction.core.resource.GasOreGenerator; -import resonantinduction.core.resource.item.ItemBlockOre; -import resonantinduction.core.resource.item.ItemParts; -import resonantinduction.core.resource.item.ItemParts.Parts; -import resonantinduction.core.tilenetwork.prefab.NetworkUpdateHandler; -import resonantinduction.electrical.armbot.BlockArmbot; -import resonantinduction.electrical.armbot.command.TaskBreak; -import resonantinduction.electrical.armbot.command.TaskDrop; -import resonantinduction.electrical.armbot.command.TaskEnd; -import resonantinduction.electrical.armbot.command.TaskFire; -import resonantinduction.electrical.armbot.command.TaskGOTO; -import resonantinduction.electrical.armbot.command.TaskGive; -import resonantinduction.electrical.armbot.command.TaskGrabEntity; -import resonantinduction.electrical.armbot.command.TaskGrabItem; -import resonantinduction.electrical.armbot.command.TaskHarvest; -import resonantinduction.electrical.armbot.command.TaskIF; -import resonantinduction.electrical.armbot.command.TaskIdle; -import resonantinduction.electrical.armbot.command.TaskPlace; -import resonantinduction.electrical.armbot.command.TaskReturn; -import resonantinduction.electrical.armbot.command.TaskRotateBy; -import resonantinduction.electrical.armbot.command.TaskRotateTo; -import resonantinduction.electrical.armbot.command.TaskStart; -import resonantinduction.electrical.armbot.command.TaskTake; -import resonantinduction.electrical.armbot.command.TaskUse; -import resonantinduction.electrical.generator.solar.BlockSolarPanel; -import resonantinduction.electrical.multimeter.ItemReadoutTools; -import resonantinduction.mechanical.belt.BlockConveyorBelt; -import resonantinduction.mechanical.fluid.BlockKitchenSink; -import resonantinduction.mechanical.fluid.BlockReleaseValve; -import resonantinduction.mechanical.fluid.BlockTank; -import resonantinduction.mechanical.fluid.EnumGas; -import resonantinduction.mechanical.fluid.ItemFluidCan; -import resonantinduction.mechanical.fluid.pipes.BlockPipe; -import resonantinduction.mechanical.fluid.pipes.FluidPartsMaterial; -import resonantinduction.mechanical.fluid.pipes.ItemBlockPipe; -import resonantinduction.mechanical.fluid.pump.BlockConstructionPump; -import resonantinduction.mechanical.fluid.pump.BlockDrain; -import resonantinduction.mechanical.fluid.pump.BlockPumpMachine; -import resonantinduction.old.api.coding.TaskRegistry; -import resonantinduction.old.core.ItemOreDirv; -import resonantinduction.old.core.misc.BehaviorDispenseEgg; -import resonantinduction.old.core.misc.EntityFarmEgg; -import resonantinduction.old.core.misc.EnumBird; -import resonantinduction.old.core.misc.ItemColoredDust; -import resonantinduction.old.core.misc.ItemCommonTool; -import resonantinduction.old.core.misc.ItemFarmEgg; -import resonantinduction.old.core.recipe.RecipeLoader; -import resonantinduction.old.mechanics.processor.BlockProcessor; -import resonantinduction.old.transport.crate.BlockCrate; -import resonantinduction.old.transport.crate.ItemBlockCrate; -import resonantinduction.old.transport.encoder.BlockEncoder; -import resonantinduction.old.transport.encoder.ItemDisk; -import resonantinduction.old.transport.hopper.BlockAdvancedHopper; -import resonantinduction.old.transport.imprinter.BlockImprinter; -import resonantinduction.old.transport.imprinter.ItemImprinter; -import resonantinduction.old.transport.logistic.BlockDetector; -import resonantinduction.old.transport.logistic.BlockManipulator; -import resonantinduction.old.transport.logistic.BlockRejector; -import calclavia.lib.ore.OreGenReplaceStone; -import calclavia.lib.ore.OreGenerator; -import calclavia.lib.prefab.item.ItemBlockHolder; -import calclavia.lib.utility.FluidHelper; -import calclavia.lib.utility.PlayerKeyHandler; -import calclavia.lib.utility.SaveManager; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.Mod.Metadata; -import cpw.mods.fml.common.ModMetadata; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.TickRegistry; -import cpw.mods.fml.relauncher.Side; -import dark.lib.CoreRegistry; -import dark.lib.EnumMaterial; -import dark.lib.EnumOrePart; -import dark.lib.LaserEntityDamageSource; - -//@Mod(modid = ResonantInductionTransport.MOD_ID, name = ResonantInductionTransport.MOD_NAME, version = ResonantInductionTransport.VERSION, useMetadata = true) -//@NetworkMod(channels = { ResonantInductionTransport.CHANNEL }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) -public class ResonantInductionTransport -{ - public static final String TEXTURE_DIRECTORY = "textures/"; - public static final String BLOCK_DIRECTORY = TEXTURE_DIRECTORY + "blocks/"; - public static final String ITEM_DIRECTORY = TEXTURE_DIRECTORY + "items/"; - public static final String MODEL_DIRECTORY = TEXTURE_DIRECTORY + "models/"; - public static final String GUI_DIRECTORY = TEXTURE_DIRECTORY + "gui/"; - public static final String CHANNEL = "ALChannel"; - - // @Mod - public static final String MOD_ID = "AssemblyLine"; - public static final String MOD_NAME = "Assembly Line"; - - public static final String DOMAIN = "al"; - public static final String PREFIX = DOMAIN + ":"; - - public static String DIRECTORY_NO_SLASH = "assets/" + DOMAIN + "/"; - public static String DIRECTORY = "/" + DIRECTORY_NO_SLASH; - public static String LANGUAGE_PATH = DIRECTORY + "languages/"; - public static String SOUND_PATH = DIRECTORY + "audio/"; - - // @SidedProxy(clientSide = "com.builtbroken.assemblyline.client.ClientProxy", serverSide = - // "com.builtbroken.assemblyline.CommonProxy") - public static CommonProxy proxy; - - @Instance(ResonantInductionTransport.MOD_ID) - public static ResonantInductionTransport instance; - - @Metadata(ResonantInductionTransport.MOD_ID) - public static ModMetadata meta; - - private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US", "de_DE" }; - - public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), "AssemblyLine.cfg")); - - public static Logger FMLog = Logger.getLogger(ResonantInductionTransport.MOD_NAME); - - public static boolean VINALLA_RECIPES = false; - - public static int entitiesIds = 60; - - private static PacketIDTile tilePacket; - - public static PacketIDTile getTilePacket() - { - if (tilePacket == null) - { - tilePacket = new PacketIDTile(ResonantInductionTransport.CHANNEL); - } - return tilePacket; - } - - @EventHandler - public void preInit(FMLPreInitializationEvent event) - { - CONFIGURATION.load(); - - DarkCore.instance().preLoad(); - Modstats.instance().getReporter().registerMod(this); - MinecraftForge.EVENT_BUS.register(this); - MinecraftForge.EVENT_BUS.register(new FluidHelper()); - MinecraftForge.EVENT_BUS.register(SaveManager.instance()); - TickRegistry.registerTickHandler(NetworkUpdateHandler.instance(), Side.SERVER); - TickRegistry.registerScheduledTickHandler(new PlayerKeyHandler(ResonantInductionTransport.CHANNEL), Side.CLIENT); - MinecraftForge.EVENT_BUS.register(new LaserEntityDamageSource(null)); - NetworkRegistry.instance().registerGuiHandler(this, proxy); - - TaskRegistry.registerCommand(new TaskDrop()); - TaskRegistry.registerCommand(new TaskGive()); - TaskRegistry.registerCommand(new TaskTake()); - TaskRegistry.registerCommand(new TaskGrabItem()); - TaskRegistry.registerCommand(new TaskGrabEntity()); - TaskRegistry.registerCommand(new TaskRotateBy()); - TaskRegistry.registerCommand(new TaskRotateTo()); - TaskRegistry.registerCommand(new TaskUse()); - TaskRegistry.registerCommand(new TaskIF()); - TaskRegistry.registerCommand(new TaskGOTO()); - TaskRegistry.registerCommand(new TaskReturn()); - TaskRegistry.registerCommand(new TaskEnd()); - TaskRegistry.registerCommand(new TaskFire()); - TaskRegistry.registerCommand(new TaskHarvest()); - TaskRegistry.registerCommand(new TaskPlace()); - TaskRegistry.registerCommand(new TaskBreak()); - TaskRegistry.registerCommand(new TaskStart()); - TaskRegistry.registerCommand(new TaskIdle()); - - this.registerObjects(); - proxy.preInit(); - } - - @EventHandler - public void init(FMLInitializationEvent event) - { - DarkCore.instance().Load(); - - FMLog.info("Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " languages."); - - for (EnumGas gas : EnumGas.values()) - { - FluidRegistry.registerFluid(gas.getGas()); - } - if (RecipeLoader.blockGas != null) - { - EnumGas.NATURAL_GAS.getGas().setBlockID(RecipeLoader.blockGas); - } - if (RecipeLoader.blockGas != null) - { - GameRegistry.registerWorldGenerator(new GasOreGenerator()); - } - if (RecipeLoader.blockOre != null) - { - for (OreData data : OreData.values()) - { - if (data.doWorldGen) - { - OreGenReplaceStone gen = data.getGeneratorSettings(); - if (gen != null) - { - OreGenerator.addOre(gen); - } - } - } - } - if (RecipeLoader.itemParts != null) - { - for (Parts part : Parts.values()) - { - OreDictionary.registerOre(part.name, new ItemStack(RecipeLoader.itemParts, 1, part.ordinal())); - } - } - proxy.init(); - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) - { - DarkCore.instance().postLoad(); - proxy.postInit(); - RecipeLoader.instance().loadRecipes(); - CONFIGURATION.save(); - } - - /** Separated method for registering & creating objects */ - public void registerObjects() - { - - /* BLOCKS */ - RecipeLoader.blockManipulator = CoreRegistry.createNewBlock("Manipulator", ResonantInductionTransport.MOD_ID, BlockManipulator.class); - RecipeLoader.blockCrate = (BlockCrate) CoreRegistry.createNewBlock("Crate", ResonantInductionTransport.MOD_ID, BlockCrate.class, ItemBlockCrate.class); - RecipeLoader.blockImprinter = CoreRegistry.createNewBlock("Imprinter", ResonantInductionTransport.MOD_ID, BlockImprinter.class); - RecipeLoader.blockDetector = CoreRegistry.createNewBlock("Detector", ResonantInductionTransport.MOD_ID, BlockDetector.class); - - RecipeLoader.blockRejector = CoreRegistry.createNewBlock("Rejector", ResonantInductionTransport.MOD_ID, BlockRejector.class); - RecipeLoader.blockEncoder = CoreRegistry.createNewBlock("Encoder", ResonantInductionTransport.MOD_ID, BlockEncoder.class); - RecipeLoader.blockArmbot = CoreRegistry.createNewBlock("Armbot", ResonantInductionTransport.MOD_ID, BlockArmbot.class); - RecipeLoader.blockTurntable = CoreRegistry.createNewBlock("Turntable", ResonantInductionTransport.MOD_ID, BlockTurntable.class); - RecipeLoader.processorMachine = CoreRegistry.createNewBlock("ALBlockProcessor", ResonantInductionTransport.MOD_ID, BlockProcessor.class, ItemBlockHolder.class); - - RecipeLoader.blockAdvancedHopper = CoreRegistry.createNewBlock("ALBlockHopper", ResonantInductionTransport.MOD_ID, BlockAdvancedHopper.class, ItemBlockHolder.class); - RecipeLoader.blockPipe = CoreRegistry.createNewBlock("FMBlockPipe", ResonantInductionTransport.MOD_ID, BlockPipe.class, ItemBlockPipe.class); - RecipeLoader.blockPumpMachine = CoreRegistry.createNewBlock("FMBlockPump", ResonantInductionTransport.MOD_ID, BlockPumpMachine.class, ItemBlockHolder.class); - RecipeLoader.blockReleaseValve = CoreRegistry.createNewBlock("FMBlockReleaseValve", ResonantInductionTransport.MOD_ID, BlockReleaseValve.class, ItemBlockHolder.class); - RecipeLoader.blockTank = CoreRegistry.createNewBlock("FMBlockTank", ResonantInductionTransport.MOD_ID, BlockTank.class, ItemBlockPipe.class); - - RecipeLoader.blockSink = CoreRegistry.createNewBlock("FMBlockSink", ResonantInductionTransport.MOD_ID, BlockKitchenSink.class, ItemBlockHolder.class); - RecipeLoader.blockDrain = CoreRegistry.createNewBlock("FMBlockDrain", ResonantInductionTransport.MOD_ID, BlockDrain.class, ItemBlockHolder.class); - RecipeLoader.blockConPump = CoreRegistry.createNewBlock("FMBlockConstructionPump", ResonantInductionTransport.MOD_ID, BlockConstructionPump.class, ItemBlockHolder.class); - RecipeLoader.blockSteamGen = CoreRegistry.createNewBlock("DMBlockSteamMachine", ResonantInductionTransport.MOD_ID, BlockSmallSteamGen.class, ItemBlockHolder.class); - RecipeLoader.blockOre = CoreRegistry.createNewBlock("DMBlockOre", ResonantInductionTransport.MOD_ID, BlockOre.class, ItemBlockOre.class); - - RecipeLoader.blockWire = CoreRegistry.createNewBlock("DMBlockWire", ResonantInductionTransport.MOD_ID, BlockWire.class, ItemBlockWire.class); - RecipeLoader.blockDebug = CoreRegistry.createNewBlock("DMBlockDebug", ResonantInductionTransport.MOD_ID, BlockDebug.class, ItemBlockHolder.class); - RecipeLoader.blockStainGlass = CoreRegistry.createNewBlock("DMBlockStainedGlass", ResonantInductionTransport.MOD_ID, BlockColorGlass.class, ItemBlockColored.class); - RecipeLoader.blockColorSand = CoreRegistry.createNewBlock("DMBlockColorSand", ResonantInductionTransport.MOD_ID, BlockColorSand.class, ItemBlockColored.class); - RecipeLoader.blockBasalt = CoreRegistry.createNewBlock("DMBlockBasalt", ResonantInductionTransport.MOD_ID, BlockBasalt.class, ItemBlockColored.class); - - RecipeLoader.blockGlowGlass = CoreRegistry.createNewBlock("DMBlockGlowGlass", ResonantInductionTransport.MOD_ID, BlockColorGlowGlass.class, ItemBlockColored.class); - RecipeLoader.blockSolar = CoreRegistry.createNewBlock("DMBlockSolar", ResonantInductionTransport.MOD_ID, BlockSolarPanel.class, ItemBlockHolder.class); - RecipeLoader.blockGas = CoreRegistry.createNewBlock("DMBlockGas", ResonantInductionTransport.MOD_ID, BlockGasOre.class, ItemBlockHolder.class); - RecipeLoader.blockBatBox = CoreRegistry.createNewBlock("DMBlockBatBox", ResonantInductionTransport.MOD_ID, BlockBatteryBox.class, ItemBlockEnergyStorage.class); - - /* ITEMS */ - RecipeLoader.itemTool = CoreRegistry.createNewItem("DMReadoutTools", ResonantInductionTransport.MOD_ID, ItemReadoutTools.class, true); - RecipeLoader.battery = CoreRegistry.createNewItem("DMItemBattery", ResonantInductionTransport.MOD_ID, ItemBattery.class, true); - RecipeLoader.wrench = CoreRegistry.createNewItem("DMWrench", ResonantInductionTransport.MOD_ID, ItemWrench.class, true); - RecipeLoader.itemGlowingSand = CoreRegistry.createNewItem("DMItemGlowingSand", ResonantInductionTransport.MOD_ID, ItemColoredDust.class, true); - RecipeLoader.itemDiggingTool = CoreRegistry.createNewItem("ItemDiggingTools", ResonantInductionTransport.MOD_ID, ItemCommonTool.class, true); - - RecipeLoader.itemVehicleTest = CoreRegistry.createNewItem("ItemVehicleTest", ResonantInductionTransport.MOD_ID, ItemVehicleSpawn.class, true); - RecipeLoader.itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", DarkCore.getNextItemId()).getInt()); - RecipeLoader.itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", DarkCore.getNextItemId()).getInt()); - RecipeLoader.itemFluidCan = CoreRegistry.createNewItem("ItemFluidCan", ResonantInductionTransport.MOD_ID, ItemFluidCan.class, true); - RecipeLoader.itemParts = CoreRegistry.createNewItem("DMCraftingParts", ResonantInductionTransport.MOD_ID, ItemParts.class, true); - - RecipeLoader.itemMetals = CoreRegistry.createNewItem("DMOreDirvParts", ResonantInductionTransport.MOD_ID, ItemOreDirv.class, true); - // ALRecipeLoader.itemMPWire = CoreRegistry.createNewItem("DMMPWire", AssemblyLine.MOD_ID, - // ItemWire.class, true); - - TileEntityAssembly.refresh_diff = CONFIGURATION.get("TileSettings", "RefreshRandomRange", 9, "n = value of config, 1 + n, random number range from 1 to n that will be added to the lowest refresh value").getInt(); - TileEntityAssembly.refresh_min_rate = CONFIGURATION.get("TileSettings", "RefreshLowestValue", 20, "Lowest value the refresh rate of the tile network will be").getInt(); - - // Entities - if (ResonantInductionTransport.CONFIGURATION.get("Override", "Eggs", true).getBoolean(true)) - { - Item.itemsList[Item.egg.itemID] = null; - Item.egg = null; - Item.egg = new ItemFarmEgg(88); - GameRegistry.registerItem(Item.egg, "FTEgg", MOD_ID); - EntityRegistry.registerGlobalEntityID(EntityFarmEgg.class, "FarmEgg", EntityRegistry.findGlobalUniqueEntityId()); - EntityRegistry.registerModEntity(EntityFarmEgg.class, "FarmEgg", entitiesIds++, this, 64, 1, true); - BlockDispenser.dispenseBehaviorRegistry.putObject(Item.egg, new BehaviorDispenseEgg()); - } - - EntityRegistry.registerGlobalEntityID(EntityTestCar.class, "TestCar", EntityRegistry.findGlobalUniqueEntityId()); - EntityRegistry.registerModEntity(EntityTestCar.class, "TestCar", 60, this, 64, 1, true); - - for (EnumBird bird : EnumBird.values()) - { - if (bird != EnumBird.VANILLA_CHICKEN && CONFIGURATION.get("Entities", "Enable_" + bird.name(), true).getBoolean(true)) - { - bird.register(); - } - } - // Post object creation, normally creative tab icon setup - if (RecipeLoader.blockPipe != null) - { - ResonantInductionTabs.tabHydraulic().setIconItemStack(FluidPartsMaterial.IRON.getStack()); - } - else - { - ResonantInductionTabs.tabHydraulic().setIconItemStack(new ItemStack(Item.bucketWater)); - } - if (RecipeLoader.itemMetals != null) - { - ResonantInductionTabs.tabIndustrial().itemStack = EnumMaterial.getStack(RecipeLoader.itemMetals, EnumMaterial.IRON, EnumOrePart.GEARS, 1); - RecipeLoader.parseOreNames(CONFIGURATION); - } - else - { - - } - if (RecipeLoader.blockConveyorBelt != null) - { - ResonantInductionTabs.tabAutomation().setIconItemStack(new ItemStack(RecipeLoader.blockConveyorBelt)); - } - else - { - ResonantInductionTabs.tabAutomation().setIconItemStack(new ItemStack(Block.pistonStickyBase)); - } - - } - - public void loadModMeta() - { - meta.modId = ResonantInductionTransport.MOD_ID; - meta.name = ResonantInductionTransport.MOD_NAME; - meta.version = ResonantInductionTransport.VERSION; - meta.description = "Simi Realistic factory system for minecraft bring in conveyor belts, robotic arms, and simple machines"; - meta.url = "http://www.universalelectricity.com/coremachine"; - meta.logoFile = "/al_logo.png"; - - meta.authorList = Arrays.asList(new String[] { "DarkGuardsman" }); - meta.credits = "Archadia - Developer" + "LiQuiD - Dev of BioTech\n" + "Hangcow - Ex-Dev Greater Security\n" + "Calclavia - Ex-CoDev of assembly line\n" + "Briman0094 - Ex-CoDev of assembly line\n" + "Elrath18 - Colored Glass, Sand, & Stone\n" + "Doppelgangerous - Researcher\n" + "Freesound.org - Sound effects\n" + "MineMan1(wdtod) - asset creation\n" + "AlphaToOmega - asset creation\n" + "pinksheep - asset creation\n" + "X-wing9 - asset creation\n" + "Azkhare - asset creation\n" + "Vexatos - German Translation\n" + "crafteverywhere - Chinese Translations\n" + "PancakeCandy - French & Dutch Translations\n"; - meta.autogenerated = false; - - } -} diff --git a/archive/java/resonantinduction/old/transport/TileEntityAssembly.java b/archive/java/resonantinduction/old/transport/TileEntityAssembly.java deleted file mode 100644 index 7d92cb0f..00000000 --- a/archive/java/resonantinduction/old/transport/TileEntityAssembly.java +++ /dev/null @@ -1,200 +0,0 @@ -package resonantinduction.old.transport; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.tile.TileEntityEnergyMachine; -import resonantinduction.core.tilenetwork.INetworkEnergyPart; -import resonantinduction.core.tilenetwork.ITileNetwork; -import resonantinduction.core.tilenetwork.prefab.NetworkSharedPower; -import universalelectricity.api.vector.Vector3; - -/** - * A class to be inherited by all machines on the assembly line. This class acts as a single peace - * in a network of similar tiles allowing all to share power from one or more sources - * - * @author DarkGuardsman - */ -public abstract class TileEntityAssembly extends TileEntityEnergyMachine implements INetworkEnergyPart -{ - /** lowest value the network can update at */ - public static int refresh_min_rate = 20; - /** range by which the network can update at */ - public static int refresh_diff = 9; - /** Network used to link assembly machines together */ - private NetworkAssembly assemblyNetwork; - /** Tiles that are connected to this */ - public List connectedTiles = new ArrayList(); - /** Random instance */ - public Random random = new Random(); - /** Random rate by which this tile updates its network connections */ - private int updateTick = 1; - - public TileEntityAssembly(long wattsPerTick) - { - super(wattsPerTick); - } - - public TileEntityAssembly(long wattsPerTick, long maxEnergy) - { - super(wattsPerTick, maxEnergy); - } - - @Override - public void invalidate() - { - this.getTileNetwork().splitNetwork(this); - super.invalidate(); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if (!this.worldObj.isRemote) - { - if (ticks % updateTick == 0) - { - this.updateTick = (random.nextInt(1 + refresh_diff) + refresh_min_rate); - this.refresh(); - } - } - } - - @Override - public boolean canTileConnect(Connection type, ForgeDirection dir) - { - return true; - } - - @Override - public void refresh() - { - if (this.worldObj != null && !this.worldObj.isRemote) - { - this.connectedTiles.clear(); - - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity tileEntity = new Vector3(this).modifyPositionFromSide(dir).getTileEntity(this.worldObj); - if (tileEntity instanceof TileEntityAssembly && ((TileEntityAssembly) tileEntity).canTileConnect(Connection.NETWORK, dir.getOpposite())) - { - this.getTileNetwork().mergeNetwork(((TileEntityAssembly) tileEntity).getTileNetwork(), this); - connectedTiles.add(tileEntity); - } - } - } - } - - @Override - public List getNetworkConnections() - { - return this.connectedTiles; - } - - @Override - public NetworkAssembly getTileNetwork() - { - if (!(this.assemblyNetwork instanceof NetworkAssembly)) - { - this.assemblyNetwork = new NetworkAssembly(this); - } - return this.assemblyNetwork; - } - - @Override - public void setTileNetwork(ITileNetwork network) - { - if (network instanceof NetworkAssembly) - { - this.assemblyNetwork = (NetworkAssembly) network; - } - } - - @Override - public boolean consumePower(long request, boolean doExtract) - { - return ((NetworkSharedPower) this.getTileNetwork()).removePower(this, request, doExtract) >= request; - } - - @Override - public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) - { - if (this.canConnect(from)) - { - return this.getTileNetwork().addPower(this, receive, doReceive); - } - return 0; - } - - /** Amount of energy this tile runs on per tick */ - public int getWattLoad() - { - return 1;// 1J/t or 20J/t - } - - /** Conditional load that may not be consumed per tick */ - public int getExtraLoad() - { - return 1;// 1J/t or 20J/t - } - - @Override - public void togglePowerMode() - { - super.togglePowerMode(); - ((NetworkSharedPower) this.getTileNetwork()).setPowerLess(!this.runPowerLess()); - } - - @Override - public long getEnergyStored() - { - return ((NetworkSharedPower) this.getTileNetwork()).getEnergy(); - } - - @Override - public long getMaxEnergyStored() - { - return ((NetworkSharedPower) this.getTileNetwork()).getEnergyCapacity(); - } - - @Override - public long getEnergy(ForgeDirection from) - { - return this.getEnergyStored(); - } - - @Override - public long getEnergyCapacity(ForgeDirection from) - { - return this.getMaxEnergyStored(); - } - - @Override - public long getPartEnergy() - { - return this.energyStored; - } - - @Override - public long getPartMaxEnergy() - { - return this.MAX_JOULES_STORED; - } - - @Override - public void setPartEnergy(long energy) - { - this.energyStored = energy; - } - - @Override - public AxisAlignedBB getRenderBoundingBox() - { - return INFINITE_EXTENT_AABB; - } -} diff --git a/archive/java/resonantinduction/old/transport/crafting/BlockCraftingTable.java b/archive/java/resonantinduction/old/transport/crafting/BlockCraftingTable.java deleted file mode 100644 index 0978c541..00000000 --- a/archive/java/resonantinduction/old/transport/crafting/BlockCraftingTable.java +++ /dev/null @@ -1,117 +0,0 @@ -package resonantinduction.old.transport.crafting; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.transport.ResonantInductionTransport; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Advanced tiering of a crafting table adding advanced features such as visual crafting, and auto - * crafting. Original idea by Infinite - * - * @author DarkGuardsman - */ -public class BlockCraftingTable extends BlockMachine -{ - @SideOnly(Side.CLIENT) - private Icon workbenchIconTop; - @SideOnly(Side.CLIENT) - private Icon workbenchIconFront; - - public BlockCraftingTable() - { - super(ResonantInductionTransport.CONFIGURATION, "CraftingTable", Material.rock); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int par1, int par2) - { - return par1 == 1 ? this.workbenchIconTop : (par1 == 0 ? Block.planks.getBlockTextureFromSide(par1) : (par1 != 2 && par1 != 4 ? this.blockIcon : this.workbenchIconFront)); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); - this.workbenchIconTop = par1IconRegister.registerIcon(this.getTextureName() + "_top"); - this.workbenchIconFront = par1IconRegister.registerIcon(this.getTextureName() + "_front"); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntityCraftingTable(); - } - - @Override - public TileEntity createTileEntity(World world, int metadata) - { - if (metadata >= 0 && metadata < CraftingTables.values().length) - { - CraftingTables table = CraftingTables.values()[metadata]; - if (table.enabled && table.tileClass != null) - { - try - { - return table.tileClass.newInstance(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - } - return super.createTileEntity(world, metadata); - } - - public static enum CraftingTables - { - /** Upgraded wooden crafting table, stores items, and contains a small inventory */ - ADVANCED(), - /** Stone version of the advanced, renders end result of crafting on surface */ - STONE(), - /** Iron version of stone adding ability to repair armor */ - IRON(), - /** Upgraded version of the iron allowing repair of tools, as well upgrades of tools */ - STEEL(), - /** First work bench that can be combined with robotics to auto craft items */ - AUTOMATED(), - /** Crafting table that allows large long term projects to be made one item at a time */ - PROJECT(), - /** Crafting table that allows industrial machines to be crafted */ - INDUSTRIAL(), - /** - * Crafting table that allows advanced electronics to be crafted, also allows electronic - * devices to be designed - */ - ELECTRONICS(), - /** Upgraded auto table that can use blueprints, works faster, and do some cool tricks */ - INDUSTRIAL_AUTOMATED(), - /** Auto crafting version of the electronics table, allows autocrafting of custom devices */ - ELECTRONICS_AUTOMATED(), - /** Auto crafting table that allows long term projects to be made one item at a time */ - AUTOMATED_PROJECT(); - - public final boolean enabled; - public Class tileClass = null; - - private CraftingTables() - { - this(false); - } - - private CraftingTables(boolean enabled) - { - this.enabled = enabled; - } - } - -} diff --git a/archive/java/resonantinduction/old/transport/crafting/TileEntityCraftingTable.java b/archive/java/resonantinduction/old/transport/crafting/TileEntityCraftingTable.java deleted file mode 100644 index b155c48b..00000000 --- a/archive/java/resonantinduction/old/transport/crafting/TileEntityCraftingTable.java +++ /dev/null @@ -1,8 +0,0 @@ -package resonantinduction.old.transport.crafting; - -import resonantinduction.core.prefab.tile.TileEntityInv; - -public class TileEntityCraftingTable extends TileEntityInv -{ - -} diff --git a/archive/java/resonantinduction/old/transport/crate/BlockCrate.java b/archive/java/resonantinduction/old/transport/crate/BlockCrate.java deleted file mode 100644 index cf6f7053..00000000 --- a/archive/java/resonantinduction/old/transport/crate/BlockCrate.java +++ /dev/null @@ -1,447 +0,0 @@ -package resonantinduction.old.transport.crate; - -import java.util.List; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -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.Settings; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.client.render.RenderCrate; -import universalelectricity.api.UniversalElectricity; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** A block that allows the placement of mass amount of a specific item within it. It will be allowed - * to go on Conveyor Belts - * - * @author DarkGuardsman */ -public class BlockCrate extends BlockMachine -{ - Icon adv, elt; - - public BlockCrate() - { - super(Settings.CONFIGURATION, "crate", UniversalElectricity.machine); - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister iconReg) - { - this.blockIcon = iconReg.registerIcon(Reference.PREFIX + "crate"); - this.adv = iconReg.registerIcon(Reference.PREFIX + "crate_adv"); - this.elt = iconReg.registerIcon(Reference.PREFIX + "crate_elt"); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int meta) - { - if (meta == 1) - { - return adv; - } - else if (meta == 2) - { - return elt; - } - return this.blockIcon; - } - - @Override - public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) - { - if (!world.isRemote) - { - if (world.getBlockTileEntity(x, y, z) instanceof TileEntityCrate) - { - TileEntityCrate tileEntity = (TileEntityCrate) world.getBlockTileEntity(x, y, z); - - /** Make double clicking input all stacks. */ - boolean allMode = (world.getWorldTime() - tileEntity.prevClickTime < 10); - - tileEntity.prevClickTime = world.getWorldTime(); - - this.tryEject(tileEntity, player, allMode); - } - - } - } - - /** Placed the item the player is holding into the crate. */ - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (super.onBlockActivated(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ)) - { - return true; - } - - if (!world.isRemote) - { - if (world.getBlockTileEntity(x, y, z) instanceof TileEntityCrate) - { - TileEntityCrate tileEntity = (TileEntityCrate) world.getBlockTileEntity(x, y, z); - - /** Make double clicking input all stacks. */ - boolean allMode = (world.getWorldTime() - tileEntity.prevClickTime < 10); - - tileEntity.prevClickTime = world.getWorldTime(); - ItemStack current = entityPlayer.inventory.getCurrentItem(); - if (side == 1 && entityPlayer.capabilities.isCreativeMode) - { - if (current != null && tileEntity.getSampleStack() == null) - { - ItemStack cStack = current.copy(); - cStack.stackSize = TileEntityCrate.getSlotCount(world.getBlockMetadata(x, y, z)) * 64; - BlockCrate.addStackToCrate(tileEntity, cStack); - } - } - // Add items - if (side == 1 || (side > 1 && hitY > 0.5) || !entityPlayer.capabilities.isCreativeMode) - { - this.tryInsert(tileEntity, entityPlayer, allMode); - } - // Remove items - else if (side == 0 || (side > 1 && hitY <= 0.5)) - { - this.tryEject(tileEntity, entityPlayer, allMode); - } - - } - } - - return true; - } - - /** Try to inject it into the crate. Otherwise, look around for nearby crates and try to put them - * in. */ - public void tryInsert(TileEntityCrate tileEntity, EntityPlayer player, boolean allMode, boolean doSearch) - { - boolean success; - - if (allMode) - { - success = this.insertAllItems(tileEntity, player); - } - else - { - success = this.insertCurrentItem(tileEntity, player); - } - - if (!success && doSearch) - { - PathfinderCrate pathfinder = new PathfinderCrate().init(tileEntity); - - for (TileEntity checkTile : pathfinder.iteratedNodes) - { - if (checkTile instanceof TileEntityCrate) - { - this.tryInsert(((TileEntityCrate) checkTile), player, allMode, false); - } - } - } - } - - public void tryInsert(TileEntityCrate tileEntity, EntityPlayer player, boolean allMode) - { - this.tryInsert(tileEntity, player, allMode, true); - } - - public void tryEject(TileEntityCrate tileEntity, EntityPlayer player, boolean allMode) - { - if (tileEntity.getSampleStack() == null) - { - return; - } - if (allMode && !player.isSneaking()) - { - this.ejectItems(tileEntity, player, tileEntity.getSlotCount() * 64); - } - else - { - if (player.isSneaking()) - { - this.ejectItems(tileEntity, player, 1); - } - else - { - this.ejectItems(tileEntity, player, tileEntity.getSampleStack().getMaxStackSize()); - } - } - } - - /** Inserts a the itemStack the player is holding into the crate. */ - public boolean insertCurrentItem(TileEntityCrate tileEntity, EntityPlayer player) - { - ItemStack currentStack = player.getCurrentEquippedItem(); - - if (currentStack != null) - { - if (currentStack.getItem().itemID == this.blockID) - { - ItemStack containedStack = ItemBlockCrate.getContainingItemStack(currentStack); - ItemStack crateStack = tileEntity.getSampleStack(); - if (containedStack != null && (crateStack == null || (crateStack != null && containedStack.isItemEqual(crateStack)))) - { - ItemStack returned = BlockCrate.addStackToCrate(tileEntity, containedStack); - ItemBlockCrate.setContainingItemStack(currentStack, returned); - return true; - } - - } - else - { - if (tileEntity.getSampleStack() != null) - { - if (!tileEntity.getSampleStack().isItemEqual(currentStack)) - { - return false; - } - } - - player.inventory.setInventorySlotContents(player.inventory.currentItem, BlockCrate.addStackToCrate(tileEntity, currentStack)); - return true; - } - } - - return false; - } - - /** Inserts all items of the same type this player has into the crate. - * - * @return True on success */ - public boolean insertAllItems(TileEntityCrate tileEntity, EntityPlayer player) - { - ItemStack requestStack = null; - - if (tileEntity.getSampleStack() != null) - { - requestStack = tileEntity.getSampleStack().copy(); - } - - if (requestStack == null) - { - requestStack = player.getCurrentEquippedItem(); - } - - if (requestStack != null && requestStack.itemID != this.blockID) - { - boolean success = false; - - for (int i = 0; i < player.inventory.getSizeInventory(); i++) - { - ItemStack currentStack = player.inventory.getStackInSlot(i); - - if (currentStack != null) - { - if (requestStack.isItemEqual(currentStack)) - { - player.inventory.setInventorySlotContents(i, BlockCrate.addStackToCrate(tileEntity, currentStack)); - - if (player instanceof EntityPlayerMP) - { - ((EntityPlayerMP) player).sendContainerToPlayer(player.inventoryContainer); - } - - success = true; - } - } - } - return success; - } - return false; - } - - /** Ejects and item out of the crate and spawn it under the player entity. - * - * @param tileEntity - * @param player - * @param requestSize - The maximum stack size to take out. Default should be 64. - * @return True on success */ - public boolean ejectItems(TileEntityCrate tileEntity, EntityPlayer player, int requestSize) - { - World world = tileEntity.worldObj; - if (!world.isRemote) - { - ItemStack sampleStack = tileEntity.getSampleStack(); - int ammountEjected = 0; - if (sampleStack != null && requestSize > 0) - { - for (int slot = 0; slot < tileEntity.getInventory().getSizeInventory(); slot++) - { - ItemStack slotStack = tileEntity.getInventory().getStackInSlot(slot); - - if (slotStack != null && slotStack.stackSize > 0) - { - int amountToTake = Math.min(slotStack.stackSize, requestSize); - - ItemStack dropStack = slotStack.copy(); - dropStack.stackSize = amountToTake; - - EntityItem entityItem = new EntityItem(world, player.posX, player.posY, player.posZ, dropStack); - entityItem.delayBeforeCanPickup = 0; - world.spawnEntityInWorld(entityItem); - - slotStack.stackSize -= amountToTake; - ammountEjected += amountToTake; - if (slotStack.stackSize <= 0) - { - slotStack = null; - } - tileEntity.getInventory().setInventorySlotContents(slot, slotStack); - - } - if (ammountEjected >= requestSize) - { - return true; - } - } - - return true; - } - } - - return false; - } - - /** Puts an itemStack into the crate. - * - * @param tileEntity - * @param itemStack */ - public static ItemStack addStackToCrate(TileEntityCrate tileEntity, ItemStack itemStack) - { - if (itemStack == null || itemStack.getItem().isDamageable() && itemStack.getItem().getDamage(itemStack) > 0) - { - return itemStack; - } - - ItemStack containingStack = tileEntity.getSampleStack(); - - if (containingStack == null || containingStack != null && containingStack.isItemEqual(itemStack)) - { - int room = Math.max((tileEntity.getInventory().getSizeInventory() * 64) - (containingStack != null ? containingStack.stackSize : 0), 0); - if (itemStack.stackSize <= room) - { - tileEntity.addToStack(itemStack); - itemStack = null; - } - else - { - tileEntity.addToStack(itemStack, room); - itemStack.stackSize -= room; - } - return itemStack; - - } - - if (itemStack.stackSize <= 0) - { - return null; - } - - return itemStack; - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (!world.isRemote && world.getBlockTileEntity(x, y, z) != null) - { - TileEntityCrate tileEntity = (TileEntityCrate) world.getBlockTileEntity(x, y, z); - ItemStack containingStack = tileEntity.getSampleStack(); - tileEntity.buildSampleStack(); - - if (containingStack != null) - { - if (containingStack.stackSize > 0) - { - float area = 0.7F; - double dropX = (world.rand.nextFloat() * area) + (1.0F - area) * 0.5D; - double dropY = (world.rand.nextFloat() * area) + (1.0F - area) * 0.5D; - double dropZ = (world.rand.nextFloat() * area) + (1.0F - area) * 0.5D; - - ItemStack dropStack = new ItemStack(this, 1, tileEntity.getBlockMetadata()); - ItemBlockCrate.setContainingItemStack(dropStack, containingStack); - - EntityItem var13 = new EntityItem(world, x + dropX, y + dropY, z + dropZ, dropStack); - var13.delayBeforeCanPickup = 10; - world.spawnEntityInWorld(var13); - - for (int i = 0; i < tileEntity.getInventory().getSizeInventory(); i++) - { - tileEntity.getInventory().setInventorySlotContents(i, null); - } - world.setBlock(x, y, z, 0, 0, 3); - return true; - } - } - } - - return false; - } - - @Override - public int damageDropped(int metadata) - { - return metadata; - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("ALCrate", TileEntityCrate.class)); - } - - @Override - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - list.add(new Pair, TileEntitySpecialRenderer>(TileEntityCrate.class, new RenderCrate())); - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityCrate(); - } - - @Override - public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List list) - { - for (int i = 0; i < 3; i++) - { - list.add(new ItemStack(this, 1, i)); - } - try - { - ItemStack stack = new ItemStack(this, 1, 2); - ItemBlockCrate.setContainingItemStack(stack, new ItemStack(Block.cobblestone, 2048, 0)); - list.add(stack); - ItemStack stack2 = new ItemStack(this, 1, 2); - ItemBlockCrate.setContainingItemStack(stack2, new ItemStack(Item.coal, 2048, 1)); - list.add(stack); - } - catch (Exception e) - { - e.printStackTrace(); - } - - } - -} diff --git a/archive/java/resonantinduction/old/transport/crate/InventoryCrate.java b/archive/java/resonantinduction/old/transport/crate/InventoryCrate.java deleted file mode 100644 index 6167489d..00000000 --- a/archive/java/resonantinduction/old/transport/crate/InventoryCrate.java +++ /dev/null @@ -1,70 +0,0 @@ -package resonantinduction.old.transport.crate; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import dark.lib.prefab.invgui.InvChest; - -public class InventoryCrate extends InvChest -{ - public InventoryCrate(TileEntity crate) - { - super(crate, 512); - } - - /** Clones the single stack into an inventory format for automation interaction */ - public void buildInventory(ItemStack sampleStack) - { - this.containedItems = new ItemStack[this.getSizeInventory()]; - if (sampleStack != null && sampleStack.getItem() != null) - { - ItemStack baseStack = sampleStack.copy(); - int itemsLeft = baseStack.stackSize; - - for (int slot = 0; slot < this.getContainedItems().length; slot++) - { - int stackL = Math.min(Math.min(itemsLeft, baseStack.getMaxStackSize()), this.getInventoryStackLimit()); - this.getContainedItems()[slot] = baseStack.copy(); - this.getContainedItems()[slot].stackSize = stackL; - itemsLeft -= stackL; - if (baseStack.stackSize <= 0) - { - baseStack = null; - break; - } - } - } - } - - @Override - public int getSizeInventory() - { - if (this.hostTile instanceof TileEntityCrate) - { - return ((TileEntityCrate) this.hostTile).getSlotCount(); - } - return 512; - } - - @Override - public String getInvName() - { - return "inv.Crate"; - } - - @Override - public NBTTagCompound saveInv(NBTTagCompound nbt) - { - return nbt; - } - - @Override - public void loadInv(NBTTagCompound nbt) - { - if (nbt.hasKey("Items")) - { - super.loadInv(nbt); - } - - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/transport/crate/ItemBlockCrate.java b/archive/java/resonantinduction/old/transport/crate/ItemBlockCrate.java deleted file mode 100644 index e81969f0..00000000 --- a/archive/java/resonantinduction/old/transport/crate/ItemBlockCrate.java +++ /dev/null @@ -1,147 +0,0 @@ -package resonantinduction.old.transport.crate; - -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; - -public class ItemBlockCrate extends ItemBlock -{ - public ItemBlockCrate(int par1) - { - super(par1); - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) - { - return this.getUnlocalizedName() + "." + itemStack.getItemDamage(); - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) - { - ItemStack containingStack = getContainingItemStack(itemStack); - - if (containingStack != null) - { - par3List.add(containingStack.getDisplayName()); - par3List.add("Amount: " + containingStack.stackSize); - } - } - - @Override - public int getItemStackLimit(ItemStack stack) - { - ItemStack containingStack = getContainingItemStack(stack); - if (containingStack != null) - { - return 1; - } - return super.getItemStackLimit(); - } - - @Override - public void onUpdate(ItemStack itemStack, World par2World, Entity entity, int par4, boolean par5) - { - if (entity instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer) entity; - ItemStack containingStack = getContainingItemStack(itemStack); - - if (containingStack != null && !player.capabilities.isCreativeMode) - { - player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5, (int) ((float) containingStack.stackSize / (float) TileEntityCrate.getSlotCount(itemStack.getItemDamage())) * 5)); - } - } - } - - public static void setContainingItemStack(ItemStack itemStack, ItemStack containingStack) - { - if (itemStack.stackTagCompound == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - if (containingStack != null) - { - NBTTagCompound itemTagCompound = new NBTTagCompound(); - containingStack.stackSize = Math.abs(containingStack.stackSize); - containingStack.writeToNBT(itemTagCompound); - itemStack.getTagCompound().setTag("Item", itemTagCompound); - - itemStack.getTagCompound().setInteger("Count", containingStack.stackSize); - } - else - { - itemStack.getTagCompound().setTag("Item", new NBTTagCompound()); - itemStack.getTagCompound().setInteger("Count", 0); - } - } - - public static ItemStack getContainingItemStack(ItemStack itemStack) - { - if (itemStack.stackTagCompound == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - return null; - } - - NBTTagCompound itemTagCompound = itemStack.getTagCompound().getCompoundTag("Item"); - ItemStack containingStack = ItemStack.loadItemStackFromNBT(itemTagCompound); - - if (containingStack != null) - { - containingStack.stackSize = itemStack.getTagCompound().getInteger("Count"); - } - - return containingStack; - } - - @Override - public int getMetadata(int metadata) - { - return metadata; - } - - @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) - { - if (super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata)) - { - ItemStack containingItem = getContainingItemStack(stack); - - if (world.getBlockTileEntity(x, y, z) != null && containingItem != null) - { - if (containingItem.stackSize > 0) - { - TileEntityCrate tileEntity = (TileEntityCrate) world.getBlockTileEntity(x, y, z); - int count = containingItem.stackSize; - - for (int slot = 0; slot < tileEntity.getInventory().getSizeInventory(); slot++) - { - int stackSize = Math.min(64, count); - tileEntity.getInventory().setInventorySlotContents(slot, new ItemStack(containingItem.itemID, stackSize, containingItem.getItemDamage())); - count -= stackSize; - - if (count <= 0) - { - containingItem = null; - break; - } - - } - tileEntity.buildSampleStack(); - } - } - } - - return true; - } -} diff --git a/archive/java/resonantinduction/old/transport/crate/ItemStorageCan.java b/archive/java/resonantinduction/old/transport/crate/ItemStorageCan.java deleted file mode 100644 index cef83b1b..00000000 --- a/archive/java/resonantinduction/old/transport/crate/ItemStorageCan.java +++ /dev/null @@ -1,11 +0,0 @@ -package resonantinduction.old.transport.crate; - -/** - * Can that is used to store items such as food, parts, or solid fuels. - * - * @author DarkGuardsman - */ -public class ItemStorageCan -{ - -} diff --git a/archive/java/resonantinduction/old/transport/crate/PathfinderCrate.java b/archive/java/resonantinduction/old/transport/crate/PathfinderCrate.java deleted file mode 100644 index 91461425..00000000 --- a/archive/java/resonantinduction/old/transport/crate/PathfinderCrate.java +++ /dev/null @@ -1,113 +0,0 @@ -package resonantinduction.old.transport.crate; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.api.vector.Vector3; -import universalelectricity.api.vector.VectorHelper; - -/** - * A class that allows flexible path finding in Minecraft Blocks. Back Ported from UE 1.3.0. - * - * TODO: Will need to change when MC 1.5 comes out. - * - * @author Calclavia - */ -public class PathfinderCrate -{ - public interface IPathCallBack - { - /** - * Is this a valid node to search for? - * - * @return - */ - public boolean isValidNode(PathfinderCrate finder, ForgeDirection direction, TileEntity provider, TileEntity node); - - /** - * Called when looping through nodes. - * - * @param finder - * @param provider - * @return True to stop the path finding operation. - */ - public boolean onSearch(PathfinderCrate finder, TileEntity provider); - } - - /** A pathfinding call back interface used to call back on paths. */ - public IPathCallBack callBackCheck; - - /** A list of nodes that the pathfinder went through. */ - public List iteratedNodes; - - /** The results and findings found by the pathfinder. */ - public List results; - - public PathfinderCrate() - { - this.callBackCheck = new IPathCallBack() - { - @Override - public boolean isValidNode(PathfinderCrate finder, ForgeDirection direction, TileEntity provider, TileEntity node) - { - return node instanceof TileEntityCrate; - } - - @Override - public boolean onSearch(PathfinderCrate finder, TileEntity provider) - { - return false; - } - }; - this.clear(); - } - - public boolean findNodes(TileEntity provider) - { - if (provider != null) - { - this.iteratedNodes.add(provider); - - if (this.callBackCheck.onSearch(this, provider)) - { - return false; - } - - for (int i = 0; i < 6; i++) - { - TileEntity connectedTile = VectorHelper.getTileEntityFromSide(provider.worldObj, new Vector3(provider), ForgeDirection.getOrientation(i)); - - if (!iteratedNodes.contains(connectedTile)) - { - if (this.callBackCheck.isValidNode(this, ForgeDirection.getOrientation(i), provider, connectedTile)) - { - if (!this.findNodes(connectedTile)) - { - return false; - } - - } - - } - } - } - - return true; - } - - /** Called to execute the pathfinding operation. */ - public PathfinderCrate init(TileEntity provider) - { - this.findNodes(provider); - return this; - } - - public PathfinderCrate clear() - { - this.iteratedNodes = new ArrayList(); - this.results = new ArrayList(); - return this; - } -} \ No newline at end of file diff --git a/archive/java/resonantinduction/old/transport/crate/TileEntityCrate.java b/archive/java/resonantinduction/old/transport/crate/TileEntityCrate.java deleted file mode 100644 index 83ffefc5..00000000 --- a/archive/java/resonantinduction/old/transport/crate/TileEntityCrate.java +++ /dev/null @@ -1,295 +0,0 @@ -package resonantinduction.old.transport.crate; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.network.ISimplePacketReceiver; -import resonantinduction.core.prefab.tile.TileEntityInv; -import resonantinduction.old.transport.ResonantInductionTransport; -import calclavia.lib.network.PacketHandler; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.network.Player; -import cpw.mods.fml.relauncher.Side; -import dark.lib.interfaces.IExtendedStorage; - -/** - * Basic single stack inventory - * - * @author DarkGuardsman - */ -public class TileEntityCrate extends TileEntityInv implements ISimplePacketReceiver, IExtendedStorage -{ - /* - * TODO - * Fix issues with ItemStacks with NBT tags having issues - * Fix possible render issues with some items - * Yell at MachineMuse for her items rendering threw walls - * Add support to disable sides of crates when rendering items are unwanted - * Simplify item rendering to decrease graphic lag - * Add crafting manger to prevent crafting with full crates - * As well keep item stacks when upgrade crate threw crafting - * Add upgrade item for crate - * Add crate swapping in which an advanced can trade place with a basic while keeping inventory - * at the locaiton - */ - /** Collective total stack of all inv slots */ - private ItemStack sampleStack; - - /** delay from last click */ - public long prevClickTime = -1000; - /** max meta size of the crate */ - public static final int maxSize = 2; - - @Override - public InventoryCrate getInventory() - { - if (this.inventory == null) - { - inventory = new InventoryCrate(this); - } - return (InventoryCrate) this.inventory; - } - - /** Gets the sample stack that represent the total inv */ - public ItemStack getSampleStack() - { - if (this.sampleStack == null) - { - this.buildSampleStack(); - } - return this.sampleStack; - } - - /** - * Turns the inventory array into a single stack of matching items. This assumes that all items - * in the crate are the same TODO eject minority items and only keep the majority that are the - * same to prevent duplication issues - * - * @param force - force a rebuild of the inventory from the single stack created - */ - public void buildSampleStack() - { - ItemStack stack = null; - - boolean rebuildBase = false; - - /* Creates the sample stack that is used as a collective itemstack */ - for (int i = 0; i < this.getInventory().getContainedItems().length; i++) - { - ItemStack s = this.getInventory().getContainedItems()[i]; - if (s != null && s.itemID > 0 && s.stackSize > 0) - { - if (stack == null) - { - stack = s.copy(); - } - else - { - stack.stackSize += this.getInventory().getContainedItems()[i].stackSize; - } - if (this.getInventory().getContainedItems()[i].stackSize > this.getInventory().getContainedItems()[i].getMaxStackSize()) - { - rebuildBase = true; - } - } - } - if (stack == null || stack.itemID == 0 || stack.stackSize == 0) - { - this.sampleStack = null; - } - else - { - this.sampleStack = stack.copy(); - } - /* if one stack is over sized this rebuilds the inv to redistribute the items in the slots */ - if ((rebuildBase || this.getInventory().getContainedItems().length > this.getSlotCount()) && this.sampleStack != null) - { - this.getInventory().buildInventory(this.sampleStack); - } - } - - /** Adds an item to the stack */ - public void addToStack(ItemStack stack, int amount) - { - if (stack != null) - { - this.addToStack(new ItemStack(stack.stackSize, amount, stack.getItemDamage())); - } - } - - /** Adds the stack to the sample stack */ - public void addToStack(ItemStack stack) - { - if (stack != null) - { - this.buildSampleStack(); - boolean flag = false; - if (this.sampleStack == null) - { - this.sampleStack = stack; - flag = true; - } - else if (this.sampleStack.isItemEqual(stack)) - { - this.sampleStack.stackSize += stack.stackSize; - flag = true; - } - if (flag) - { - this.getInventory().buildInventory(this.sampleStack); - this.onInventoryChanged(); - } - } - } - - @Override - public void onInventoryChanged() - { - super.onInventoryChanged(); - - if (this.worldObj != null) - { - if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) - { - PacketHandler.instance().sendPacketToClients(this.getDescriptionPacket(), this.worldObj); - } - } - } - - @Override - public boolean canStore(ItemStack stack, int slot, ForgeDirection side) - { - return this.sampleStack == null || stack != null && stack.isItemEqual(sampleStack); - } - - /** Gets the current slot count for the crate */ - public int getSlotCount() - { - if (this.worldObj == null) - { - return TileEntityCrate.getSlotCount(TileEntityCrate.maxSize); - } - return TileEntityCrate.getSlotCount(this.getBlockMetadata()); - } - - /** Gets the slot count for the crate meta */ - public static int getSlotCount(int metadata) - { - if (metadata >= 2) - { - return 256; - } - else if (metadata >= 1) - { - return 64; - } - return 32; - } - - @Override - public boolean canUpdate() - { - return false; - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput data, Player player) - { - if (this.worldObj.isRemote) - { - try - { - if (id.equalsIgnoreCase("InventoryItem")) - { - if (data.readBoolean()) - { - this.sampleStack = ItemStack.loadItemStackFromNBT(PacketHandler.readNBTTagCompound(data)); - this.sampleStack.stackSize = data.readInt(); - } - else - { - this.sampleStack = null; - } - } - } - catch (Exception e) - { - e.printStackTrace(); - return true; - } - } - return false; - } - - @Override - public Packet getDescriptionPacket() - { - this.buildSampleStack(); - ItemStack stack = this.getSampleStack(); - if (stack != null) - { - return PacketHandler.instance().getTilePacket(ResonantInductionTransport.CHANNEL, "InventoryItem", this, true, stack.writeToNBT(new NBTTagCompound()), stack.stackSize); - } - else - { - return PacketHandler.instance().getTilePacket(ResonantInductionTransport.CHANNEL, "InventoryItem", this, false); - } - } - - /** NBT Data */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - /* Load current two inv methods */ - ItemStack stack = null; - int count = nbt.getInteger("Count"); - if (nbt.hasKey("itemID")) - { - stack = new ItemStack(nbt.getInteger("itemID"), count, nbt.getInteger("itemMeta")); - } - else - { - stack = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("stack")); - if (stack != null) - { - stack.stackSize = count; - } - } - - /* Only load sample stack if the read stack is valid */ - if (stack != null && stack.itemID != 0 && stack.stackSize > 0) - { - this.sampleStack = stack; - this.getInventory().buildInventory(this.sampleStack); - } - - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - /* Re-Build sample stack for saving */ - this.buildSampleStack(); - ItemStack stack = this.getSampleStack(); - /* Save sample stack */ - if (stack != null) - { - nbt.setInteger("Count", stack.stackSize); - nbt.setCompoundTag("stack", stack.writeToNBT(new NBTTagCompound())); - } - - } - - @Override - public ItemStack addStackToStorage(ItemStack stack) - { - return BlockCrate.addStackToCrate(this, stack); - } - -} diff --git a/archive/java/resonantinduction/old/transport/encoder/BlockEncoder.java b/archive/java/resonantinduction/old/transport/encoder/BlockEncoder.java deleted file mode 100644 index 429035e1..00000000 --- a/archive/java/resonantinduction/old/transport/encoder/BlockEncoder.java +++ /dev/null @@ -1,94 +0,0 @@ -package resonantinduction.old.transport.encoder; - -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import resonantinduction.core.Reference; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.mechanical.CommonProxy; -import resonantinduction.old.transport.ResonantInductionTransport; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockEncoder extends BlockMachine -{ - Icon encoder_side; - Icon encoder_top; - Icon encoder_bottom; - - public BlockEncoder() - { - super(Settings.CONFIGURATION, "encoder", Material.wood); - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister iconReg) - { - this.encoder_side = iconReg.registerIcon(Reference.PREFIX + "encoder_side"); - this.encoder_top = iconReg.registerIcon(Reference.PREFIX + "encoder_top"); - this.encoder_bottom = iconReg.registerIcon(Reference.PREFIX + "encoder_bottom"); - } - - /** Returns the block texture based on the side being looked at. Args: side */ - @Override - @SideOnly(Side.CLIENT) - public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) - { - return getIcon(side, 0); - } - - /** Returns the block texture based on the side being looked at. Args: side */ - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int meta) - { - if (side == 1) - { - return this.encoder_top; - - } - else if (side == 0) - { - return this.encoder_bottom; - - } - - return this.encoder_side; - } - - /** Called upon block activation (right click on the block.) */ - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) - { - if (!world.isRemote) - { - entityPlayer.openGui(ResonantInductionTransport.instance, CommonProxy.GUI_ENCODER, world, x, y, z); - } - - return true; - - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair("ALEncoder", TileEntityEncoder.class)); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntityEncoder(); - } -} diff --git a/archive/java/resonantinduction/old/transport/encoder/ContainerEncoder.java b/archive/java/resonantinduction/old/transport/encoder/ContainerEncoder.java deleted file mode 100644 index d6189ed0..00000000 --- a/archive/java/resonantinduction/old/transport/encoder/ContainerEncoder.java +++ /dev/null @@ -1,92 +0,0 @@ -package resonantinduction.old.transport.encoder; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import dark.lib.prefab.invgui.SlotSpecific; - -public class ContainerEncoder extends Container -{ - public static final int Y_OFFSET = 0; - - private ItemStack[] containingItems = new ItemStack[1]; - private TileEntityEncoder tileEntity; - - public ContainerEncoder(InventoryPlayer inventoryPlayer, TileEntityEncoder encoder) - { - this.tileEntity = encoder; - - // Disk - this.addSlotToContainer(new SlotSpecific(encoder, 0, 80, 24 + Y_OFFSET, ItemDisk.class)); - - int row; - - // Player Inventory - for (row = 0; row < 3; ++row) - { - for (int slot = 0; slot < 9; ++slot) - { - this.addSlotToContainer(new Slot(inventoryPlayer, slot + row * 9 + 9, 8 + slot * 18, 97 + row * 8)); - } - } - for (row = 0; row < 9; ++row) - { - this.addSlotToContainer(new Slot(inventoryPlayer, row, 8 + row * 18, 145)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer player) - { - return this.tileEntity.isUseableByPlayer(player); - } - - /** Called to transfer a stack from one inventory to the other eg. when shift clicking. */ - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slot) - { - ItemStack copyStack = null; - Slot slotObj = (Slot) this.inventorySlots.get(slot); - - if (slotObj != null && slotObj.getHasStack()) - { - ItemStack slotStack = slotObj.getStack(); - copyStack = slotStack.copy(); - - if (slot >= 1) - { - if (this.getSlot(0).isItemValid(slotStack)) - { - if (!this.mergeItemStack(slotStack, 0, 1, false)) - { - return null; - } - } - } - else if (!this.mergeItemStack(slotStack, this.containingItems.length, 37, false)) - { - return null; - } - - if (slotStack.stackSize == 0) - { - slotObj.putStack((ItemStack) null); - } - else - { - slotObj.onSlotChanged(); - } - - if (slotStack.stackSize == copyStack.stackSize) - { - return null; - } - - slotObj.onPickupFromSlot(player, slotStack); - } - - return copyStack; - } -} diff --git a/archive/java/resonantinduction/old/transport/encoder/IInventoryWatcher.java b/archive/java/resonantinduction/old/transport/encoder/IInventoryWatcher.java deleted file mode 100644 index 02ace6f9..00000000 --- a/archive/java/resonantinduction/old/transport/encoder/IInventoryWatcher.java +++ /dev/null @@ -1,6 +0,0 @@ -package resonantinduction.old.transport.encoder; - -public interface IInventoryWatcher -{ - public void inventoryChanged(); -} diff --git a/archive/java/resonantinduction/old/transport/encoder/ItemDisk.java b/archive/java/resonantinduction/old/transport/encoder/ItemDisk.java deleted file mode 100644 index 39bdaa36..00000000 --- a/archive/java/resonantinduction/old/transport/encoder/ItemDisk.java +++ /dev/null @@ -1,102 +0,0 @@ -package resonantinduction.old.transport.encoder; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInductionTabs; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemDisk extends Item -{ - public ItemDisk(int id) - { - super(id); - this.setUnlocalizedName("disk"); - this.setCreativeTab(ResonantInductionTabs.CORE); - this.setHasSubtypes(true); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) - { - this.itemIcon = par1IconRegister.registerIcon(Reference.PREFIX + "disk"); - } - - @Override - public int getItemStackLimit() - { - return 1; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) - { - List commands = getCommands(itemStack); - - if (commands.size() > 0) - { - if (commands.size() == 1) - list.add(commands.size() + " command"); - else - list.add(commands.size() + " commands"); - } - else - { - list.add("No commands"); - } - } - - /** Saves the list of items to filter out inside. */ - public static void setCommands(ItemStack itemStack, ArrayList commands) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - NBTTagList nbt = new NBTTagList(); - - for (int i = 0; i < commands.size(); ++i) - { - if (commands.get(i) != null) - { - NBTTagCompound newCompound = new NBTTagCompound(); - newCompound.setString("command", commands.get(i)); - nbt.appendTag(newCompound); - } - } - - itemStack.getTagCompound().setTag("Commands", nbt); - } - - public static ArrayList getCommands(ItemStack itemStack) - { - ArrayList commands = new ArrayList(); - - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound nbt = itemStack.getTagCompound(); - NBTTagList tagList = nbt.getTagList("Commands"); - - for (int i = 0; i < tagList.tagCount(); ++i) - { - NBTTagCompound curTag = (NBTTagCompound) tagList.tagAt(i); - String cmd = curTag.getString("command"); - commands.add(cmd); - } - - return commands; - } -} diff --git a/archive/java/resonantinduction/old/transport/encoder/SlotDisk.java b/archive/java/resonantinduction/old/transport/encoder/SlotDisk.java deleted file mode 100644 index 9c72a884..00000000 --- a/archive/java/resonantinduction/old/transport/encoder/SlotDisk.java +++ /dev/null @@ -1,22 +0,0 @@ -package resonantinduction.old.transport.encoder; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import resonantinduction.old.core.recipe.RecipeLoader; - -public class SlotDisk extends Slot -{ - - public SlotDisk(IInventory par1iInventory, int par2, int par3, int par4) - { - super(par1iInventory, par2, par3, par4); - } - - @Override - public boolean isItemValid(ItemStack itemStack) - { - return itemStack.itemID == RecipeLoader.itemDisk.itemID; - } - -} diff --git a/archive/java/resonantinduction/old/transport/encoder/SlotDiskResult.java b/archive/java/resonantinduction/old/transport/encoder/SlotDiskResult.java deleted file mode 100644 index e8170f6d..00000000 --- a/archive/java/resonantinduction/old/transport/encoder/SlotDiskResult.java +++ /dev/null @@ -1,42 +0,0 @@ -package resonantinduction.old.transport.encoder; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class SlotDiskResult extends Slot -{ - - public SlotDiskResult(IInventory par1iInventory, int par2, int par3, int par4) - { - super(par1iInventory, par2, par3, par4); - } - - @Override - public boolean isItemValid(ItemStack par1ItemStack) - { - return false; - } - - @Override - public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) - { - super.onPickupFromSlot(par1EntityPlayer, par2ItemStack); - - if (this.inventory.getStackInSlot(0) != null) - { - this.inventory.getStackInSlot(0).stackSize--; - if (this.inventory.getStackInSlot(0).stackSize <= 0) - { - this.inventory.setInventorySlotContents(0, null); - } - } - /* - * if (this.inventory.getStackInSlot(1) != null) { - * this.inventory.getStackInSlot(1).stackSize--; if - * (this.inventory.getStackInSlot(1).stackSize <= 1) { - * this.inventory.setInventorySlotContents(1, null); } } - */ - } -} diff --git a/archive/java/resonantinduction/old/transport/encoder/TileEntityEncoder.java b/archive/java/resonantinduction/old/transport/encoder/TileEntityEncoder.java deleted file mode 100644 index a4f8161b..00000000 --- a/archive/java/resonantinduction/old/transport/encoder/TileEntityEncoder.java +++ /dev/null @@ -1,263 +0,0 @@ -package resonantinduction.old.transport.encoder; - -import java.io.IOException; - -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import resonantinduction.core.prefab.tile.TileEntityMachine; -import resonantinduction.electrical.armbot.Program; -import resonantinduction.electrical.armbot.command.TaskRotateTo; -import resonantinduction.old.api.coding.IProgram; -import resonantinduction.old.api.coding.ITask; -import resonantinduction.old.api.coding.TaskRegistry; -import resonantinduction.old.transport.ResonantInductionTransport; -import universalelectricity.api.vector.Vector2; -import calclavia.lib.network.PacketHandler; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.PacketDispatcher; -import cpw.mods.fml.common.network.Player; - -public class TileEntityEncoder extends TileEntityMachine implements ISidedInventory -{ - private ItemStack disk; - private IInventoryWatcher watcher; - public static final String PROGRAM_PACKET_ID = "program", - PROGRAM_CHANGE_PACKET_ID = "programChange", REMOVE_TASK_PACKET_ID = "removeTask", - NEW_TASK_PACKET_ID = "newTask"; - protected IProgram program; - - public TileEntityEncoder() - { - super(); - this.hasGUI = true; - } - - @Override - public void initiate() - { - super.initiate(); - if (!this.worldObj.isRemote) - { - program = new Program(); - program.setTaskAt(0, 0, new TaskRotateTo()); - } - } - - @Override - public void onInventoryChanged() - { - super.onInventoryChanged(); - if (watcher != null) - { - watcher.inventoryChanged(); - } - } - - @Override - public String getInvName() - { - return "Encoder"; - } - - @Override - public int getInventoryStackLimit() - { - return 1; - } - - public void setWatcher(IInventoryWatcher watcher) - { - this.watcher = watcher; - } - - public IInventoryWatcher getWatcher() - { - return this.watcher; - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - - if (this.disk != null) - { - NBTTagCompound diskNBT = new NBTTagCompound(); - this.disk.writeToNBT(diskNBT); - nbt.setCompoundTag("disk", diskNBT); - } - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - - NBTTagCompound diskNBT = nbt.getCompoundTag("disk"); - - if (diskNBT != null) - { - this.disk = ItemStack.loadItemStackFromNBT(diskNBT); - } - - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput dis, Player player) - { - try - { - boolean su = super.simplePacket(id, dis, player); - if (!su) - { - if (this.worldObj.isRemote) - { - if (id.equalsIgnoreCase(TileEntityEncoder.PROGRAM_PACKET_ID)) - { - - if (dis.readBoolean()) - { - Program program = new Program(); - program.load(PacketHandler.readNBTTagCompound(dis)); - this.program = program; - } - else - { - this.program = null; - } - return true; - } - } - else - { - if (id.equalsIgnoreCase(TileEntityEncoder.PROGRAM_CHANGE_PACKET_ID)) - { - ITask task = TaskRegistry.getCommand(dis.readUTF()); - task.setPosition(dis.readInt(), dis.readInt()); - task.load(PacketHandler.readNBTTagCompound(dis)); - this.getProgram().setTaskAt(task.getCol(), task.getRow(), task); - this.sendGUIPacket(); - return true; - } - else if (id.equalsIgnoreCase(TileEntityEncoder.NEW_TASK_PACKET_ID)) - { - ITask task = TaskRegistry.getCommand(dis.readUTF()); - task.setPosition(dis.readInt(), dis.readInt()); - task.load(PacketHandler.readNBTTagCompound(dis)); - this.getProgram().insertTask(task.getCol(), task.getRow(), task); - this.sendGUIPacket(); - return true; - } - else if (id.equalsIgnoreCase(TileEntityEncoder.REMOVE_TASK_PACKET_ID)) - { - this.getProgram().setTaskAt(dis.readInt(), dis.readInt(), null); - this.sendGUIPacket(); - return true; - } - } - } - return su; - } - catch (IOException e) - { - e.printStackTrace(); - return true; - } - } - - /** Sends a gui packet only to the given player */ - @Override - public Packet getGUIPacket() - { - return this.getDescriptionPacket(); - } - - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound tag = new NBTTagCompound(); - boolean exists = this.program != null; - if (exists) - { - this.program.save(tag); - } - return PacketHandler.instance().getTilePacket(ResonantInductionTransport.CHANNEL, TileEntityEncoder.PROGRAM_PACKET_ID, this, exists, tag); - - } - - public void removeTask(Vector2 vec) - { - if (vec != null) - { - if (this.worldObj.isRemote) - { - PacketDispatcher.sendPacketToServer(PacketHandler.instance().getTilePacket(ResonantInductionTransport.CHANNEL, TileEntityEncoder.REMOVE_TASK_PACKET_ID, this, vec.intX(), vec.intY())); - } - else - { - this.program.setTaskAt(vec.intX(), vec.intY(), null); - } - } - } - - public void updateTask(ITask editTask) - { - - if (editTask != null) - { - if (this.worldObj.isRemote) - { - NBTTagCompound nbt = new NBTTagCompound(); - editTask.save(nbt); - PacketDispatcher.sendPacketToServer(PacketHandler.instance().getTilePacket(ResonantInductionTransport.CHANNEL, TileEntityEncoder.PROGRAM_CHANGE_PACKET_ID, this, editTask.getMethodName(), editTask.getCol(), editTask.getRow(), nbt)); - } - else - { - this.program.setTaskAt(editTask.getCol(), editTask.getRow(), editTask); - } - } - - } - - public void insertTask(ITask editTask) - { - if (editTask != null) - { - if (this.worldObj.isRemote) - { - NBTTagCompound nbt = new NBTTagCompound(); - editTask.save(nbt); - PacketDispatcher.sendPacketToServer(PacketHandler.instance().getTilePacket(ResonantInductionTransport.CHANNEL, TileEntityEncoder.NEW_TASK_PACKET_ID, this, editTask.getMethodName(), editTask.getCol(), editTask.getRow(), nbt)); - } - else - { - this.program.insertTask(editTask.getCol(), editTask.getRow(), editTask); - } - } - - } - - @Override - public boolean isInvNameLocalized() - { - // TODO ? - return false; - } - - public IProgram getProgram() - { - return this.program; - } - - @Override - public Class getContainer() - { - return ContainerEncoder.class; - } - -} diff --git a/archive/java/resonantinduction/old/transport/hopper/BlockAdvancedHopper.java b/archive/java/resonantinduction/old/transport/hopper/BlockAdvancedHopper.java deleted file mode 100644 index 96f5d4bd..00000000 --- a/archive/java/resonantinduction/old/transport/hopper/BlockAdvancedHopper.java +++ /dev/null @@ -1,164 +0,0 @@ -package resonantinduction.old.transport.hopper; - -import java.util.List; -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Facing; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import resonantinduction.core.Settings; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.client.render.RenderAdvancedHopper; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Block for an advanced version of the vanilla minecraft hopper - * - * @author DarkGuardsman - */ -public class BlockAdvancedHopper extends BlockMachine -{ - @SideOnly(Side.CLIENT) - public static Icon hopperIcon; - @SideOnly(Side.CLIENT) - public static Icon hopperTopIcon; - @SideOnly(Side.CLIENT) - public static Icon hopperInsideIcon; - - public BlockAdvancedHopper() - { - super(Settings.CONFIGURATION, "DMHopper", Material.iron); - this.setCreativeTab(CreativeTabs.tabRedstone); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) - { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - - /** - * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if - * they intersect the mask.) Parameters: World, X, Y, Z, mask, list, colliding entity - */ - @Override - public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB box, List boxList, Entity entity) - { - float f = 0.125F; - - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); - - super.addCollisionBoxesToList(world, x, y, z, box, boxList, entity); - this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); - - super.addCollisionBoxesToList(world, x, y, z, box, boxList, entity); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); - - super.addCollisionBoxesToList(world, x, y, z, box, boxList, entity); - this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - - super.addCollisionBoxesToList(world, x, y, z, box, boxList, entity); - this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); - - super.addCollisionBoxesToList(world, x, y, z, box, boxList, entity); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - - @Override - public int onBlockPlaced(World world, int x, int y, int z, int side, float xSide, float ySide, float zSide, int meta) - { - meta = Facing.oppositeSide[side]; - if (meta == 1) - { - meta = 0; - } - return meta; - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntityAdvancedHopper(); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("DMTileHopper", TileEntityAdvancedHopper.class)); - } - - @Override - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - list.add(new Pair, TileEntitySpecialRenderer>(TileEntityAdvancedHopper.class, new RenderAdvancedHopper())); - } - - /** The type of render function that is called for this block */ - @Override - public int getRenderType() - { - return -1; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) - { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int meta) - { - return side == 1 ? BlockAdvancedHopper.hopperTopIcon : BlockAdvancedHopper.hopperIcon; - } - - @Override - public boolean hasComparatorInputOverride() - { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) - { - BlockAdvancedHopper.hopperIcon = par1IconRegister.registerIcon("hopper_outside"); - BlockAdvancedHopper.hopperTopIcon = par1IconRegister.registerIcon("hopper_top"); - BlockAdvancedHopper.hopperInsideIcon = par1IconRegister.registerIcon("hopper_inside"); - } - - @Override - @SideOnly(Side.CLIENT) - public String getItemIconName() - { - return "hopper"; - } -} diff --git a/archive/java/resonantinduction/old/transport/hopper/TileEntityAdvancedHopper.java b/archive/java/resonantinduction/old/transport/hopper/TileEntityAdvancedHopper.java deleted file mode 100644 index 117df5a3..00000000 --- a/archive/java/resonantinduction/old/transport/hopper/TileEntityAdvancedHopper.java +++ /dev/null @@ -1,149 +0,0 @@ -package resonantinduction.old.transport.hopper; - -import java.util.List; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.tile.TileEntityFilterable; -import resonantinduction.old.transport.imprinter.ItemImprinter; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.HelperMethods; -import calclavia.lib.utility.InvInteractionHelper; - -/** - * Advanced version of the hopper with features such as redstone control, sorting, filtering, and - * crate version. - * - * @author DarkGuardsman - */ -public class TileEntityAdvancedHopper extends TileEntityFilterable -{ - - public ForgeDirection connection = ForgeDirection.DOWN; - public boolean[] connections = new boolean[6]; - public boolean singleConnection = true; - - /** The class that interacts with inventories for this machine */ - private InvInteractionHelper invExtractionHelper; - - public TileEntityAdvancedHopper() - { - this.invSlots = 5; - } - - /** Gets the class that managed extracting and placing items into inventories */ - public InvInteractionHelper invHelper() - { - if (invExtractionHelper == null || invExtractionHelper.world != this.worldObj) - { - this.invExtractionHelper = new InvInteractionHelper(this.worldObj, new Vector3(this), this.getFilter() != null ? ItemImprinter.getFilters(getFilter()) : null, this.isInverted()); - } - return invExtractionHelper; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner - * uses this to count ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() - { - super.updateEntity(); - if (!this.worldObj.isRemote && this.ticks % 8 == 0) - { - this.grabItems(); - this.dumpItems(); - } - } - - public void grabItems() - { - Vector3 inputPos = this.getThisPos().clone().modifyPositionFromSide(ForgeDirection.UP); - List itemsInBound = HelperMethods.getEntitiesInDirection(worldObj, this.getThisPos(), ForgeDirection.UP); - ItemStack itemStack = invHelper().tryGrabFromPosition(inputPos, ForgeDirection.UP, 1); - if (itemStack != null) - { - itemStack = invHelper().tryPlaceInPosition(itemStack, this.getThisPos(), ForgeDirection.UNKNOWN); - if (itemStack != null) - { - itemStack = invHelper().tryPlaceInPosition(itemStack, inputPos, ForgeDirection.DOWN); - if (itemStack != null) - { - invHelper().throwItem(inputPos, itemStack); - } - } - } - else if (inputPos.getTileEntity(worldObj) == null && itemsInBound != null) - { - for (EntityItem entity : itemsInBound) - { - if (entity.isDead) - { - continue; - } - ItemStack remainingStack = entity.getEntityItem().copy(); - if (this.getFilter() == null || this.isFiltering(remainingStack)) - { - if (remainingStack != null) - { - remainingStack = invHelper().tryPlaceInPosition(itemStack, this.getThisPos(), ForgeDirection.UNKNOWN); - } - if (remainingStack == null || remainingStack.stackSize <= 0) - { - entity.setDead(); - } - else - { - entity.setEntityItemStack(remainingStack); - } - } - } - } - } - - public void dumpItems() - { - Vector3 outputPos = this.getThisPos().clone().modifyPositionFromSide(this.connection); - for (int slot = 0; slot < this.getInventory().getSizeInventory(); slot++) - { - if (this.getInventory().getStackInSlot(slot) != null) - { - ItemStack stack = this.getInventory().getStackInSlot(slot).copy(); - if (this.getFilter() == null || this.isFiltering(stack)) - { - stack = this.invHelper().tryGrabFromPosition(outputPos, this.connection.getOpposite(), 1); - if (stack == null || !areItemStacksEqualItem(stack, this.getInventory().getStackInSlot(slot)) || this.getInventory().getStackInSlot(slot).stackSize != stack.stackSize) - { - this.getInventory().setInventorySlotContents(slot, stack); - this.onInventoryChanged(); - } - } - } - } - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - } - - @Override - public String getInvName() - { - return "container.advancedhopper"; - } - - private static boolean areItemStacksEqualItem(ItemStack stack, ItemStack stack2) - { - return stack.itemID != stack2.itemID ? false : (stack.getItemDamage() != stack2.getItemDamage() ? false : (stack.stackSize > stack.getMaxStackSize() ? false : ItemStack.areItemStackTagsEqual(stack, stack2))); - } -} diff --git a/archive/java/resonantinduction/old/transport/imprinter/BlockImprinter.java b/archive/java/resonantinduction/old/transport/imprinter/BlockImprinter.java deleted file mode 100644 index e157996a..00000000 --- a/archive/java/resonantinduction/old/transport/imprinter/BlockImprinter.java +++ /dev/null @@ -1,165 +0,0 @@ -package resonantinduction.old.transport.imprinter; - -import java.util.Random; -import java.util.Set; - -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import resonantinduction.core.Reference; -import resonantinduction.core.prefab.block.BlockMachine; -import resonantinduction.old.transport.ResonantInductionTransport; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockImprinter extends BlockMachine -{ - Icon imprinter_side; - Icon imprinter_top; - Icon imprinter_bottom; - - public BlockImprinter() - { - super("imprinter", Material.wood); - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister iconReg) - { - this.imprinter_side = iconReg.registerIcon(Reference.PREFIX + "imprinter_side"); - this.imprinter_top = iconReg.registerIcon(Reference.PREFIX + "imprinter_top"); - this.imprinter_bottom = iconReg.registerIcon(Reference.PREFIX + "imprinter_bottom"); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) - { - return getIcon(side, 0); - } - - /** Returns the block texture based on the side being looked at. Args: side */ - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int meta) - { - if (side == 1) - { - return this.imprinter_top; - - } - else if (side == 0) - { - return this.imprinter_bottom; - - } - - return this.imprinter_side; - } - - /** Called upon block activation (right click on the block.) */ - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) - { - if (!world.isRemote) - { - entityPlayer.openGui(ResonantInductionTransport.instance, CommonProxy.GUI_IMPRINTER, world, x, y, z); - } - - return true; - - } - - @Override - public void dropEntireInventory(World par1World, int x, int y, int z, int par5, int par6) - { - TileEntity tileEntity = par1World.getBlockTileEntity(x, y, z); - - if (tileEntity != null) - { - if (tileEntity instanceof TileEntityImprinter) - { - TileEntityImprinter inventory = (TileEntityImprinter) tileEntity; - - for (int i = 0; i < inventory.getSizeInventory(); ++i) - { - ItemStack itemStack = inventory.getStackInSlot(i); - - if (itemStack != null) - { - Random random = new Random(); - float var8 = random.nextFloat() * 0.8F + 0.1F; - float var9 = random.nextFloat() * 0.8F + 0.1F; - float var10 = random.nextFloat() * 0.8F + 0.1F; - - while (itemStack.stackSize > 0) - { - int var11 = random.nextInt(21) + 10; - - if (var11 > itemStack.stackSize) - { - var11 = itemStack.stackSize; - } - - itemStack.stackSize -= var11; - - if (i != inventory.craftingOutputSlot) - { - EntityItem entityItem = new EntityItem(par1World, (x + var8), (y + var9), (z + var10), new ItemStack(itemStack.itemID, var11, itemStack.getItemDamage())); - - if (itemStack.hasTagCompound()) - { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - } - - float var13 = 0.05F; - entityItem.motionX = ((float) random.nextGaussian() * var13); - entityItem.motionY = ((float) random.nextGaussian() * var13 + 0.2F); - entityItem.motionZ = ((float) random.nextGaussian() * var13); - par1World.spawnEntityInWorld(entityItem); - } - } - } - } - } - } - } - - @Override - public boolean onUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - TileEntity tileEntity = par1World.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof TileEntityImprinter) - { - ((TileEntityImprinter) tileEntity).searchInventories = !((TileEntityImprinter) tileEntity).searchInventories; - par1World.markBlockForUpdate(x, y, z); - return true; - } - - return false; - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair("ALImprinter", TileEntityImprinter.class)); - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityImprinter(); - } -} diff --git a/archive/java/resonantinduction/old/transport/imprinter/ContainerImprinter.java b/archive/java/resonantinduction/old/transport/imprinter/ContainerImprinter.java deleted file mode 100644 index cb5f7bd3..00000000 --- a/archive/java/resonantinduction/old/transport/imprinter/ContainerImprinter.java +++ /dev/null @@ -1,145 +0,0 @@ -package resonantinduction.old.transport.imprinter; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import dark.lib.prefab.invgui.ISlotWatcher; -import dark.lib.prefab.invgui.SlotCraftingResult; -import dark.lib.prefab.invgui.SlotSpecific; -import dark.lib.prefab.invgui.WatchedSlot; - -public class ContainerImprinter extends Container implements ISlotWatcher -{ - public InventoryPlayer inventoryPlayer; - public TileEntityImprinter tileEntity; - - public ContainerImprinter(InventoryPlayer inventoryPlayer, TileEntityImprinter tileEntity) - { - this.tileEntity = tileEntity; - this.tileEntity.container = this; - this.inventoryPlayer = inventoryPlayer; - - /** Crafting Matrix */ - for (int x = 0; x < 3; x++) - { - for (int y = 0; y < 3; y++) - { - this.addSlotToContainer(new WatchedSlot(this.tileEntity, y + x * 3, 9 + y * 18, 16 + x * 18, this)); - } - } - - // Imprint Input for Imprinting - this.addSlotToContainer(new SlotSpecific(this.tileEntity, TileEntityImprinter.IMPRINTER_MATRIX_START, 68, 34, ItemImprinter.class)); - // Item to be imprinted - this.addSlotToContainer(new WatchedSlot(this.tileEntity, TileEntityImprinter.IMPRINTER_MATRIX_START + 1, 92, 34, this)); - // Result of Crafting/Imprinting - this.addSlotToContainer(new SlotCraftingResult(this.tileEntity, this, this.tileEntity, TileEntityImprinter.IMPRINTER_MATRIX_START + 2, 148, 34)); - - // Imprinter Inventory - for (int ii = 0; ii < 2; ii++) - { - for (int i = 0; i < 9; i++) - { - this.addSlotToContainer(new WatchedSlot(this.tileEntity, (i + ii * 9) + TileEntityImprinter.INVENTORY_START, 8 + i * 18, 80 + ii * 18, this)); - } - } - - // Player Inventory - int var3; - - for (var3 = 0; var3 < 3; ++var3) - { - for (int var4 = 0; var4 < 9; ++var4) - { - this.addSlotToContainer(new WatchedSlot(inventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 120 + var3 * 18, this)); - } - } - - for (var3 = 0; var3 < 9; ++var3) - { - this.addSlotToContainer(new WatchedSlot(inventoryPlayer, var3, 8 + var3 * 18, 178, this)); - } - - this.tileEntity.openChest(); - } - - @Override - public void onContainerClosed(EntityPlayer par1EntityPlayer) - { - super.onContainerClosed(par1EntityPlayer); - this.tileEntity.closeChest(); - } - - @Override - public boolean canInteractWith(EntityPlayer player) - { - return this.tileEntity.isUseableByPlayer(player); - } - - /** Called to transfer a stack from one inventory to the other eg. when shift clicking. */ - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slot) - { - ItemStack copyStack = null; - Slot slotObj = (Slot) this.inventorySlots.get(slot); - - if (slotObj != null && slotObj.getHasStack()) - { - ItemStack slotStack = slotObj.getStack(); - copyStack = slotStack.copy(); - - if (slot == TileEntityImprinter.INVENTORY_START - 1) - { - // Prevents filter from being duplicated - this.tileEntity.setInventorySlotContents(TileEntityImprinter.INVENTORY_START - 1, null); - } - - if (slot > this.tileEntity.getSizeInventory() - 1) - { - if (this.getSlot(TileEntityImprinter.IMPRINTER_MATRIX_START).isItemValid(slotStack)) - { - if (!this.mergeItemStack(slotStack, TileEntityImprinter.IMPRINTER_MATRIX_START, TileEntityImprinter.IMPRINTER_MATRIX_START + 1, true)) - { - return null; - } - } - else if (!this.mergeItemStack(slotStack, TileEntityImprinter.INVENTORY_START, this.tileEntity.getSizeInventory(), false)) - { - return null; - } - } - else if (!this.mergeItemStack(slotStack, this.tileEntity.getSizeInventory(), this.tileEntity.getSizeInventory() + 36, false)) - { - return null; - } - - if (slotStack.stackSize == 0) - { - slotObj.putStack(null); - } - else - { - slotObj.onSlotChanged(); - } - - if (slotStack.stackSize == copyStack.stackSize) - { - return null; - } - - slotObj.onPickupFromSlot(player, slotStack); - } - - this.slotContentsChanged(slot); - return copyStack; - } - - @Override - public void slotContentsChanged(int slot) - { - this.tileEntity.onInventoryChanged(); - this.detectAndSendChanges(); - } -} diff --git a/archive/java/resonantinduction/old/transport/imprinter/ItemImprinter.java b/archive/java/resonantinduction/old/transport/imprinter/ItemImprinter.java deleted file mode 100644 index 795be915..00000000 --- a/archive/java/resonantinduction/old/transport/imprinter/ItemImprinter.java +++ /dev/null @@ -1,127 +0,0 @@ -package resonantinduction.old.transport.imprinter; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IProjectile; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import resonantinduction.core.Reference; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemImprinter extends Item -{ - public ItemImprinter(int id) - { - super(Settings.CONFIGURATION.getItem("imprint", id).getInt()); - this.setUnlocalizedName("imprint"); - this.setCreativeTab(ResonantInductionTabs.CORE); - this.setHasSubtypes(true); - this.maxStackSize = 1; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) - { - this.itemIcon = par1IconRegister.registerIcon(Reference.PREFIX + "imprint"); - } - - @Override - public int getItemStackLimit() - { - return 1; - } - - @Override - public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) - { - if (entity != null && !(entity instanceof IProjectile) && !(entity instanceof EntityPlayer)) - { - String stringName = EntityList.getEntityString(entity); - // TODO add to filter - // player.sendChatToPlayer("Target: " + stringName); - return true; - } - return false; - } - - public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving) - { - return false; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) - { - List filterItems = getFilters(itemStack); - - if (filterItems.size() > 0) - { - for (ItemStack filterItem : filterItems) - { - list.add(filterItem.getDisplayName()); - } - } - else - { - list.add("No filters"); - } - } - - /** Saves the list of items to filter out inside. */ - public static void setFilters(ItemStack itemStack, ArrayList filterStacks) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - NBTTagList nbt = new NBTTagList(); - - for (int i = 0; i < filterStacks.size(); ++i) - { - if (filterStacks.get(i) != null) - { - NBTTagCompound newCompound = new NBTTagCompound(); - newCompound.setByte("Slot", (byte) i); - filterStacks.get(i).writeToNBT(newCompound); - nbt.appendTag(newCompound); - } - } - - itemStack.getTagCompound().setTag("Items", nbt); - } - - public static ArrayList getFilters(ItemStack itemStack) - { - ArrayList filterStacks = new ArrayList(); - - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - NBTTagCompound nbt = itemStack.getTagCompound(); - NBTTagList tagList = nbt.getTagList("Items"); - - for (int i = 0; i < tagList.tagCount(); ++i) - { - NBTTagCompound var4 = (NBTTagCompound) tagList.tagAt(i); - byte var5 = var4.getByte("Slot"); - filterStacks.add(ItemStack.loadItemStackFromNBT(var4)); - } - - return filterStacks; - } -} diff --git a/archive/java/resonantinduction/old/transport/imprinter/TileEntityImprinter.java b/archive/java/resonantinduction/old/transport/imprinter/TileEntityImprinter.java deleted file mode 100644 index 8c24188a..00000000 --- a/archive/java/resonantinduction/old/transport/imprinter/TileEntityImprinter.java +++ /dev/null @@ -1,483 +0,0 @@ -package resonantinduction.old.transport.imprinter; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import resonantinduction.api.events.AutoCraftEvent; -import resonantinduction.old.api.IArmbot; -import resonantinduction.old.api.IArmbotUseable; -import resonantinduction.old.api.coding.args.ArgumentData; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.prefab.tile.TileAdvanced; -import calclavia.lib.utility.AutoCraftingManager; -import calclavia.lib.utility.AutoCraftingManager.IAutoCrafter; -import calclavia.lib.utility.LanguageUtility; - -import com.builtbroken.common.Pair; - -import dark.lib.prefab.invgui.ISlotPickResult; - -public class TileEntityImprinter extends TileAdvanced implements ISidedInventory, IArmbotUseable, ISlotPickResult, IAutoCrafter -{ - public static final int IMPRINTER_MATRIX_START = 9; - public static final int INVENTORY_START = IMPRINTER_MATRIX_START + 3; - - private AutoCraftingManager craftManager; - /** 9 slots for crafting, 1 slot for an imprint, 1 slot for an item */ - public ItemStack[] craftingMatrix = new ItemStack[9]; - public static final int[] craftingSlots = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; - - public ItemStack[] imprinterMatrix = new ItemStack[3]; - public static final int[] imprinterSlots = { IMPRINTER_MATRIX_START, IMPRINTER_MATRIX_START + 1, IMPRINTER_MATRIX_START + 2 }; - int imprintInputSlot = 0; - int imprintOutputSlot = 1; - int craftingOutputSlot = 2; - - /** The Imprinter inventory containing slots. */ - public ItemStack[] containingItems = new ItemStack[18]; - public static int[] inventorySlots; - - /** The containing currently used by the imprinter. */ - public ContainerImprinter container; - - /** Is the current crafting result a result of an imprint? */ - private boolean isImprinting = false; - - /** The ability for the imprinter to serach nearby inventories. */ - public boolean searchInventories = true; - - @Override - public boolean canUpdate() - { - return false; - } - - /** Gets the AutoCraftingManager that does all the crafting results */ - public AutoCraftingManager getCraftingManager() - { - if (craftManager == null) - { - craftManager = new AutoCraftingManager(this); - } - return craftManager; - } - - @Override - public int getSizeInventory() - { - return this.craftingMatrix.length + this.imprinterMatrix.length + this.containingItems.length; - } - - /** - * Sets the given item stack to the specified slot in the inventory (can be crafting or armor - * sections). - */ - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) - { - if (slot < this.getSizeInventory()) - { - if (slot < IMPRINTER_MATRIX_START) - { - this.craftingMatrix[slot] = itemStack; - } - else if (slot < INVENTORY_START) - { - this.imprinterMatrix[slot - IMPRINTER_MATRIX_START] = itemStack; - } - else - { - this.containingItems[slot - INVENTORY_START] = itemStack; - } - } - } - - @Override - public ItemStack decrStackSize(int i, int amount) - { - if (this.getStackInSlot(i) != null) - { - ItemStack stack; - - if (this.getStackInSlot(i).stackSize <= amount) - { - stack = this.getStackInSlot(i); - this.setInventorySlotContents(i, null); - return stack; - } - else - { - stack = this.getStackInSlot(i).splitStack(amount); - - if (this.getStackInSlot(i).stackSize == 0) - { - this.setInventorySlotContents(i, null); - } - - return stack; - } - } - else - { - return null; - } - } - - @Override - public ItemStack getStackInSlot(int slot) - { - if (slot < IMPRINTER_MATRIX_START) - { - return this.craftingMatrix[slot]; - } - else if (slot < INVENTORY_START) - { - return this.imprinterMatrix[slot - IMPRINTER_MATRIX_START]; - } - else - { - return this.containingItems[slot - INVENTORY_START]; - } - } - - /** - * When some containers are closed they call this on each slot, then drop whatever it returns as - * an EntityItem - like when you close a workbench GUI. - */ - @Override - public ItemStack getStackInSlotOnClosing(int slot) - { - if (this.getStackInSlot(slot) != null) - { - ItemStack var2 = this.getStackInSlot(slot); - this.setInventorySlotContents(slot, null); - return var2; - } - else - { - return null; - } - } - - @Override - public String getInvName() - { - return LanguageUtility.getLocal("tile.imprinter.name"); - } - - @Override - public void openChest() - { - this.onInventoryChanged(); - } - - @Override - public void closeChest() - { - this.onInventoryChanged(); - } - - /** - * Construct an InventoryCrafting Matrix on the fly. - * - * @return - */ - public InventoryCrafting getCraftingMatrix() - { - if (this.container != null) - { - InventoryCrafting inventoryCrafting = new InventoryCrafting(this.container, 3, 3); - - for (int i = 0; i < this.craftingMatrix.length; i++) - { - inventoryCrafting.setInventorySlotContents(i, this.craftingMatrix[i]); - } - - return inventoryCrafting; - } - - return null; - } - - public void replaceCraftingMatrix(InventoryCrafting inventoryCrafting) - { - for (int i = 0; i < this.craftingMatrix.length; i++) - { - this.craftingMatrix[i] = inventoryCrafting.getStackInSlot(i); - } - } - - public boolean isMatrixEmpty() - { - for (int i = 0; i < 9; i++) - { - if (this.craftingMatrix[i] != null) - return false; - } - - return true; - } - - /** Updates all the output slots. Call this to update the Imprinter. */ - @Override - public void onInventoryChanged() - { - if (!this.worldObj.isRemote) - { - /** Makes the stamping recipe for filters */ - this.isImprinting = false; - - if (this.isMatrixEmpty() && this.imprinterMatrix[imprintInputSlot] != null && this.imprinterMatrix[1] != null) - { - if (this.imprinterMatrix[imprintInputSlot].getItem() instanceof ItemImprinter) - { - ItemStack outputStack = this.imprinterMatrix[imprintInputSlot].copy(); - outputStack.stackSize = 1; - ArrayList filters = ItemImprinter.getFilters(outputStack); - boolean filteringItemExists = false; - - for (ItemStack filteredStack : filters) - { - if (filteredStack.isItemEqual(this.imprinterMatrix[imprintOutputSlot])) - { - filters.remove(filteredStack); - filteringItemExists = true; - break; - } - } - - if (!filteringItemExists) - { - filters.add(this.imprinterMatrix[imprintOutputSlot]); - } - - ItemImprinter.setFilters(outputStack, filters); - this.imprinterMatrix[craftingOutputSlot] = outputStack; - this.isImprinting = true; - } - } - - if (!this.isImprinting) - { - this.imprinterMatrix[craftingOutputSlot] = null; - - /** Try to craft from crafting grid. If not possible, then craft from imprint. */ - boolean didCraft = false; - - /** Simulate an Inventory Crafting Instance */ - InventoryCrafting inventoryCrafting = this.getCraftingMatrix(); - - if (inventoryCrafting != null) - { - ItemStack matrixOutput = CraftingManager.getInstance().findMatchingRecipe(inventoryCrafting, this.worldObj); - - if (matrixOutput != null && this.getCraftingManager().getIdealRecipe(matrixOutput) != null) - { - this.imprinterMatrix[craftingOutputSlot] = matrixOutput; - didCraft = true; - } - } - - if (this.imprinterMatrix[imprintInputSlot] != null && !didCraft) - { - if (this.imprinterMatrix[imprintInputSlot].getItem() instanceof ItemImprinter) - { - - ArrayList filters = ItemImprinter.getFilters(this.imprinterMatrix[0]); - - for (ItemStack outputStack : filters) - { - if (outputStack != null) - { - // System.out.println("Imprint: Geting recipe for " + - // outputStack.toString()); - Pair idealRecipe = this.getCraftingManager().getIdealRecipe(outputStack); - - if (idealRecipe != null) - { - // System.out.println("Imprint: found ideal recipe for " + - // idealRecipe.getKey().toString()); - ItemStack recipeOutput = idealRecipe.left(); - if (recipeOutput != null & recipeOutput.stackSize > 0) - { - this.imprinterMatrix[craftingOutputSlot] = recipeOutput; - didCraft = true; - break; - } - } - } - } - } - } - - if (!didCraft) - { - this.imprinterMatrix[craftingOutputSlot] = null; - } - } - } - } - - @Override - public void onPickUpFromSlot(EntityPlayer entityPlayer, int s, ItemStack itemStack) - { - if (itemStack != null) - { - if (this.isImprinting) - { - this.imprinterMatrix[0] = null; - } - else - { - Pair idealRecipeItem = this.getCraftingManager().getIdealRecipe(itemStack); - - if (idealRecipeItem != null) - { - this.getCraftingManager().consumeItems(idealRecipeItem.right().clone()); - } - } - } - } - - /** Tries to let the Armbot craft an item. */ - @Override - public boolean onUse(IArmbot armbot, List data) - { - this.onInventoryChanged(); - - if (this.imprinterMatrix[craftingOutputSlot] != null) - { - AutoCraftEvent.PreCraft event = new AutoCraftEvent.PreCraft(this.worldObj, new Vector3(this), this, this.imprinterMatrix[craftingOutputSlot]); - if (!event.isCanceled()) - { - armbot.grabObject(this.imprinterMatrix[craftingOutputSlot].copy()); - this.onPickUpFromSlot(null, 2, this.imprinterMatrix[craftingOutputSlot]); - this.imprinterMatrix[craftingOutputSlot] = null; - return true; - } - } - - return false; - } - - // /////////////////////////////////////// - // // Save And Data processing ////// - // /////////////////////////////////////// - - /** NBT Data */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - - NBTTagList var2 = nbt.getTagList("Items"); - this.craftingMatrix = new ItemStack[9]; - this.imprinterMatrix = new ItemStack[3]; - this.containingItems = new ItemStack[18]; - - for (int i = 0; i < var2.tagCount(); ++i) - { - NBTTagCompound var4 = (NBTTagCompound) var2.tagAt(i); - byte var5 = var4.getByte("Slot"); - - if (var5 >= 0 && var5 < this.getSizeInventory()) - { - this.setInventorySlotContents(var5, ItemStack.loadItemStackFromNBT(var4)); - } - } - - this.searchInventories = nbt.getBoolean("searchInventories"); - } - - /** Writes a tile entity to NBT. */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - - NBTTagList var2 = new NBTTagList(); - - for (int i = 0; i < this.getSizeInventory(); ++i) - { - if (this.getStackInSlot(i) != null) - { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte) i); - this.getStackInSlot(i).writeToNBT(var4); - var2.appendTag(var4); - } - } - - nbt.setTag("Items", var2); - - nbt.setBoolean("searchInventories", this.searchInventories); - } - - // /////////////////////////////////////// - // // Inventory Access side Methods ////// - // /////////////////////////////////////// - - @Override - public boolean isInvNameLocalized() - { - return false; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) - { - return true; - } - - @Override - public int getInventoryStackLimit() - { - return 64; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) - { - return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; - - } - - @Override - public int[] getAccessibleSlotsFromSide(int side) - { - return this.getCraftingInv(); - } - - @Override - public boolean canInsertItem(int slot, ItemStack itemstack, int side) - { - return this.isItemValidForSlot(slot, itemstack); - } - - @Override - public boolean canExtractItem(int slot, ItemStack itemstack, int side) - { - return this.isItemValidForSlot(slot, itemstack); - } - - @Override - public int[] getCraftingInv() - { - if (TileEntityImprinter.inventorySlots == null) - { - TileEntityImprinter.inventorySlots = new int[18]; - for (int i = 0; i < inventorySlots.length; i++) - { - inventorySlots[i] = TileEntityImprinter.INVENTORY_START + i; - } - } - return TileEntityImprinter.inventorySlots; - } -} diff --git a/archive/java/resonantinduction/old/transport/logistic/BlockDetector.java b/archive/java/resonantinduction/old/transport/logistic/BlockDetector.java deleted file mode 100644 index a5abc19d..00000000 --- a/archive/java/resonantinduction/old/transport/logistic/BlockDetector.java +++ /dev/null @@ -1,202 +0,0 @@ -package resonantinduction.old.transport.logistic; - -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.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.Reference; -import resonantinduction.core.prefab.block.BlockImprintable; -import resonantinduction.old.client.render.RenderDetector; -import universalelectricity.api.UniversalElectricity; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** @author Briman0094 */ -public class BlockDetector extends BlockImprintable -{ - Icon eye_red; - Icon eye_green; - - public BlockDetector() - { - super("detector", UniversalElectricity.machine); - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) - { - int angle = MathHelper.floor_double((entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - int change = 2; - - switch (angle) - { - case 0: - change = ForgeDirection.NORTH.ordinal(); - break; - case 1: - change = ForgeDirection.EAST.ordinal(); - break; - case 2: - change = ForgeDirection.SOUTH.ordinal(); - break; - case 3: - change = ForgeDirection.WEST.ordinal(); - break; - } - - if (entity.rotationPitch < -70f) // up - { - change = ForgeDirection.DOWN.ordinal(); - } - if (entity.rotationPitch > 70f) // down - { - change = ForgeDirection.UP.ordinal(); - } - - world.setBlockMetadataWithNotify(x, y, z, change, 3); - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister iconReg) - { - super.registerIcons(iconReg); - this.eye_green = iconReg.registerIcon(Reference.PREFIX + "detector_green"); - this.eye_red = iconReg.registerIcon(Reference.PREFIX + "detector_red"); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getBlockTexture(IBlockAccess iBlockAccess, int x, int y, int z, int side) - { - TileEntity tileEntity = iBlockAccess.getBlockTileEntity(x, y, z); - if (tileEntity instanceof TileEntityDetector) - { - if (side == ForgeDirection.getOrientation(iBlockAccess.getBlockMetadata(x, y, z)).ordinal()) - { - if (((TileEntityDetector) tileEntity).isInverted()) - { - return this.eye_red; - - } - else - { - return this.eye_green; - } - } - } - - return this.blockIcon; - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int metadata) - { - if (side == ForgeDirection.SOUTH.ordinal()) - { - return this.eye_green; - } - - return this.blockIcon; - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - world.setBlockMetadataWithNotify(x, y, z, side, 3); - return true; - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, int blockID) - { - if (!canBlockStay(world, x, y, z)) - { - this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); - world.setBlock(x, y, z, 0, 0, 3); - } - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean isBlockNormalCube(World world, int x, int y, int z) - { - return false; - } - - @Override - public boolean isBlockSolid(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) - { - return false; - } - - @Override - public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int direction) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof TileEntityDetector) - { - return ((TileEntityDetector) tileEntity).isPoweringTo(ForgeDirection.getOrientation(direction)); - } - return 0; - } - - @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int direction) - { - return isProvidingStrongPower(world, x, y, z, direction); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair("ALDetector", TileEntityDetector.class)); - } - - @Override - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - list.add(new Pair, TileEntitySpecialRenderer>(TileEntityDetector.class, new RenderDetector())); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntityDetector(); - } - -} diff --git a/archive/java/resonantinduction/old/transport/logistic/BlockManipulator.java b/archive/java/resonantinduction/old/transport/logistic/BlockManipulator.java deleted file mode 100644 index f19599c6..00000000 --- a/archive/java/resonantinduction/old/transport/logistic/BlockManipulator.java +++ /dev/null @@ -1,134 +0,0 @@ -package resonantinduction.old.transport.logistic; - -import java.util.List; -import java.util.Set; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatMessageComponent; -import net.minecraft.world.World; -import resonantinduction.core.prefab.block.BlockImprintable; -import resonantinduction.old.client.render.MechanicalBlockRenderingHandler; -import resonantinduction.old.client.render.RenderManipulator; -import universalelectricity.api.UniversalElectricity; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A block that manipulates item movement between inventories. - * - * @author Calclavia, DarkGuardsman - */ -public class BlockManipulator extends BlockImprintable -{ - public BlockManipulator() - { - super("manipulator", UniversalElectricity.machine); - this.setBlockBounds(0, 0, 0, 1, 0.29f, 1); - } - - @Override - public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) - { - return AxisAlignedBB.getAABBPool().getAABB(par2, par3, par4, (double) par2 + 1, (double) par3 + 1, (double) par4 + 1); - } - - @Override - public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof TileEntityManipulator) - { - ((TileEntityManipulator) tileEntity).setSelfPulse(!((TileEntityManipulator) tileEntity).isSelfPulse()); - entityPlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Manip. set to " + (((TileEntityManipulator) tileEntity).isSelfPulse() ? "auto pulse" : "not pulse"))); - } - - return true; - } - - @Override - public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof TileEntityManipulator) - { - TileEntityManipulator manip = (TileEntityManipulator) tileEntity; - boolean manipMode = manip.isOutput(); - boolean inverted = manip.isInverted(); - if (manipMode && !inverted) - { - manip.toggleInversion(); - } - else if (manipMode && inverted) - { - manip.toggleOutput(); - manip.toggleInversion(); - } - else if (!manipMode && !inverted) - { - manip.toggleInversion(); - } - else - { - manip.toggleOutput(); - manip.toggleInversion(); - } - entityPlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Manip. outputing = " + manip.isOutput())); - - } - - return true; - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair("ALManipulator", TileEntityManipulator.class)); - } - - @Override - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - list.add(new Pair, TileEntitySpecialRenderer>(TileEntityManipulator.class, new RenderManipulator())); - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityManipulator(); - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderType() - { - return MechanicalBlockRenderingHandler.BLOCK_RENDER_ID; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public int damageDropped(int par1) - { - return 0; - } -} diff --git a/archive/java/resonantinduction/old/transport/logistic/BlockRejector.java b/archive/java/resonantinduction/old/transport/logistic/BlockRejector.java deleted file mode 100644 index b4b926e8..00000000 --- a/archive/java/resonantinduction/old/transport/logistic/BlockRejector.java +++ /dev/null @@ -1,77 +0,0 @@ -package resonantinduction.old.transport.logistic; - -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.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import resonantinduction.core.Reference; -import resonantinduction.core.prefab.block.BlockImprintable; -import resonantinduction.old.client.render.MechanicalBlockRenderingHandler; -import resonantinduction.old.client.render.RenderRejector; -import universalelectricity.api.UniversalElectricity; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockRejector extends BlockImprintable -{ - @SideOnly(Side.CLIENT) - protected Icon front; - - public BlockRejector() - { - super("rejector", UniversalElectricity.machine); - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair("ALRejector", TileEntityRejector.class)); - } - - @Override - @SideOnly(Side.CLIENT) - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - list.add(new Pair, TileEntitySpecialRenderer>(TileEntityRejector.class, new RenderRejector())); - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityRejector(); - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderType() - { - return this.zeroRendering ? 0 : MechanicalBlockRenderingHandler.BLOCK_RENDER_ID; - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon(Reference.PREFIX + "imprinter_bottom"); - this.front = par1IconRegister.registerIcon(Reference.PREFIX + "disk_tray"); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int metadata) - { - if (side == metadata) - { - return this.front; - } - return this.blockIcon; - } - -} diff --git a/archive/java/resonantinduction/old/transport/logistic/TileEntityDetector.java b/archive/java/resonantinduction/old/transport/logistic/TileEntityDetector.java deleted file mode 100644 index 0ef6beae..00000000 --- a/archive/java/resonantinduction/old/transport/logistic/TileEntityDetector.java +++ /dev/null @@ -1,152 +0,0 @@ -package resonantinduction.old.transport.logistic; - -import java.util.ArrayList; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.tile.TileEntityFilterable; -import resonantinduction.old.core.recipe.RecipeLoader; -import calclavia.lib.network.PacketHandler; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; - -public class TileEntityDetector extends TileEntityFilterable -{ - private boolean powering = false; - - public TileEntityDetector() - { - super(100); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - - if (!this.worldObj.isRemote && this.ticks % 10 == 0) - { - int metadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); - AxisAlignedBB testArea = AxisAlignedBB.getBoundingBox(this.xCoord, this.yCoord, this.zCoord, this.xCoord + 1, this.yCoord + 1, this.zCoord + 1); - ForgeDirection dir = ForgeDirection.getOrientation(metadata); - testArea.offset(dir.offsetX, dir.offsetY, dir.offsetZ); - - ArrayList entities = (ArrayList) this.worldObj.getEntitiesWithinAABB(EntityItem.class, testArea); - boolean powerCheck = false; - - if (entities.size() > 0) - { - if (getFilter() != null) - { - for (int i = 0; i < entities.size(); i++) - { - EntityItem e = (EntityItem) entities.get(i); - ItemStack itemStack = e.getEntityItem(); - - powerCheck = this.isFiltering(itemStack); - } - } - else - { - powerCheck = true; - } - } - else - { - powerCheck = false; - } - - if (powerCheck != this.powering) - { - this.powering = powerCheck; - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, RecipeLoader.blockDetector.blockID); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, RecipeLoader.blockDetector.blockID); - for (int x = this.xCoord - 1; x <= this.xCoord + 1; x++) - { - for (int z = this.zCoord - 1; z <= this.zCoord + 1; z++) - { - this.worldObj.notifyBlocksOfNeighborChange(x, this.yCoord + 1, z, RecipeLoader.blockDetector.blockID); - } - } - - PacketHandler.sendPacketToClients(getDescriptionPacket()); - } - } - } - - @Override - public void invalidate() - { - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, RecipeLoader.blockDetector.blockID); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, RecipeLoader.blockDetector.blockID); - super.invalidate(); - } - - @Override - public void readFromNBT(NBTTagCompound tag) - { - super.readFromNBT(tag); - - this.powering = tag.getBoolean("powering"); - } - - @Override - public void writeToNBT(NBTTagCompound tag) - { - super.writeToNBT(tag); - - tag.setBoolean("powering", this.powering); - } - - @Override - public Packet getDescriptionPacket() - { - return PacketHandler.instance().getTilePacket(this.getChannel(), "detector", this, this.functioning, this.isInverted()); - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput dis, Player player) - { - try - { - if (this.worldObj.isRemote && !super.simplePacket(id, dis, player)) - { - if (id.equalsIgnoreCase("detector")) - { - this.functioning = dis.readBoolean(); - this.setInverted(dis.readBoolean()); - return true; - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - return false; - } - - public int isPoweringTo(ForgeDirection side) - { - return this.powering && this.getDirection() != side.getOpposite() ? 15 : 0; - } - - public boolean isIndirectlyPoweringTo(ForgeDirection side) - { - return this.isPoweringTo(side) > 0; - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return direction != this.getDirection(); - } - -} diff --git a/archive/java/resonantinduction/old/transport/logistic/TileEntityManipulator.java b/archive/java/resonantinduction/old/transport/logistic/TileEntityManipulator.java deleted file mode 100644 index abdf1ebc..00000000 --- a/archive/java/resonantinduction/old/transport/logistic/TileEntityManipulator.java +++ /dev/null @@ -1,282 +0,0 @@ -package resonantinduction.old.transport.logistic; - -import java.util.List; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.tile.TileEntityFilterable; -import resonantinduction.old.api.IManipulator; -import resonantinduction.old.transport.imprinter.ItemImprinter; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.network.PacketHandler; -import calclavia.lib.prefab.tile.IRotatable; -import calclavia.lib.utility.InvInteractionHelper; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; - -public class TileEntityManipulator extends TileEntityFilterable implements IRotatable, IManipulator -{ - - /** True to auto output items with a redstone pulse */ - private boolean selfPulse = false; - /** True if outputting items */ - private boolean isOutput = false; - /** True if is currently powered by redstone */ - private boolean isRedstonePowered = false; - /** The class that interacts with inventories for this machine */ - private InvInteractionHelper invExtractionHelper; - - public TileEntityManipulator() - { - super(10); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if (!this.worldObj.isRemote) - { - if (this.isFunctioning()) - { - if (!this.isOutput) - { - this.enject(); - } - else - { - this.isRedstonePowered = this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); - if (this.isSelfPulse() && this.ticks % 10 == 0) - { - this.isRedstonePowered = true; - } - - /** Finds the connected inventory and outputs the items upon a redstone pulse. */ - if (this.isRedstonePowered) - { - this.inject(); - } - } - } - } - } - - /** - * Find items going into the manipulator and input them into an inventory behind this - * manipulator. - */ - @Override - public void enject() - { - Vector3 inputPosition = new Vector3(this); - /** output location up */ - Vector3 outputUp = new Vector3(this); - outputUp.modifyPositionFromSide(ForgeDirection.UP); - /** output location down */ - Vector3 outputDown = new Vector3(this); - outputDown.modifyPositionFromSide(ForgeDirection.DOWN); - /** output location facing */ - Vector3 outputPosition = new Vector3(this); - outputPosition.modifyPositionFromSide(this.getDirection().getOpposite()); - this.consumePower(1, true); - - /** Prevents manipulators from spamming and duping items. */ - if (outputPosition.getTileEntity(this.worldObj) instanceof TileEntityManipulator) - { - if (((TileEntityManipulator) outputPosition.getTileEntity(this.worldObj)).getDirection() == this.getDirection().getOpposite()) - { - return; - } - } - - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(inputPosition.x, inputPosition.y, inputPosition.z, inputPosition.x + 1, inputPosition.y + 1, inputPosition.z + 1); - List itemsInBound = this.worldObj.getEntitiesWithinAABB(EntityItem.class, bounds); - - for (EntityItem entity : itemsInBound) - { - if (entity.isDead) - continue; - - /** - * Try top first, then bottom, then the sides to see if it is possible to insert the - * item into a inventory. - */ - ItemStack remainingStack = entity.getEntityItem().copy(); - - if (this.getFilter() == null || this.isFiltering(remainingStack)) - { - remainingStack = invHelper().tryPlaceInPosition(remainingStack, outputUp, ForgeDirection.UP); - - if (remainingStack != null) - { - remainingStack = invHelper().tryPlaceInPosition(remainingStack, outputDown, ForgeDirection.DOWN); - } - - if (remainingStack != null) - { - remainingStack = invHelper().tryPlaceInPosition(remainingStack, outputPosition, this.getDirection().getOpposite()); - } - - if (remainingStack != null && remainingStack.stackSize > 0) - { - invHelper().throwItem(outputPosition, remainingStack); - } - - entity.setDead(); - } - } - } - - /** Inject items */ - @Override - public void inject() - { - this.isRedstonePowered = false; - /** input location up */ - Vector3 inputUp = new Vector3(this).modifyPositionFromSide(ForgeDirection.UP); - /** input location down */ - Vector3 inputDown = new Vector3(this).modifyPositionFromSide(ForgeDirection.DOWN); - /** input location facing */ - Vector3 inputPosition = new Vector3(this).modifyPositionFromSide(this.getDirection().getOpposite()); - /** output location facing */ - Vector3 outputPosition = new Vector3(this).modifyPositionFromSide(this.getDirection()); - - this.consumePower(1, true); - - ItemStack itemStack = invHelper().tryGrabFromPosition(inputUp, ForgeDirection.UP, 1); - - if (itemStack == null) - { - itemStack = invHelper().tryGrabFromPosition(inputDown, ForgeDirection.DOWN, 1); - } - - if (itemStack == null) - { - itemStack = invHelper().tryGrabFromPosition(inputPosition, this.getDirection().getOpposite(), 1); - } - - if (itemStack != null) - { - if (itemStack.stackSize > 0) - { - invHelper().throwItem(outputPosition, itemStack); - } - } - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.isOutput = nbt.getBoolean("isOutput"); - this.setSelfPulse(nbt.getBoolean("selfpulse")); - } - - /** Writes a tile entity to NBT. */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setBoolean("isOutput", this.isOutput); - nbt.setBoolean("selfpulse", this.isSelfPulse()); - } - - @Override - public Packet getDescriptionPacket() - { - return PacketHandler.instance().getTilePacket(this.getChannel(), "manipulator", this, this.functioning, this.isInverted(), this.isSelfPulse(), this.isOutput()); - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput dis, Player player) - { - try - { - if (this.worldObj.isRemote && !super.simplePacket(id, dis, player)) - { - if (id.equalsIgnoreCase("manipulator")) - { - this.functioning = dis.readBoolean(); - this.setInverted(dis.readBoolean()); - this.setSelfPulse(dis.readBoolean()); - this.setOutput(dis.readBoolean()); - return true; - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - return false; - } - - @Override - public boolean canConnect(ForgeDirection dir) - { - return dir != this.getDirection(); - } - - public boolean isSelfPulse() - { - return selfPulse; - } - - public void setSelfPulse(boolean selfPulse) - { - this.selfPulse = selfPulse; - } - - /** Gets the class that managed extracting and placing items into inventories */ - public InvInteractionHelper invHelper() - { - if (invExtractionHelper == null || invExtractionHelper.world != this.worldObj) - { - this.invExtractionHelper = new InvInteractionHelper(this.worldObj, new Vector3(this), this.getFilter() != null ? ItemImprinter.getFilters(getFilter()) : null, this.isInverted()); - } - return invExtractionHelper; - } - - @Override - public void setFilter(ItemStack filter) - { - super.setFilter(filter); - /* Reset inv Helper's filters */ - this.invHelper().setFilter(this.getFilter() != null ? ItemImprinter.getFilters(this.getFilter()) : null, this.isInverted()); - } - - /** Is this manipulator set to output items */ - public boolean isOutput() - { - return this.isOutput; - } - - /** True to output items */ - public void setOutput(boolean isOutput) - { - this.isOutput = isOutput; - - if (!this.worldObj.isRemote) - { - this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - } - - /** Inverts the current output state */ - public void toggleOutput() - { - this.setOutput(!this.isOutput()); - } - - @Override - public int getExtraLoad() - { - return 1; - } -} diff --git a/archive/java/resonantinduction/old/transport/logistic/TileEntityRejector.java b/archive/java/resonantinduction/old/transport/logistic/TileEntityRejector.java deleted file mode 100644 index e0b0033e..00000000 --- a/archive/java/resonantinduction/old/transport/logistic/TileEntityRejector.java +++ /dev/null @@ -1,139 +0,0 @@ -package resonantinduction.old.transport.logistic; - -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.prefab.tile.TileEntityFilterable; -import resonantinduction.old.api.IBelt; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.network.PacketHandler; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; - -/** @author Darkguardsman */ -public class TileEntityRejector extends TileEntityFilterable -{ - - /** should the piston fire, or be extended */ - public boolean firePiston = false; - - public TileEntityRejector() - { - super(100); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - /** Has to update a bit faster than a conveyer belt */ - if (this.ticks % 5 == 0) - { - this.firePiston = false; - - Vector3 searchPosition = new Vector3(this); - searchPosition.modifyPositionFromSide(this.getDirection()); - TileEntity tileEntity = searchPosition.getTileEntity(this.worldObj); - - try - { - if (this.isFunctioning()) - { - /** - * Find all entities in the position in which this block is facing and attempt - * to push it out of the way. - */ - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(searchPosition.x, searchPosition.y, searchPosition.z, searchPosition.x + 1, searchPosition.y + 1, searchPosition.z + 1); - List entitiesInFront = this.worldObj.getEntitiesWithinAABB(Entity.class, bounds); - - for (Entity entity : entitiesInFront) - { - if (this.canEntityBeThrow(entity)) - { - this.throwItem(tileEntity, this.getDirection(), entity); - } - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - } - } - - /** Pushs an entity in the direction in which the rejector is facing */ - public void throwItem(TileEntity tileEntity, ForgeDirection side, Entity entity) - { - this.firePiston = true; - // TODO add config to adjust the motion magnitude per rejector - entity.motionX = side.offsetX * 0.1; - entity.motionY += 0.10000000298023224D; - entity.motionZ = side.offsetZ * 0.1; - this.consumePower(1, true); - - if (!this.worldObj.isRemote && tileEntity instanceof IBelt) - { - ((IBelt) tileEntity).ignoreEntity(entity); - } - } - - /** Checks to see if the rejector can push the entity in the facing direction */ - public boolean canEntityBeThrow(Entity entity) - { - // TODO Add other things than items - if (entity instanceof EntityItem) - { - EntityItem entityItem = (EntityItem) entity; - ItemStack itemStack = entityItem.getEntityItem(); - - return this.isFiltering(itemStack); - } - - return false; - } - - @Override - public boolean canConnect(ForgeDirection dir) - { - return dir != this.getDirection(); - } - - @Override - public Packet getDescriptionPacket() - { - return PacketHandler.instance().getTilePacket(this.getChannel(), "rejector", this, this.functioning, this.isInverted(), this.firePiston); - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput dis, Player player) - { - try - { - if (this.worldObj.isRemote && !super.simplePacket(id, dis, player)) - { - if (id.equalsIgnoreCase("rejector")) - { - this.functioning = dis.readBoolean(); - this.setInverted(dis.readBoolean()); - this.firePiston = dis.readBoolean(); - return true; - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - return false; - } - -} diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/ContainerMultimeter.java b/electrical/src/main/scala/resonantinduction/electrical/multimeter/ContainerMultimeter.java deleted file mode 100644 index 0dca13f4..00000000 --- a/electrical/src/main/scala/resonantinduction/electrical/multimeter/ContainerMultimeter.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.multimeter; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; - -/** - * @author Calclavia - * - */ -public class ContainerMultimeter extends Container -{ - private final int yDisplacement = 51; - private PartMultimeter tileEntity; - - public ContainerMultimeter(InventoryPlayer inventoryPlayer, PartMultimeter tileEntity) - { - this.tileEntity = tileEntity; - int i; - - for (i = 0; i < 3; ++i) - { - for (int j = 0; j < 9; ++j) - { - this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + yDisplacement)); - } - } - - for (i = 0; i < 9; ++i) - { - this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142 + yDisplacement)); - } - - this.tileEntity.playersUsing.add(inventoryPlayer.player); - } - - @Override - public void onContainerClosed(EntityPlayer entityPlayer) - { - this.tileEntity.playersUsing.remove(entityPlayer); - super.onContainerClosed(entityPlayer); - } - - @Override - public boolean canInteractWith(EntityPlayer entityplayer) - { - return true; - } - -} diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/ModelMultimeter.java b/electrical/src/main/scala/resonantinduction/electrical/multimeter/ModelMultimeter.java deleted file mode 100644 index 7073097d..00000000 --- a/electrical/src/main/scala/resonantinduction/electrical/multimeter/ModelMultimeter.java +++ /dev/null @@ -1,75 +0,0 @@ -package resonantinduction.electrical.multimeter; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelMultimeter extends ModelBase -{ - // fields - ModelRenderer Base; - ModelRenderer secPanel; - ModelRenderer arm; - ModelRenderer button; - ModelRenderer arm2; - ModelRenderer infopanel; - - public ModelMultimeter() - { - textureWidth = 128; - textureHeight = 128; - - Base = new ModelRenderer(this, 0, 0); - Base.addBox(0F, 0F, 0F, 14, 14, 1); - Base.setRotationPoint(-7F, 9F, 7F); - Base.setTextureSize(128, 128); - Base.mirror = true; - setRotation(Base, 0F, 0F, 0F); - secPanel = new ModelRenderer(this, 0, 18); - secPanel.addBox(0F, 0F, 0F, 4, 8, 1); - secPanel.setRotationPoint(-6F, 10F, 6F); - secPanel.setTextureSize(128, 128); - secPanel.mirror = true; - setRotation(secPanel, 0F, 0F, 0F); - arm = new ModelRenderer(this, 0, 29); - arm.addBox(0F, 0F, 0F, 1, 9, 2); - arm.setRotationPoint(-3.5F, 13F, 5.5F); - arm.setTextureSize(128, 128); - arm.mirror = true; - setRotation(arm, 0F, 0F, 0F); - button = new ModelRenderer(this, 0, 43); - button.addBox(0F, 0F, 0F, 2, 1, 1); - button.setRotationPoint(-5F, 11F, 5.5F); - button.setTextureSize(128, 128); - button.mirror = true; - setRotation(button, 0F, 0F, 0F); - arm2 = new ModelRenderer(this, 10, 29); - arm2.addBox(0F, 0F, 0F, 1, 9, 2); - arm2.setRotationPoint(-5.5F, 13F, 5.5F); - arm2.setTextureSize(128, 128); - arm2.mirror = true; - setRotation(arm2, 0F, 0F, 0F); - infopanel = new ModelRenderer(this, 33, 0); - infopanel.addBox(0F, 0F, 0F, 7, 12, 1); - infopanel.setRotationPoint(-1F, 10F, 6.5F); - infopanel.setTextureSize(128, 128); - infopanel.mirror = true; - setRotation(infopanel, 0F, 0F, 0F); - } - - public void render(float f5) - { - Base.render(f5); - secPanel.render(f5); - arm.render(f5); - button.render(f5); - arm2.render(f5); - infopanel.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/electrical/src/main/scala/resonantinduction/electrical/tesla/ITesla.java b/electrical/src/main/scala/resonantinduction/electrical/tesla/ITesla.java deleted file mode 100644 index 99da8602..00000000 --- a/electrical/src/main/scala/resonantinduction/electrical/tesla/ITesla.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * - */ -package resonantinduction.electrical.tesla; - -import net.minecraft.tileentity.TileEntity; - -/** - * @author Calclavia - * - */ -public interface ITesla -{ - /** - * @param transferEnergy - The energy amount in kilojoules. - * @param doTransfer - Actually transfer - * @return Energy actually transfered. - */ - public long teslaTransfer(long transferEnergy, boolean doTransfer); - - public boolean canTeslaTransfer(TileEntity transferTile); - -} diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java b/electrical/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java deleted file mode 100644 index 9f4fda4b..00000000 --- a/electrical/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java +++ /dev/null @@ -1,93 +0,0 @@ -package resonantinduction.electrical.wire.flat; - -import java.util.Collections; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import codechicken.lib.vec.BlockCoord; -import codechicken.multipart.MultiPartRegistry; -import codechicken.multipart.TileMultipart; - -public class PartFlatSwitchWire extends PartFlatWire -{ - @Override - public boolean canConnectTo(Object obj) - { - if (this.checkRedstone(this.side ^ 0x1)) - { - return super.canConnectTo(obj); - } - - return false; - } - - @Override - public boolean canConnectTo(Object obj, ForgeDirection dir) - { - if (this.checkRedstone(this.side ^ 0x1)) - { - return super.canConnectTo(obj, dir); - } - - return false; - } - - @Override - public String getType() - { - return "resonant_induction_flat_switch_wire"; - } - - @Override - public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack item) - { - TileMultipart tile = tile(); - World w = world(); - - if (item.getItem().itemID == Block.lever.blockID) - { - if (!w.isRemote) - { - PartFlatWire wire = (PartFlatWire) MultiPartRegistry.createPart("resonant_induction_flat_wire", false); - wire.copyFrom(this); - - if (tile.canReplacePart(this, wire)) - { - tile.remPart(this); - TileMultipart.addPart(w, new BlockCoord(tile), wire); - - if (!player.capabilities.isCreativeMode) - { - tile.dropItems(Collections.singletonList(new ItemStack(Block.lever, 1))); - } - } - } - return true; - } - else - { - return super.activate(player, part, item); - } - } - - @Override - public void drop() - { - tile().dropItems(Collections.singletonList(new ItemStack(Block.lever, 1))); - super.drop(); - } - - @Override - public Iterable getDrops() - { - List drops = (List) super.getDrops(); - drops.add(new ItemStack(Block.lever, 1)); - - return drops; - } -} diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/flat/RenderFlatWire.java b/electrical/src/main/scala/resonantinduction/electrical/wire/flat/RenderFlatWire.java deleted file mode 100644 index 83f86a66..00000000 --- a/electrical/src/main/scala/resonantinduction/electrical/wire/flat/RenderFlatWire.java +++ /dev/null @@ -1,472 +0,0 @@ -package resonantinduction.electrical.wire.flat; - -import java.util.Arrays; -import java.util.LinkedList; - -import net.minecraft.util.Icon; -import codechicken.lib.lighting.LightModel; -import codechicken.lib.math.MathHelper; -import codechicken.lib.render.CCModel; -import codechicken.lib.render.ColourModifier; -import codechicken.lib.render.ColourMultiplier; -import codechicken.lib.render.IUVTransformation; -import codechicken.lib.render.IVertexModifier; -import codechicken.lib.render.IconTransformation; -import codechicken.lib.render.RenderUtils; -import codechicken.lib.render.UV; -import codechicken.lib.render.UVScale; -import codechicken.lib.render.UVTranslation; -import codechicken.lib.render.Vertex5; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Rotation; -import codechicken.lib.vec.Transformation; -import codechicken.lib.vec.Translation; -import codechicken.lib.vec.Vector3; - -public class RenderFlatWire -{ - public static Icon flatWireTexture; - - public static class UVT implements IUVTransformation - { - public Transformation t; - private Vector3 vec = new Vector3(); - - public UVT(Transformation t) - { - this.t = t; - } - - @Override - public void transform(UV uv) - { - vec.set(uv.u, 0, uv.v).apply(t); - uv.set(vec.x, vec.z); - } - } - - public static int[] reorientSide = new int[] { 0, 3, 3, 0, 0, 3 }; - - /* - * All generations are done on side 0 so know that for rotation r - * 0 = side 3 = +Z = SOUTH - * 1 = side 4 = -X = WEST - * 2 = side 2 = -Z = NORTH - * 3 = side 5 = +X = EAST - */ - - private static class WireModelGenerator - { - int side; - int tw; - int th; - double w; - double h; - int mask; - int connMask; - int connCount; - CCModel model; - int i = 0; - boolean inv; - - public static int countConnections(int connMask) - { - int n = 0; - for (int r = 0; r < 4; r++) - if ((connMask & 1 << r) != 0) - n += 1; - return n; - } - - public int numFaces() - { - if (inv) - return 22; - - int conns; - if (connCount <= 2) - conns = 2; - else - conns = connCount; - - int faces = conns * 3 + 5; - for (int i = 0; i < 4; i++) - if ((mask >> i & 0x11) == 1) - faces++; - - return faces; - } - - public CCModel generateInvModel(int thickness) - { - return generateModel(modelKey(0, thickness, 0xF0), true); - } - - public CCModel generateModel(int key, boolean inv) - { - this.inv = inv; - - side = (key >> 8) % 6; - tw = (key >> 8) / 6 + 1; - w = tw / 16D; - th = tw + 1; - h = th / 16D; - mask = key & 0xFF; - connMask = (mask & 0xF0) >> 4 | mask & 0xF; - connCount = countConnections(connMask); - model = CCModel.quadModel(numFaces() * 4); - i = 0; - - generateCenter(); - for (int r = 0; r < 4; r++) - generateSide(r); - - model.apply(Rotation.sideOrientation(side, 0).at(Vector3.center)); - - return finishModel(model); - } - - private void generateSide(int r) - { - int type = mask >> r & 0x11; - - Vertex5[] verts; - if (inv) - verts = generateSideInv(r); - - else if (connCount == 0) - if (r % 2 == 1) - verts = generateStub(r); - else - verts = generateFlat(r); - - else if (connCount == 1) - if (connMask == 1 << (r + 2) % 4)// this side is opposite the one with a connection - verts = generateStub(r); - else - verts = generateSideFromType(type, r); - - else - verts = generateSideFromType(type, r); - - Transformation t = Rotation.quarterRotations[r].at(Vector3.center); - for (Vertex5 vert : verts) - vert.apply(t); - - i = addVerts(model, verts, i); - } - - private Vertex5[] generateSideInv(int r) - { - return withBottom(generateStraight(r), 4, 4); - } - - private Vertex5[] generateSideFromType(int type, int r) - { - if (type == 0x00) - return generateFlat(r); - else if (type == 0x01) - return generateCorner(r); - else if (type == 0x10) - return generateStraight(r); - else - return generateInternal(r); - } - - private Vertex5[] generateFlat(int r) - { - Vertex5[] verts = new Vertex5[] { new Vertex5(0.5 - w, 0, 0.5 + w, 16, 16 + tw), new Vertex5(0.5 + w, 0, 0.5 + w, 16, 16 - tw), new Vertex5(0.5 + w, h, 0.5 + w, 16 - th, 16 - tw), new Vertex5(0.5 - w, h, 0.5 + w, 16 - th, 16 + tw) }; - - if (Rotation.rotateSide(side, r) % 2 == 0) // red is on the negative side - { - UVT uvt = new UVT(Rotation.quarterRotations[2].at(new Vector3(8, 0, 16))); - for (Vertex5 vert : verts) - vert.apply(uvt); - } - return verts; - } - - private Vertex5[] generateStub(int r) - { - Vertex5[] verts = generateExtension(4); - - for (int i = 0; i < 4; i++) - verts[i].vec.z -= 0.002;// pull the stub in a little so it - // doesn't z fight with jacketed cables - - reflectSide(verts, r); - return verts; - } - - private Vertex5[] generateStraight(int r) - { - Vertex5[] verts = generateExtension(8); - - reflectSide(verts, r); - return verts; - } - - private Vertex5[] generateCorner(int r) - { - Vertex5[] verts = generateExtension(8 + th); - - // retexture cap - for (int i = 0; i < 4; i++) - verts[i].apply(new UVTranslation(0, -th)); - - // add end face extending around block - verts = Arrays.copyOf(verts, 20); - verts[16] = new Vertex5(0.5 - w, 0, 1, 8 - tw, 24 + 2 * th); - verts[17] = new Vertex5(0.5 + w, 0, 1, 8 + tw, 24 + 2 * th); - verts[18] = new Vertex5(0.5 + w, 0, 1 + h, 8 + tw, 24 + th); - verts[19] = new Vertex5(0.5 - w, 0, 1 + h, 8 - tw, 24 + th); - - reflectSide(verts, r); - return verts; - } - - private Vertex5[] generateInternal(int r) - { - Vertex5[] verts = generateExtension(8); - - // retexture cap - verts[0].uv.set(8 + tw, 24); - verts[1].uv.set(8 - tw, 24); - verts[2].uv.set(8 - tw, 24 + tw); - verts[3].uv.set(8 + tw, 24 + tw); - - reflectSide(verts, r); - - // offset side textures - for (int i = 4; i < 16; i++) - verts[i].apply(new UVTranslation(16, 0)); - - return verts; - } - - private Vertex5[] generateExtension(int tl) - { - double l = tl / 16D; - - return new Vertex5[] {// cap - new Vertex5(0.5 - w, 0, 0.5 + l, 8 - tw, 24 + 2 * th), new Vertex5(0.5 + w, 0, 0.5 + l, 8 + tw, 24 + 2 * th), new Vertex5(0.5 + w, h, 0.5 + l, 8 + tw, 24 + th), new Vertex5(0.5 - w, h, 0.5 + l, 8 - tw, 24 + th), - - // top - new Vertex5(0.5 - w, h, 0.5 + l, 8 - tw, 16 + tl), new Vertex5(0.5 + w, h, 0.5 + l, 8 + tw, 16 + tl), new Vertex5(0.5 + w, h, 0.5 + w, 8 + tw, 16 + tw), new Vertex5(0.5 - w, h, 0.5 + w, 8 - tw, 16 + tw), - - // left - new Vertex5(0.5 - w, 0, 0.5 + w, 0, 16 + tw), new Vertex5(0.5 - w, 0, 0.5 + l, 0, 16 + tl), new Vertex5(0.5 - w, h, 0.5 + l, th, 16 + tl), new Vertex5(0.5 - w, h, 0.5 + w, th, 16 + tw), - - // right - new Vertex5(0.5 + w, 0, 0.5 + l, 16, 16 + tl), new Vertex5(0.5 + w, 0, 0.5 + w, 16, 16 + tw), new Vertex5(0.5 + w, h, 0.5 + w, 16 - th, 16 + tw), new Vertex5(0.5 + w, h, 0.5 + l, 16 - th, 16 + tl) }; - } - - private void generateCenter() - { - int tex;// 0 = straight n/s, 1 = straight e/w, 2 = circle - if (connCount == 0) - tex = 1; - else if (connCount == 1) - tex = (connMask & 5) != 0 ? 0 : 1;// if there is one connection, and it is - // north/south then north/south, otherwise - // east/west - else if (connMask == 5) - tex = 0; - else if (connMask == 10) - tex = 1; - else - tex = 2; - - Vertex5[] verts = new Vertex5[] { new Vertex5(0.5 - w, h, 0.5 + w, 8 - tw, 16 + tw), new Vertex5(0.5 + w, h, 0.5 + w, 8 + tw, 16 + tw), new Vertex5(0.5 + w, h, 0.5 - w, 8 + tw, 16 - tw), new Vertex5(0.5 - w, h, 0.5 - w, 8 - tw, 16 - tw) }; - - if (tex == 0 || tex == 1) - tex = (tex + reorientSide[side]) % 2; - - int r = reorientSide[side]; - if (tex == 1) - r += 3; - - if (r != 0) - { - IUVTransformation uvt = new UVT(Rotation.quarterRotations[r % 4].at(new Vector3(8, 0, 16))); - for (Vertex5 vert : verts) - vert.apply(uvt); - } - - if (tex == 2) - {// circle (translate across to u = 24) - UVTranslation uvt = new UVTranslation(16, 0); - for (Vertex5 vert : verts) - vert.apply(uvt); - } - - if (inv) - verts = withBottom(verts, 0, 4); - - i = addVerts(model, verts, i); - } - - private static UVT sideReflect = new UVT(Rotation.quarterRotations[2].at(new Vector3(8, 0, 16))); - - private void reflectSide(Vertex5[] verts, int r) - { - if ((r + reorientSide[side]) % 4 >= 2)// rotate the texture about - // the y center - for (Vertex5 vert : verts) - vert.apply(sideReflect); - } - - /** - * Returns a copy of vertices with the bottom face added at the start. - * - * @param start The index of the first vertex making up the top face - * @param count The number of vertices making up the top face - */ - private Vertex5[] withBottom(Vertex5[] verts, int start, int count) - { - Vertex5[] i_verts = new Vertex5[verts.length + count]; - - // add the bottom face, just a copy of the top, rotated about the z - // axis - Transformation r = new Rotation(MathHelper.pi, 0, 0, 1).at(new Vector3(0.5, h / 2, 0)); - for (int i = 0; i < count; i++) - i_verts[i] = verts[i + start].copy().apply(r); - System.arraycopy(verts, 0, i_verts, count, verts.length); - return i_verts; - } - } - - /** - * Array of all built models. These will be generated on demand. - */ - public static CCModel[] wireModels = new CCModel[3 * 6 * 256]; - public static CCModel[] invModels = new CCModel[3]; - private static WireModelGenerator gen_inst = new WireModelGenerator(); - - /** - * Puts verts into model m starting at index k - */ - public static int addVerts(CCModel m, Vertex5[] verts, int k) - { - for (int i = 0; i < verts.length; i++) - m.verts[k + i] = verts[i]; - - return k + verts.length; - } - - public static CCModel finishModel(CCModel m) - { - m.apply(new UVScale(1 / 32D)); - m.shrinkUVs(0.0005); - m.computeNormals(); - m.computeLighting(LightModel.standardLightModel); - - return m; - } - - /** - * Returns a tightly packed unique index for the specific model represented - * by this wire. The mask is split into 3 sections the combination of - * corresponding bits from the two lowest nybbles gives the connection type - * in that direction. - * 00 = none - * 01 = corner - * 10 = straight - * 11 = internal The - * second byte contains the thickness*6+side - * - * @param side The side the wire is attached to - * @param thickness The thickness of the wire -1 in 1/8th blocks. Supported - * values 0, 1, 2 - * @param connMap The connection mask of the wire - */ - public static int modelKey(int side, int thickness, int connMap) - { - int key = connMap & 0xFF;// take the straight and corner connections - - int renderCorner = connMap >> 20 & 0xF; - key |= (renderCorner ^ key & 0xF) << 4;// any corner connections that aren't rendered - // convert to straight - key &= ~0xF | renderCorner;// set corners to renderCorners - - int internal = (connMap & 0xF00) >> 8;// internal connections - key |= internal << 4 | internal;// if internal is set, set both straight and corner to 1 - - key |= side + thickness * 6 << 8;// add side and thickness - return key; - } - - public static int modelKey(PartFlatWire w) - { - return modelKey(w.side, w.getThickness(), w.connMap); - } - - public static CCModel getOrGenerateModel(int key) - { - CCModel m = wireModels[key]; - if (m == null) - wireModels[key] = m = gen_inst.generateModel(key, false); - return m; - } - - public static void render(PartFlatWire w, Vector3 pos) - { - IVertexModifier m = w.getColour().pack() == -1 ? ColourModifier.instance : new ColourMultiplier(w.getColour()); - CCModel model = getOrGenerateModel(modelKey(w)); - model.render(new Translation(pos), new IconTransformation(w.getIcon()), m); - } - - public static void renderInv(int thickness, Transformation t, Icon icon) - { - CCModel m = invModels[thickness]; - if (m == null) - invModels[thickness] = m = gen_inst.generateInvModel(thickness); - - m.render(t, new IconTransformation(icon)); - } - - public static void renderBreakingOverlay(Icon icon, PartFlatWire wire) - { - int key = modelKey(wire); - int side = (key >> 8) % 6; - double w = ((key >> 8) / 6 + 1) / 16D; - double h = w + 1 / 16D; - int mask = key & 0xFF; - int connMask = (mask & 0xF0) >> 4 | mask & 0xF; - int connCount = WireModelGenerator.countConnections(connMask); - - LinkedList boxes = new LinkedList(); - boxes.add(new Cuboid6(0.5 - w, 0, 0.5 - w, 0.5 + w, h, 0.5 + w).apply(Rotation.sideRotations[side].at(Vector3.center)));// center - for (int r = 0; r < 4; r++) - { - int length; - if (connCount == 0) - { - if (r % 2 == 1) - length = 4; - else - length = 0; - } - else if (connCount == 1) - { - if (connMask == 1 << (r + 2) % 4)// this side is opposite the one with a connection - length = 4; - else if (connMask == 1 << r) - length = 8; - else - length = 0; - } - else - length = (connMask & 1 << r) != 0 ? 8 : 0; - - if (length > 0) - { - double l = length / 16D; - boxes.add(new Cuboid6(0.5 - w, 0, 0.5 + w, 0.5 + w, h, 0.5 + l).apply(Rotation.sideOrientation(side, r).at(Vector3.center))); - } - } - - for (Cuboid6 box : boxes) - RenderUtils.renderBlock(box, 0, new Translation(wire.x(), wire.y(), wire.z()), new IconTransformation(icon), null); - } -} \ No newline at end of file diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/trait/TraitEnergyHandler.java b/electrical/src/main/scala/resonantinduction/electrical/wire/trait/TraitEnergyHandler.java deleted file mode 100644 index 65a29fb3..00000000 --- a/electrical/src/main/scala/resonantinduction/electrical/wire/trait/TraitEnergyHandler.java +++ /dev/null @@ -1,193 +0,0 @@ -package resonantinduction.electrical.wire.trait; - -import java.util.HashSet; -import java.util.Set; - -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.electrical.wire.PartConductor; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TileMultipart; -import cofh.api.energy.IEnergyHandler; - -public class TraitEnergyHandler extends TileMultipart implements IEnergyHandler -{ - public Set teConductorInterfaces = new HashSet(); - public Set teInterfaces = new HashSet(); - - @Override - public void copyFrom(TileMultipart that) - { - super.copyFrom(that); - - if (that instanceof TraitEnergyHandler) - { - this.teConductorInterfaces = ((TraitEnergyHandler) that).teConductorInterfaces; - this.teInterfaces = ((TraitEnergyHandler) that).teInterfaces; - } - } - - @Override - public void bindPart(TMultiPart part) - { - super.bindPart(part); - - if (part instanceof IEnergyHandler) - { - if (part instanceof PartConductor) - { - this.teConductorInterfaces.add((PartConductor) part); - } - else - { - this.teInterfaces.add((IEnergyHandler) part); - } - } - } - - @Override - public void partRemoved(TMultiPart part, int p) - { - super.partRemoved(part, p); - - if (part instanceof IEnergyHandler) - { - if (part instanceof PartConductor) - { - this.teConductorInterfaces.remove(part); - } - else - { - this.teInterfaces.remove(part); - } - } - } - - @Override - public void clearParts() - { - super.clearParts(); - this.teInterfaces.clear(); - this.teConductorInterfaces.clear(); - } - - @Override - public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) - { - /** - * Try out different sides to try to inject energy into. - */ - if (this.partMap(from.ordinal()) == null) - { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir != from.getOpposite()) - { - TMultiPart part = this.partMap(dir.ordinal()); - - if (this.teConductorInterfaces.contains(part)) - { - return ((IEnergyHandler) part).receiveEnergy(from, maxReceive, simulate); - } - } - } - } - - /** - * Failed, try pure TE interfaces. - */ - for (IEnergyHandler handler : this.teInterfaces) - { - return handler.receiveEnergy(from, maxReceive, simulate); - } - - return 0; - } - - @Override - public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) - { - return 0; - } - - @Override - public boolean canInterface(ForgeDirection from) - { - if (this.partMap(from.ordinal()) == null) - { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir != from.getOpposite()) - { - TMultiPart part = this.partMap(dir.ordinal()); - - if (this.teConductorInterfaces.contains(part)) - { - return ((IEnergyHandler) part).canInterface(from); - } - } - } - } - - for (IEnergyHandler handler : this.teInterfaces) - { - return handler.canInterface(from); - } - - return false; - } - - @Override - public int getEnergyStored(ForgeDirection from) - { - if (this.partMap(from.ordinal()) == null) - { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir != from.getOpposite()) - { - TMultiPart part = this.partMap(dir.ordinal()); - - if (this.teConductorInterfaces.contains(part)) - { - return ((IEnergyHandler) part).getEnergyStored(from); - } - } - } - } - - for (IEnergyHandler handler : this.teInterfaces) - { - return handler.getEnergyStored(from); - } - - return 0; - } - - @Override - public int getMaxEnergyStored(ForgeDirection from) - { - if (this.partMap(from.ordinal()) == null) - { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir != from.getOpposite()) - { - TMultiPart part = this.partMap(dir.ordinal()); - - if (this.teConductorInterfaces.contains(part)) - { - return ((IEnergyHandler) part).getMaxEnergyStored(from); - } - } - } - } - - for (IEnergyHandler handler : this.teInterfaces) - { - return handler.getMaxEnergyStored(from); - } - - return 0; - } - -} diff --git a/archaic/src/main/scala/resonantinduction/archaic/Archaic.java b/src/main/scala/resonantinduction/archaic/Archaic.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/Archaic.java rename to src/main/scala/resonantinduction/archaic/Archaic.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/ClientProxy.java b/src/main/scala/resonantinduction/archaic/ClientProxy.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/ClientProxy.java rename to src/main/scala/resonantinduction/archaic/ClientProxy.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/CommonProxy.java b/src/main/scala/resonantinduction/archaic/CommonProxy.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/CommonProxy.java rename to src/main/scala/resonantinduction/archaic/CommonProxy.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/blocks/TileTurntable.scala b/src/main/scala/resonantinduction/archaic/blocks/TileTurntable.scala similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/blocks/TileTurntable.scala rename to src/main/scala/resonantinduction/archaic/blocks/TileTurntable.scala diff --git a/archaic/src/main/scala/resonantinduction/archaic/crate/BlockCrate.java b/src/main/scala/resonantinduction/archaic/crate/BlockCrate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/crate/BlockCrate.java rename to src/main/scala/resonantinduction/archaic/crate/BlockCrate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/crate/CrateCraftingHandler.java b/src/main/scala/resonantinduction/archaic/crate/CrateCraftingHandler.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/crate/CrateCraftingHandler.java rename to src/main/scala/resonantinduction/archaic/crate/CrateCraftingHandler.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/crate/InventoryCrate.java b/src/main/scala/resonantinduction/archaic/crate/InventoryCrate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/crate/InventoryCrate.java rename to src/main/scala/resonantinduction/archaic/crate/InventoryCrate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/crate/ItemBlockCrate.java b/src/main/scala/resonantinduction/archaic/crate/ItemBlockCrate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/crate/ItemBlockCrate.java rename to src/main/scala/resonantinduction/archaic/crate/ItemBlockCrate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/crate/PathfinderCrate.java b/src/main/scala/resonantinduction/archaic/crate/PathfinderCrate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/crate/PathfinderCrate.java rename to src/main/scala/resonantinduction/archaic/crate/PathfinderCrate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/crate/RenderCrate.java b/src/main/scala/resonantinduction/archaic/crate/RenderCrate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/crate/RenderCrate.java rename to src/main/scala/resonantinduction/archaic/crate/RenderCrate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/crate/TileCrate.java b/src/main/scala/resonantinduction/archaic/crate/TileCrate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/crate/TileCrate.java rename to src/main/scala/resonantinduction/archaic/crate/TileCrate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/engineering/ItemHammer.java b/src/main/scala/resonantinduction/archaic/engineering/ItemHammer.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/engineering/ItemHammer.java rename to src/main/scala/resonantinduction/archaic/engineering/ItemHammer.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/engineering/TileEngineeringTable.java b/src/main/scala/resonantinduction/archaic/engineering/TileEngineeringTable.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/engineering/TileEngineeringTable.java rename to src/main/scala/resonantinduction/archaic/engineering/TileEngineeringTable.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/filter/BlockImprinter.java b/src/main/scala/resonantinduction/archaic/filter/BlockImprinter.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/filter/BlockImprinter.java rename to src/main/scala/resonantinduction/archaic/filter/BlockImprinter.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/filter/RenderImprinter.java b/src/main/scala/resonantinduction/archaic/filter/RenderImprinter.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/filter/RenderImprinter.java rename to src/main/scala/resonantinduction/archaic/filter/RenderImprinter.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/filter/TileFilter.java b/src/main/scala/resonantinduction/archaic/filter/TileFilter.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/filter/TileFilter.java rename to src/main/scala/resonantinduction/archaic/filter/TileFilter.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/filter/TileImprinter.java b/src/main/scala/resonantinduction/archaic/filter/TileImprinter.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/filter/TileImprinter.java rename to src/main/scala/resonantinduction/archaic/filter/TileImprinter.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/firebox/BlockFirebox.java b/src/main/scala/resonantinduction/archaic/firebox/BlockFirebox.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/firebox/BlockFirebox.java rename to src/main/scala/resonantinduction/archaic/firebox/BlockFirebox.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/firebox/BlockHotPlate.java b/src/main/scala/resonantinduction/archaic/firebox/BlockHotPlate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/firebox/BlockHotPlate.java rename to src/main/scala/resonantinduction/archaic/firebox/BlockHotPlate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/firebox/RenderHotPlate.java b/src/main/scala/resonantinduction/archaic/firebox/RenderHotPlate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/firebox/RenderHotPlate.java rename to src/main/scala/resonantinduction/archaic/firebox/RenderHotPlate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/firebox/TileFirebox.java b/src/main/scala/resonantinduction/archaic/firebox/TileFirebox.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/firebox/TileFirebox.java rename to src/main/scala/resonantinduction/archaic/firebox/TileFirebox.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/firebox/TileHotPlate.java b/src/main/scala/resonantinduction/archaic/firebox/TileHotPlate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/firebox/TileHotPlate.java rename to src/main/scala/resonantinduction/archaic/firebox/TileHotPlate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/fluid/grate/TileGrate.java b/src/main/scala/resonantinduction/archaic/fluid/grate/TileGrate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/fluid/grate/TileGrate.java rename to src/main/scala/resonantinduction/archaic/fluid/grate/TileGrate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/fluid/gutter/FluidGravityNode.java b/src/main/scala/resonantinduction/archaic/fluid/gutter/FluidGravityNode.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/fluid/gutter/FluidGravityNode.java rename to src/main/scala/resonantinduction/archaic/fluid/gutter/FluidGravityNode.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/fluid/gutter/TileGutter.java b/src/main/scala/resonantinduction/archaic/fluid/gutter/TileGutter.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/fluid/gutter/TileGutter.java rename to src/main/scala/resonantinduction/archaic/fluid/gutter/TileGutter.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/fluid/tank/ItemBlockTank.java b/src/main/scala/resonantinduction/archaic/fluid/tank/ItemBlockTank.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/fluid/tank/ItemBlockTank.java rename to src/main/scala/resonantinduction/archaic/fluid/tank/ItemBlockTank.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/fluid/tank/TankNetwork.java b/src/main/scala/resonantinduction/archaic/fluid/tank/TankNetwork.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/fluid/tank/TankNetwork.java rename to src/main/scala/resonantinduction/archaic/fluid/tank/TankNetwork.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/fluid/tank/TileTank.java b/src/main/scala/resonantinduction/archaic/fluid/tank/TileTank.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/fluid/tank/TileTank.java rename to src/main/scala/resonantinduction/archaic/fluid/tank/TileTank.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/process/BlockCastingMold.java b/src/main/scala/resonantinduction/archaic/process/BlockCastingMold.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/process/BlockCastingMold.java rename to src/main/scala/resonantinduction/archaic/process/BlockCastingMold.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/process/BlockMillstone.java b/src/main/scala/resonantinduction/archaic/process/BlockMillstone.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/process/BlockMillstone.java rename to src/main/scala/resonantinduction/archaic/process/BlockMillstone.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/process/RenderCastingMold.java b/src/main/scala/resonantinduction/archaic/process/RenderCastingMold.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/process/RenderCastingMold.java rename to src/main/scala/resonantinduction/archaic/process/RenderCastingMold.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/process/RenderMillstone.java b/src/main/scala/resonantinduction/archaic/process/RenderMillstone.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/process/RenderMillstone.java rename to src/main/scala/resonantinduction/archaic/process/RenderMillstone.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/process/TileCastingMold.java b/src/main/scala/resonantinduction/archaic/process/TileCastingMold.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/process/TileCastingMold.java rename to src/main/scala/resonantinduction/archaic/process/TileCastingMold.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/process/TileMillstone.java b/src/main/scala/resonantinduction/archaic/process/TileMillstone.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/process/TileMillstone.java rename to src/main/scala/resonantinduction/archaic/process/TileMillstone.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/waila/Waila.java b/src/main/scala/resonantinduction/archaic/waila/Waila.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/waila/Waila.java rename to src/main/scala/resonantinduction/archaic/waila/Waila.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/waila/WailaCrate.java b/src/main/scala/resonantinduction/archaic/waila/WailaCrate.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/waila/WailaCrate.java rename to src/main/scala/resonantinduction/archaic/waila/WailaCrate.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/waila/WailaFluidTank.java b/src/main/scala/resonantinduction/archaic/waila/WailaFluidTank.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/waila/WailaFluidTank.java rename to src/main/scala/resonantinduction/archaic/waila/WailaFluidTank.java diff --git a/archaic/src/main/scala/resonantinduction/archaic/waila/WailaRegistrar.java b/src/main/scala/resonantinduction/archaic/waila/WailaRegistrar.java similarity index 100% rename from archaic/src/main/scala/resonantinduction/archaic/waila/WailaRegistrar.java rename to src/main/scala/resonantinduction/archaic/waila/WailaRegistrar.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/Atomic.java b/src/main/scala/resonantinduction/atomic/Atomic.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/Atomic.java rename to src/main/scala/resonantinduction/atomic/Atomic.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/ClientProxy.java b/src/main/scala/resonantinduction/atomic/ClientProxy.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/ClientProxy.java rename to src/main/scala/resonantinduction/atomic/ClientProxy.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/CommonProxy.java b/src/main/scala/resonantinduction/atomic/CommonProxy.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/CommonProxy.java rename to src/main/scala/resonantinduction/atomic/CommonProxy.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/ReactorExplosion.java b/src/main/scala/resonantinduction/atomic/ReactorExplosion.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/ReactorExplosion.java rename to src/main/scala/resonantinduction/atomic/ReactorExplosion.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/SoundHandler.java b/src/main/scala/resonantinduction/atomic/SoundHandler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/SoundHandler.java rename to src/main/scala/resonantinduction/atomic/SoundHandler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/blocks/BlockToxicWaste.java b/src/main/scala/resonantinduction/atomic/blocks/BlockToxicWaste.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/blocks/BlockToxicWaste.java rename to src/main/scala/resonantinduction/atomic/blocks/BlockToxicWaste.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/blocks/BlockUraniumOre.java b/src/main/scala/resonantinduction/atomic/blocks/BlockUraniumOre.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/blocks/BlockUraniumOre.java rename to src/main/scala/resonantinduction/atomic/blocks/BlockUraniumOre.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/blocks/TileElectromagnet.java b/src/main/scala/resonantinduction/atomic/blocks/TileElectromagnet.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/blocks/TileElectromagnet.java rename to src/main/scala/resonantinduction/atomic/blocks/TileElectromagnet.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/blocks/TileSiren.java b/src/main/scala/resonantinduction/atomic/blocks/TileSiren.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/blocks/TileSiren.java rename to src/main/scala/resonantinduction/atomic/blocks/TileSiren.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.java b/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.java rename to src/main/scala/resonantinduction/atomic/items/ItemAntimatter.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/items/ItemBreederFuel.java b/src/main/scala/resonantinduction/atomic/items/ItemBreederFuel.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/items/ItemBreederFuel.java rename to src/main/scala/resonantinduction/atomic/items/ItemBreederFuel.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/items/ItemCell.java b/src/main/scala/resonantinduction/atomic/items/ItemCell.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/items/ItemCell.java rename to src/main/scala/resonantinduction/atomic/items/ItemCell.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/items/ItemDarkMatter.java b/src/main/scala/resonantinduction/atomic/items/ItemDarkMatter.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/items/ItemDarkMatter.java rename to src/main/scala/resonantinduction/atomic/items/ItemDarkMatter.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.java b/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.java rename to src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/items/ItemHazmat.java b/src/main/scala/resonantinduction/atomic/items/ItemHazmat.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/items/ItemHazmat.java rename to src/main/scala/resonantinduction/atomic/items/ItemHazmat.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/items/ItemRadioactive.java b/src/main/scala/resonantinduction/atomic/items/ItemRadioactive.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/items/ItemRadioactive.java rename to src/main/scala/resonantinduction/atomic/items/ItemRadioactive.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/items/ItemUranium.java b/src/main/scala/resonantinduction/atomic/items/ItemUranium.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/items/ItemUranium.java rename to src/main/scala/resonantinduction/atomic/items/ItemUranium.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/ContainerAccelerator.java b/src/main/scala/resonantinduction/atomic/machine/accelerator/ContainerAccelerator.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/ContainerAccelerator.java rename to src/main/scala/resonantinduction/atomic/machine/accelerator/ContainerAccelerator.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/EntityParticle.java b/src/main/scala/resonantinduction/atomic/machine/accelerator/EntityParticle.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/EntityParticle.java rename to src/main/scala/resonantinduction/atomic/machine/accelerator/EntityParticle.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/GuiAccelerator.java b/src/main/scala/resonantinduction/atomic/machine/accelerator/GuiAccelerator.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/GuiAccelerator.java rename to src/main/scala/resonantinduction/atomic/machine/accelerator/GuiAccelerator.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/RenderParticle.java b/src/main/scala/resonantinduction/atomic/machine/accelerator/RenderParticle.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/RenderParticle.java rename to src/main/scala/resonantinduction/atomic/machine/accelerator/RenderParticle.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java b/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java rename to src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/boiler/BlockNuclearBoiler.java b/src/main/scala/resonantinduction/atomic/machine/boiler/BlockNuclearBoiler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/boiler/BlockNuclearBoiler.java rename to src/main/scala/resonantinduction/atomic/machine/boiler/BlockNuclearBoiler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/boiler/GuiChemicalExtractor.java b/src/main/scala/resonantinduction/atomic/machine/boiler/GuiChemicalExtractor.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/boiler/GuiChemicalExtractor.java rename to src/main/scala/resonantinduction/atomic/machine/boiler/GuiChemicalExtractor.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/boiler/GuiNuclearBoiler.java b/src/main/scala/resonantinduction/atomic/machine/boiler/GuiNuclearBoiler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/boiler/GuiNuclearBoiler.java rename to src/main/scala/resonantinduction/atomic/machine/boiler/GuiNuclearBoiler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/boiler/RenderNuclearBoiler.java b/src/main/scala/resonantinduction/atomic/machine/boiler/RenderNuclearBoiler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/boiler/RenderNuclearBoiler.java rename to src/main/scala/resonantinduction/atomic/machine/boiler/RenderNuclearBoiler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/boiler/TileNuclearBoiler.java b/src/main/scala/resonantinduction/atomic/machine/boiler/TileNuclearBoiler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/boiler/TileNuclearBoiler.java rename to src/main/scala/resonantinduction/atomic/machine/boiler/TileNuclearBoiler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/centrifuge/BlockCentrifuge.java b/src/main/scala/resonantinduction/atomic/machine/centrifuge/BlockCentrifuge.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/centrifuge/BlockCentrifuge.java rename to src/main/scala/resonantinduction/atomic/machine/centrifuge/BlockCentrifuge.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/centrifuge/ContainerCentrifuge.java b/src/main/scala/resonantinduction/atomic/machine/centrifuge/ContainerCentrifuge.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/centrifuge/ContainerCentrifuge.java rename to src/main/scala/resonantinduction/atomic/machine/centrifuge/ContainerCentrifuge.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/centrifuge/GuiCentrifuge.java b/src/main/scala/resonantinduction/atomic/machine/centrifuge/GuiCentrifuge.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/centrifuge/GuiCentrifuge.java rename to src/main/scala/resonantinduction/atomic/machine/centrifuge/GuiCentrifuge.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/centrifuge/RenderCentrifuge.java b/src/main/scala/resonantinduction/atomic/machine/centrifuge/RenderCentrifuge.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/centrifuge/RenderCentrifuge.java rename to src/main/scala/resonantinduction/atomic/machine/centrifuge/RenderCentrifuge.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/centrifuge/TileCentrifuge.java b/src/main/scala/resonantinduction/atomic/machine/centrifuge/TileCentrifuge.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/centrifuge/TileCentrifuge.java rename to src/main/scala/resonantinduction/atomic/machine/centrifuge/TileCentrifuge.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/extractor/BlockChemicalExtractor.java b/src/main/scala/resonantinduction/atomic/machine/extractor/BlockChemicalExtractor.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/extractor/BlockChemicalExtractor.java rename to src/main/scala/resonantinduction/atomic/machine/extractor/BlockChemicalExtractor.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/extractor/ContainerChemicalExtractor.java b/src/main/scala/resonantinduction/atomic/machine/extractor/ContainerChemicalExtractor.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/extractor/ContainerChemicalExtractor.java rename to src/main/scala/resonantinduction/atomic/machine/extractor/ContainerChemicalExtractor.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/extractor/RenderChemicalExtractor.java b/src/main/scala/resonantinduction/atomic/machine/extractor/RenderChemicalExtractor.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/extractor/RenderChemicalExtractor.java rename to src/main/scala/resonantinduction/atomic/machine/extractor/RenderChemicalExtractor.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/extractor/TileChemicalExtractor.java b/src/main/scala/resonantinduction/atomic/machine/extractor/TileChemicalExtractor.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/extractor/TileChemicalExtractor.java rename to src/main/scala/resonantinduction/atomic/machine/extractor/TileChemicalExtractor.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/extractor/TileProcess.java b/src/main/scala/resonantinduction/atomic/machine/extractor/TileProcess.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/extractor/TileProcess.java rename to src/main/scala/resonantinduction/atomic/machine/extractor/TileProcess.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/BlockElectricTurbine.java b/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/BlockElectricTurbine.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/BlockElectricTurbine.java rename to src/main/scala/resonantinduction/atomic/machine/extractor/turbine/BlockElectricTurbine.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/RenderElectricTurbine.java b/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/RenderElectricTurbine.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/RenderElectricTurbine.java rename to src/main/scala/resonantinduction/atomic/machine/extractor/turbine/RenderElectricTurbine.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/TileElectricTurbine.java b/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/TileElectricTurbine.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/TileElectricTurbine.java rename to src/main/scala/resonantinduction/atomic/machine/extractor/turbine/TileElectricTurbine.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/TileFunnel.java b/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/TileFunnel.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/extractor/turbine/TileFunnel.java rename to src/main/scala/resonantinduction/atomic/machine/extractor/turbine/TileFunnel.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/fulmination/FulminationHandler.java b/src/main/scala/resonantinduction/atomic/machine/fulmination/FulminationHandler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/fulmination/FulminationHandler.java rename to src/main/scala/resonantinduction/atomic/machine/fulmination/FulminationHandler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/fulmination/TileFulmination.java b/src/main/scala/resonantinduction/atomic/machine/fulmination/TileFulmination.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/fulmination/TileFulmination.java rename to src/main/scala/resonantinduction/atomic/machine/fulmination/TileFulmination.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/plasma/BlockPlasmaHeater.java b/src/main/scala/resonantinduction/atomic/machine/plasma/BlockPlasmaHeater.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/plasma/BlockPlasmaHeater.java rename to src/main/scala/resonantinduction/atomic/machine/plasma/BlockPlasmaHeater.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/plasma/ContainerNuclearBoiler.java b/src/main/scala/resonantinduction/atomic/machine/plasma/ContainerNuclearBoiler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/plasma/ContainerNuclearBoiler.java rename to src/main/scala/resonantinduction/atomic/machine/plasma/ContainerNuclearBoiler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/plasma/RenderPlasmaHeater.java b/src/main/scala/resonantinduction/atomic/machine/plasma/RenderPlasmaHeater.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/plasma/RenderPlasmaHeater.java rename to src/main/scala/resonantinduction/atomic/machine/plasma/RenderPlasmaHeater.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasma.java b/src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasma.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasma.java rename to src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasma.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasmaHeater.java b/src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasmaHeater.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasmaHeater.java rename to src/main/scala/resonantinduction/atomic/machine/plasma/TilePlasmaHeater.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/quantum/ContainerQuantumAssembler.java b/src/main/scala/resonantinduction/atomic/machine/quantum/ContainerQuantumAssembler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/quantum/ContainerQuantumAssembler.java rename to src/main/scala/resonantinduction/atomic/machine/quantum/ContainerQuantumAssembler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/quantum/GuiQuantumAssembler.java b/src/main/scala/resonantinduction/atomic/machine/quantum/GuiQuantumAssembler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/quantum/GuiQuantumAssembler.java rename to src/main/scala/resonantinduction/atomic/machine/quantum/GuiQuantumAssembler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/quantum/RenderQuantumAssembler.java b/src/main/scala/resonantinduction/atomic/machine/quantum/RenderQuantumAssembler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/quantum/RenderQuantumAssembler.java rename to src/main/scala/resonantinduction/atomic/machine/quantum/RenderQuantumAssembler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/quantum/TileQuantumAssembler.java b/src/main/scala/resonantinduction/atomic/machine/quantum/TileQuantumAssembler.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/quantum/TileQuantumAssembler.java rename to src/main/scala/resonantinduction/atomic/machine/quantum/TileQuantumAssembler.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/reactor/BlockReactorDrain.java b/src/main/scala/resonantinduction/atomic/machine/reactor/BlockReactorDrain.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/reactor/BlockReactorDrain.java rename to src/main/scala/resonantinduction/atomic/machine/reactor/BlockReactorDrain.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/reactor/ContainerReactorCell.java b/src/main/scala/resonantinduction/atomic/machine/reactor/ContainerReactorCell.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/reactor/ContainerReactorCell.java rename to src/main/scala/resonantinduction/atomic/machine/reactor/ContainerReactorCell.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/reactor/GuiReactorCell.java b/src/main/scala/resonantinduction/atomic/machine/reactor/GuiReactorCell.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/reactor/GuiReactorCell.java rename to src/main/scala/resonantinduction/atomic/machine/reactor/GuiReactorCell.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/reactor/RenderReactorCell.java b/src/main/scala/resonantinduction/atomic/machine/reactor/RenderReactorCell.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/reactor/RenderReactorCell.java rename to src/main/scala/resonantinduction/atomic/machine/reactor/RenderReactorCell.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/reactor/TileControlRod.java b/src/main/scala/resonantinduction/atomic/machine/reactor/TileControlRod.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/reactor/TileControlRod.java rename to src/main/scala/resonantinduction/atomic/machine/reactor/TileControlRod.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/reactor/TileReactorCell.java b/src/main/scala/resonantinduction/atomic/machine/reactor/TileReactorCell.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/reactor/TileReactorCell.java rename to src/main/scala/resonantinduction/atomic/machine/reactor/TileReactorCell.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/reactor/TileReactorDrain.java b/src/main/scala/resonantinduction/atomic/machine/reactor/TileReactorDrain.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/reactor/TileReactorDrain.java rename to src/main/scala/resonantinduction/atomic/machine/reactor/TileReactorDrain.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/thermometer/ItemBlockThermometer.java b/src/main/scala/resonantinduction/atomic/machine/thermometer/ItemBlockThermometer.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/thermometer/ItemBlockThermometer.java rename to src/main/scala/resonantinduction/atomic/machine/thermometer/ItemBlockThermometer.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/thermometer/RenderThermometer.java b/src/main/scala/resonantinduction/atomic/machine/thermometer/RenderThermometer.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/thermometer/RenderThermometer.java rename to src/main/scala/resonantinduction/atomic/machine/thermometer/RenderThermometer.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/thermometer/TileThermometer.java b/src/main/scala/resonantinduction/atomic/machine/thermometer/TileThermometer.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/machine/thermometer/TileThermometer.java rename to src/main/scala/resonantinduction/atomic/machine/thermometer/TileThermometer.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/schematic/SchematicAccelerator.java b/src/main/scala/resonantinduction/atomic/schematic/SchematicAccelerator.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/schematic/SchematicAccelerator.java rename to src/main/scala/resonantinduction/atomic/schematic/SchematicAccelerator.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/schematic/SchematicBreedingReactor.java b/src/main/scala/resonantinduction/atomic/schematic/SchematicBreedingReactor.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/schematic/SchematicBreedingReactor.java rename to src/main/scala/resonantinduction/atomic/schematic/SchematicBreedingReactor.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/schematic/SchematicFissionReactor.java b/src/main/scala/resonantinduction/atomic/schematic/SchematicFissionReactor.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/schematic/SchematicFissionReactor.java rename to src/main/scala/resonantinduction/atomic/schematic/SchematicFissionReactor.java diff --git a/atomic/src/main/scala/resonantinduction/atomic/schematic/SchematicFusionReactor.java b/src/main/scala/resonantinduction/atomic/schematic/SchematicFusionReactor.java similarity index 100% rename from atomic/src/main/scala/resonantinduction/atomic/schematic/SchematicFusionReactor.java rename to src/main/scala/resonantinduction/atomic/schematic/SchematicFusionReactor.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/ClientProxy.java b/src/main/scala/resonantinduction/electrical/ClientProxy.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/ClientProxy.java rename to src/main/scala/resonantinduction/electrical/ClientProxy.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/CommonProxy.java b/src/main/scala/resonantinduction/electrical/CommonProxy.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/CommonProxy.java rename to src/main/scala/resonantinduction/electrical/CommonProxy.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/Electrical.java b/src/main/scala/resonantinduction/electrical/Electrical.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/Electrical.java rename to src/main/scala/resonantinduction/electrical/Electrical.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/MultipartElectrical.java b/src/main/scala/resonantinduction/electrical/MultipartElectrical.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/MultipartElectrical.java rename to src/main/scala/resonantinduction/electrical/MultipartElectrical.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/battery/BlockBattery.java b/src/main/scala/resonantinduction/electrical/battery/BlockBattery.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/battery/BlockBattery.java rename to src/main/scala/resonantinduction/electrical/battery/BlockBattery.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/battery/EnergyDistributionNetwork.java b/src/main/scala/resonantinduction/electrical/battery/EnergyDistributionNetwork.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/battery/EnergyDistributionNetwork.java rename to src/main/scala/resonantinduction/electrical/battery/EnergyDistributionNetwork.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/battery/ItemBlockBattery.java b/src/main/scala/resonantinduction/electrical/battery/ItemBlockBattery.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/battery/ItemBlockBattery.java rename to src/main/scala/resonantinduction/electrical/battery/ItemBlockBattery.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/battery/RenderBattery.java b/src/main/scala/resonantinduction/electrical/battery/RenderBattery.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/battery/RenderBattery.java rename to src/main/scala/resonantinduction/electrical/battery/RenderBattery.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/battery/TileBattery.java b/src/main/scala/resonantinduction/electrical/battery/TileBattery.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/battery/TileBattery.java rename to src/main/scala/resonantinduction/electrical/battery/TileBattery.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/battery/TileEnergyDistribution.java b/src/main/scala/resonantinduction/electrical/battery/TileEnergyDistribution.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/battery/TileEnergyDistribution.java rename to src/main/scala/resonantinduction/electrical/battery/TileEnergyDistribution.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/distributor/EnumDistributorMode.java b/src/main/scala/resonantinduction/electrical/distributor/EnumDistributorMode.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/distributor/EnumDistributorMode.java rename to src/main/scala/resonantinduction/electrical/distributor/EnumDistributorMode.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/distributor/TileDistributor.scala b/src/main/scala/resonantinduction/electrical/distributor/TileDistributor.scala similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/distributor/TileDistributor.scala rename to src/main/scala/resonantinduction/electrical/distributor/TileDistributor.scala diff --git a/electrical/src/main/scala/resonantinduction/electrical/generator/BlockMotor.java b/src/main/scala/resonantinduction/electrical/generator/BlockMotor.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/generator/BlockMotor.java rename to src/main/scala/resonantinduction/electrical/generator/BlockMotor.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/generator/RenderMotor.java b/src/main/scala/resonantinduction/electrical/generator/RenderMotor.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/generator/RenderMotor.java rename to src/main/scala/resonantinduction/electrical/generator/RenderMotor.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/generator/TileMotor.java b/src/main/scala/resonantinduction/electrical/generator/TileMotor.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/generator/TileMotor.java rename to src/main/scala/resonantinduction/electrical/generator/TileMotor.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/generator/solar/TileSolarPanel.java b/src/main/scala/resonantinduction/electrical/generator/solar/TileSolarPanel.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/generator/solar/TileSolarPanel.java rename to src/main/scala/resonantinduction/electrical/generator/solar/TileSolarPanel.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/generator/thermopile/BlockThermopile.java b/src/main/scala/resonantinduction/electrical/generator/thermopile/BlockThermopile.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/generator/thermopile/BlockThermopile.java rename to src/main/scala/resonantinduction/electrical/generator/thermopile/BlockThermopile.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/generator/thermopile/TileThermopile.java b/src/main/scala/resonantinduction/electrical/generator/thermopile/TileThermopile.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/generator/thermopile/TileThermopile.java rename to src/main/scala/resonantinduction/electrical/generator/thermopile/TileThermopile.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailing.java b/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailing.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailing.java rename to src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailing.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailingProvider.java b/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailingProvider.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailingProvider.java rename to src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailingProvider.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailingTransfer.java b/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailingTransfer.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailingTransfer.java rename to src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailingTransfer.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/package-info.java b/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/package-info.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/package-info.java rename to src/main/scala/resonantinduction/electrical/itemrailing/interfaces/package-info.java diff --git a/archive/java/resonantinduction/electrical/multimeter/ContainerMultimeter.java b/src/main/scala/resonantinduction/electrical/multimeter/ContainerMultimeter.java similarity index 100% rename from archive/java/resonantinduction/electrical/multimeter/ContainerMultimeter.java rename to src/main/scala/resonantinduction/electrical/multimeter/ContainerMultimeter.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/Graph.java b/src/main/scala/resonantinduction/electrical/multimeter/Graph.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/multimeter/Graph.java rename to src/main/scala/resonantinduction/electrical/multimeter/Graph.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/GraphD.java b/src/main/scala/resonantinduction/electrical/multimeter/GraphD.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/multimeter/GraphD.java rename to src/main/scala/resonantinduction/electrical/multimeter/GraphD.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/GraphF.java b/src/main/scala/resonantinduction/electrical/multimeter/GraphF.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/multimeter/GraphF.java rename to src/main/scala/resonantinduction/electrical/multimeter/GraphF.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/GraphI.java b/src/main/scala/resonantinduction/electrical/multimeter/GraphI.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/multimeter/GraphI.java rename to src/main/scala/resonantinduction/electrical/multimeter/GraphI.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/GraphL.java b/src/main/scala/resonantinduction/electrical/multimeter/GraphL.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/multimeter/GraphL.java rename to src/main/scala/resonantinduction/electrical/multimeter/GraphL.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/GuiMultimeter.java b/src/main/scala/resonantinduction/electrical/multimeter/GuiMultimeter.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/multimeter/GuiMultimeter.java rename to src/main/scala/resonantinduction/electrical/multimeter/GuiMultimeter.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/ItemMultimeter.java b/src/main/scala/resonantinduction/electrical/multimeter/ItemMultimeter.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/multimeter/ItemMultimeter.java rename to src/main/scala/resonantinduction/electrical/multimeter/ItemMultimeter.java diff --git a/archive/java/resonantinduction/electrical/multimeter/ModelMultimeter.java b/src/main/scala/resonantinduction/electrical/multimeter/ModelMultimeter.java similarity index 100% rename from archive/java/resonantinduction/electrical/multimeter/ModelMultimeter.java rename to src/main/scala/resonantinduction/electrical/multimeter/ModelMultimeter.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/MultimeterNetwork.java b/src/main/scala/resonantinduction/electrical/multimeter/MultimeterNetwork.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/multimeter/MultimeterNetwork.java rename to src/main/scala/resonantinduction/electrical/multimeter/MultimeterNetwork.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/PartMultimeter.java b/src/main/scala/resonantinduction/electrical/multimeter/PartMultimeter.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/multimeter/PartMultimeter.java rename to src/main/scala/resonantinduction/electrical/multimeter/PartMultimeter.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/multimeter/RenderMultimeter.java b/src/main/scala/resonantinduction/electrical/multimeter/RenderMultimeter.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/multimeter/RenderMultimeter.java rename to src/main/scala/resonantinduction/electrical/multimeter/RenderMultimeter.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/render/FXElectricBolt.java b/src/main/scala/resonantinduction/electrical/render/FXElectricBolt.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/render/FXElectricBolt.java rename to src/main/scala/resonantinduction/electrical/render/FXElectricBolt.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/tesla/BlockTesla.java b/src/main/scala/resonantinduction/electrical/tesla/BlockTesla.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/tesla/BlockTesla.java rename to src/main/scala/resonantinduction/electrical/tesla/BlockTesla.java diff --git a/archive/java/resonantinduction/electrical/tesla/ITesla.java b/src/main/scala/resonantinduction/electrical/tesla/ITesla.java similarity index 100% rename from archive/java/resonantinduction/electrical/tesla/ITesla.java rename to src/main/scala/resonantinduction/electrical/tesla/ITesla.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/tesla/RenderTesla.java b/src/main/scala/resonantinduction/electrical/tesla/RenderTesla.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/tesla/RenderTesla.java rename to src/main/scala/resonantinduction/electrical/tesla/RenderTesla.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/tesla/TeslaGrid.java b/src/main/scala/resonantinduction/electrical/tesla/TeslaGrid.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/tesla/TeslaGrid.java rename to src/main/scala/resonantinduction/electrical/tesla/TeslaGrid.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/tesla/TileTesla.java b/src/main/scala/resonantinduction/electrical/tesla/TileTesla.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/tesla/TileTesla.java rename to src/main/scala/resonantinduction/electrical/tesla/TileTesla.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/transformer/ItemTransformer.java b/src/main/scala/resonantinduction/electrical/transformer/ItemTransformer.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/transformer/ItemTransformer.java rename to src/main/scala/resonantinduction/electrical/transformer/ItemTransformer.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/transformer/PartTransformer.java b/src/main/scala/resonantinduction/electrical/transformer/PartTransformer.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/transformer/PartTransformer.java rename to src/main/scala/resonantinduction/electrical/transformer/PartTransformer.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/transformer/RenderTransformer.java b/src/main/scala/resonantinduction/electrical/transformer/RenderTransformer.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/transformer/RenderTransformer.java rename to src/main/scala/resonantinduction/electrical/transformer/RenderTransformer.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/EnumWireMaterial.java b/src/main/scala/resonantinduction/electrical/wire/EnumWireMaterial.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/wire/EnumWireMaterial.java rename to src/main/scala/resonantinduction/electrical/wire/EnumWireMaterial.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/ItemWire.java b/src/main/scala/resonantinduction/electrical/wire/ItemWire.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/wire/ItemWire.java rename to src/main/scala/resonantinduction/electrical/wire/ItemWire.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/PartAdvancedWire.java b/src/main/scala/resonantinduction/electrical/wire/PartAdvancedWire.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/wire/PartAdvancedWire.java rename to src/main/scala/resonantinduction/electrical/wire/PartAdvancedWire.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/PartConductor.java b/src/main/scala/resonantinduction/electrical/wire/PartConductor.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/wire/PartConductor.java rename to src/main/scala/resonantinduction/electrical/wire/PartConductor.java diff --git a/archive/java/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java b/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java similarity index 100% rename from archive/java/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java rename to src/main/scala/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatWire.java b/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatWire.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatWire.java rename to src/main/scala/resonantinduction/electrical/wire/flat/PartFlatWire.java diff --git a/archive/java/resonantinduction/electrical/wire/flat/RenderFlatWire.java b/src/main/scala/resonantinduction/electrical/wire/flat/RenderFlatWire.java similarity index 100% rename from archive/java/resonantinduction/electrical/wire/flat/RenderFlatWire.java rename to src/main/scala/resonantinduction/electrical/wire/flat/RenderFlatWire.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/framed/PartFramedSwitchWire.java b/src/main/scala/resonantinduction/electrical/wire/framed/PartFramedSwitchWire.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/wire/framed/PartFramedSwitchWire.java rename to src/main/scala/resonantinduction/electrical/wire/framed/PartFramedSwitchWire.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/framed/PartFramedWire.java b/src/main/scala/resonantinduction/electrical/wire/framed/PartFramedWire.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/wire/framed/PartFramedWire.java rename to src/main/scala/resonantinduction/electrical/wire/framed/PartFramedWire.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/framed/RenderFramedWire.java b/src/main/scala/resonantinduction/electrical/wire/framed/RenderFramedWire.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/wire/framed/RenderFramedWire.java rename to src/main/scala/resonantinduction/electrical/wire/framed/RenderFramedWire.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/trait/TraitConductor.java b/src/main/scala/resonantinduction/electrical/wire/trait/TraitConductor.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/wire/trait/TraitConductor.java rename to src/main/scala/resonantinduction/electrical/wire/trait/TraitConductor.java diff --git a/archive/java/resonantinduction/electrical/wire/trait/TraitEnergyHandler.java b/src/main/scala/resonantinduction/electrical/wire/trait/TraitEnergyHandler.java similarity index 100% rename from archive/java/resonantinduction/electrical/wire/trait/TraitEnergyHandler.java rename to src/main/scala/resonantinduction/electrical/wire/trait/TraitEnergyHandler.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/wire/trait/TraitEnergySink.java b/src/main/scala/resonantinduction/electrical/wire/trait/TraitEnergySink.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/electrical/wire/trait/TraitEnergySink.java rename to src/main/scala/resonantinduction/electrical/wire/trait/TraitEnergySink.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/ClientProxy.java b/src/main/scala/resonantinduction/mechanical/ClientProxy.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/ClientProxy.java rename to src/main/scala/resonantinduction/mechanical/ClientProxy.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/CommonProxy.java b/src/main/scala/resonantinduction/mechanical/CommonProxy.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/CommonProxy.java rename to src/main/scala/resonantinduction/mechanical/CommonProxy.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/Mechanical.java b/src/main/scala/resonantinduction/mechanical/Mechanical.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/Mechanical.java rename to src/main/scala/resonantinduction/mechanical/Mechanical.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/MicroblockHighlightHandler.java b/src/main/scala/resonantinduction/mechanical/MicroblockHighlightHandler.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/MicroblockHighlightHandler.java rename to src/main/scala/resonantinduction/mechanical/MicroblockHighlightHandler.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/MultipartMechanical.java b/src/main/scala/resonantinduction/mechanical/MultipartMechanical.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/MultipartMechanical.java rename to src/main/scala/resonantinduction/mechanical/MultipartMechanical.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/belt/BlockConveyorBelt.java b/src/main/scala/resonantinduction/mechanical/belt/BlockConveyorBelt.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/belt/BlockConveyorBelt.java rename to src/main/scala/resonantinduction/mechanical/belt/BlockConveyorBelt.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/belt/ModelAngledBelt.java b/src/main/scala/resonantinduction/mechanical/belt/ModelAngledBelt.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/belt/ModelAngledBelt.java rename to src/main/scala/resonantinduction/mechanical/belt/ModelAngledBelt.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/belt/ModelConveyorBelt.java b/src/main/scala/resonantinduction/mechanical/belt/ModelConveyorBelt.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/belt/ModelConveyorBelt.java rename to src/main/scala/resonantinduction/mechanical/belt/ModelConveyorBelt.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/belt/RenderConveyorBelt.java b/src/main/scala/resonantinduction/mechanical/belt/RenderConveyorBelt.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/belt/RenderConveyorBelt.java rename to src/main/scala/resonantinduction/mechanical/belt/RenderConveyorBelt.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/belt/TileConveyorBelt.java b/src/main/scala/resonantinduction/mechanical/belt/TileConveyorBelt.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/belt/TileConveyorBelt.java rename to src/main/scala/resonantinduction/mechanical/belt/TileConveyorBelt.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/grid/MechanicalNode.java b/src/main/scala/resonantinduction/mechanical/energy/grid/MechanicalNode.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/grid/MechanicalNode.java rename to src/main/scala/resonantinduction/mechanical/energy/grid/MechanicalNode.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/grid/MechanicalNodeFrame.java b/src/main/scala/resonantinduction/mechanical/energy/grid/MechanicalNodeFrame.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/grid/MechanicalNodeFrame.java rename to src/main/scala/resonantinduction/mechanical/energy/grid/MechanicalNodeFrame.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/grid/PacketNetwork.java b/src/main/scala/resonantinduction/mechanical/energy/grid/PacketNetwork.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/grid/PacketNetwork.java rename to src/main/scala/resonantinduction/mechanical/energy/grid/PacketNetwork.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/grid/PartMechanical.java b/src/main/scala/resonantinduction/mechanical/energy/grid/PartMechanical.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/grid/PartMechanical.java rename to src/main/scala/resonantinduction/mechanical/energy/grid/PartMechanical.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/grid/TileMechanical.java b/src/main/scala/resonantinduction/mechanical/energy/grid/TileMechanical.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/grid/TileMechanical.java rename to src/main/scala/resonantinduction/mechanical/energy/grid/TileMechanical.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/BlockTurbine.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/BlockTurbine.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/BlockTurbine.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/BlockTurbine.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/BlockWindTurbine.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/BlockWindTurbine.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/BlockWindTurbine.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/BlockWindTurbine.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/RenderWaterTurbine.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/RenderWaterTurbine.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/RenderWaterTurbine.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/RenderWaterTurbine.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/RenderWindTurbine.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/RenderWindTurbine.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/RenderWindTurbine.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/RenderWindTurbine.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/SchematicWaterTurbine.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/SchematicWaterTurbine.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/SchematicWaterTurbine.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/SchematicWaterTurbine.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/SchematicWindTurbine.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/SchematicWindTurbine.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/SchematicWindTurbine.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/SchematicWindTurbine.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/TileTurbine.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/TileTurbine.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/TileTurbine.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/TileTurbine.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/TileWaterTurbine.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/TileWaterTurbine.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/TileWaterTurbine.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/TileWaterTurbine.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/TileWindTurbine.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/TileWindTurbine.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/TileWindTurbine.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/TileWindTurbine.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/TurbineMBlockHandler.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/TurbineMBlockHandler.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/TurbineMBlockHandler.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/TurbineMBlockHandler.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/TurbineNode.java b/src/main/scala/resonantinduction/mechanical/energy/turbine/TurbineNode.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/energy/turbine/TurbineNode.java rename to src/main/scala/resonantinduction/mechanical/energy/turbine/TurbineNode.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/EnumPipeMaterial.java b/src/main/scala/resonantinduction/mechanical/fluid/pipe/EnumPipeMaterial.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/EnumPipeMaterial.java rename to src/main/scala/resonantinduction/mechanical/fluid/pipe/EnumPipeMaterial.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/ItemPipe.java b/src/main/scala/resonantinduction/mechanical/fluid/pipe/ItemPipe.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/ItemPipe.java rename to src/main/scala/resonantinduction/mechanical/fluid/pipe/ItemPipe.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/PartPipe.java b/src/main/scala/resonantinduction/mechanical/fluid/pipe/PartPipe.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/PartPipe.java rename to src/main/scala/resonantinduction/mechanical/fluid/pipe/PartPipe.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/PipeNodeFrame.java b/src/main/scala/resonantinduction/mechanical/fluid/pipe/PipeNodeFrame.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/PipeNodeFrame.java rename to src/main/scala/resonantinduction/mechanical/fluid/pipe/PipeNodeFrame.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/PipePressureNode.java b/src/main/scala/resonantinduction/mechanical/fluid/pipe/PipePressureNode.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/PipePressureNode.java rename to src/main/scala/resonantinduction/mechanical/fluid/pipe/PipePressureNode.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/RenderPipe.java b/src/main/scala/resonantinduction/mechanical/fluid/pipe/RenderPipe.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/fluid/pipe/RenderPipe.java rename to src/main/scala/resonantinduction/mechanical/fluid/pipe/RenderPipe.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/fluid/transport/RenderPump.java b/src/main/scala/resonantinduction/mechanical/fluid/transport/RenderPump.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/fluid/transport/RenderPump.java rename to src/main/scala/resonantinduction/mechanical/fluid/transport/RenderPump.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/fluid/transport/TilePump.java b/src/main/scala/resonantinduction/mechanical/fluid/transport/TilePump.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/fluid/transport/TilePump.java rename to src/main/scala/resonantinduction/mechanical/fluid/transport/TilePump.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/GearMultiBlockHandler.java b/src/main/scala/resonantinduction/mechanical/gear/GearMultiBlockHandler.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gear/GearMultiBlockHandler.java rename to src/main/scala/resonantinduction/mechanical/gear/GearMultiBlockHandler.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/GearNode.java b/src/main/scala/resonantinduction/mechanical/gear/GearNode.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gear/GearNode.java rename to src/main/scala/resonantinduction/mechanical/gear/GearNode.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/ItemGear.java b/src/main/scala/resonantinduction/mechanical/gear/ItemGear.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gear/ItemGear.java rename to src/main/scala/resonantinduction/mechanical/gear/ItemGear.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/PartGear.java b/src/main/scala/resonantinduction/mechanical/gear/PartGear.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gear/PartGear.java rename to src/main/scala/resonantinduction/mechanical/gear/PartGear.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/RenderGear.java b/src/main/scala/resonantinduction/mechanical/gear/RenderGear.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gear/RenderGear.java rename to src/main/scala/resonantinduction/mechanical/gear/RenderGear.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/dev/GearNetwork.java b/src/main/scala/resonantinduction/mechanical/gear/dev/GearNetwork.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gear/dev/GearNetwork.java rename to src/main/scala/resonantinduction/mechanical/gear/dev/GearNetwork.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/dev/GearPathFinder.java b/src/main/scala/resonantinduction/mechanical/gear/dev/GearPathFinder.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gear/dev/GearPathFinder.java rename to src/main/scala/resonantinduction/mechanical/gear/dev/GearPathFinder.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/dev/NodeGear.java b/src/main/scala/resonantinduction/mechanical/gear/dev/NodeGear.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gear/dev/NodeGear.java rename to src/main/scala/resonantinduction/mechanical/gear/dev/NodeGear.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/dev/NodeGenerator.java b/src/main/scala/resonantinduction/mechanical/gear/dev/NodeGenerator.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gear/dev/NodeGenerator.java rename to src/main/scala/resonantinduction/mechanical/gear/dev/NodeGenerator.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/GearShaftNode.java b/src/main/scala/resonantinduction/mechanical/gearshaft/GearShaftNode.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/GearShaftNode.java rename to src/main/scala/resonantinduction/mechanical/gearshaft/GearShaftNode.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ItemGearShaft.java b/src/main/scala/resonantinduction/mechanical/gearshaft/ItemGearShaft.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ItemGearShaft.java rename to src/main/scala/resonantinduction/mechanical/gearshaft/ItemGearShaft.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/PartGearShaft.java b/src/main/scala/resonantinduction/mechanical/gearshaft/PartGearShaft.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/PartGearShaft.java rename to src/main/scala/resonantinduction/mechanical/gearshaft/PartGearShaft.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/RenderGearShaft.java b/src/main/scala/resonantinduction/mechanical/gearshaft/RenderGearShaft.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/RenderGearShaft.java rename to src/main/scala/resonantinduction/mechanical/gearshaft/RenderGearShaft.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/BlockDetector.java b/src/main/scala/resonantinduction/mechanical/logistic/belt/BlockDetector.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/BlockDetector.java rename to src/main/scala/resonantinduction/mechanical/logistic/belt/BlockDetector.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/BlockManipulator.java b/src/main/scala/resonantinduction/mechanical/logistic/belt/BlockManipulator.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/BlockManipulator.java rename to src/main/scala/resonantinduction/mechanical/logistic/belt/BlockManipulator.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/BlockRejector.java b/src/main/scala/resonantinduction/mechanical/logistic/belt/BlockRejector.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/BlockRejector.java rename to src/main/scala/resonantinduction/mechanical/logistic/belt/BlockRejector.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/ModelManipulator.java b/src/main/scala/resonantinduction/mechanical/logistic/belt/ModelManipulator.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/ModelManipulator.java rename to src/main/scala/resonantinduction/mechanical/logistic/belt/ModelManipulator.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/ModelRejectorPiston.java b/src/main/scala/resonantinduction/mechanical/logistic/belt/ModelRejectorPiston.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/ModelRejectorPiston.java rename to src/main/scala/resonantinduction/mechanical/logistic/belt/ModelRejectorPiston.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/RenderManipulator.java b/src/main/scala/resonantinduction/mechanical/logistic/belt/RenderManipulator.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/RenderManipulator.java rename to src/main/scala/resonantinduction/mechanical/logistic/belt/RenderManipulator.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/RenderRejector.java b/src/main/scala/resonantinduction/mechanical/logistic/belt/RenderRejector.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/RenderRejector.java rename to src/main/scala/resonantinduction/mechanical/logistic/belt/RenderRejector.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/TileDetector.java b/src/main/scala/resonantinduction/mechanical/logistic/belt/TileDetector.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/TileDetector.java rename to src/main/scala/resonantinduction/mechanical/logistic/belt/TileDetector.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/TileManipulator.java b/src/main/scala/resonantinduction/mechanical/logistic/belt/TileManipulator.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/TileManipulator.java rename to src/main/scala/resonantinduction/mechanical/logistic/belt/TileManipulator.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/TileRejector.java b/src/main/scala/resonantinduction/mechanical/logistic/belt/TileRejector.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/logistic/belt/TileRejector.java rename to src/main/scala/resonantinduction/mechanical/logistic/belt/TileRejector.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/process/crusher/RenderMechanicalPiston.java b/src/main/scala/resonantinduction/mechanical/process/crusher/RenderMechanicalPiston.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/process/crusher/RenderMechanicalPiston.java rename to src/main/scala/resonantinduction/mechanical/process/crusher/RenderMechanicalPiston.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/process/crusher/TileMechanicalPiston.java b/src/main/scala/resonantinduction/mechanical/process/crusher/TileMechanicalPiston.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/process/crusher/TileMechanicalPiston.java rename to src/main/scala/resonantinduction/mechanical/process/crusher/TileMechanicalPiston.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/process/edit/TileBreaker.java b/src/main/scala/resonantinduction/mechanical/process/edit/TileBreaker.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/process/edit/TileBreaker.java rename to src/main/scala/resonantinduction/mechanical/process/edit/TileBreaker.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/process/edit/TilePlacer.java b/src/main/scala/resonantinduction/mechanical/process/edit/TilePlacer.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/process/edit/TilePlacer.java rename to src/main/scala/resonantinduction/mechanical/process/edit/TilePlacer.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/process/grinder/GrinderNode.java b/src/main/scala/resonantinduction/mechanical/process/grinder/GrinderNode.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/process/grinder/GrinderNode.java rename to src/main/scala/resonantinduction/mechanical/process/grinder/GrinderNode.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/process/grinder/RenderGrindingWheel.java b/src/main/scala/resonantinduction/mechanical/process/grinder/RenderGrindingWheel.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/process/grinder/RenderGrindingWheel.java rename to src/main/scala/resonantinduction/mechanical/process/grinder/RenderGrindingWheel.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/process/grinder/TileGrindingWheel.java b/src/main/scala/resonantinduction/mechanical/process/grinder/TileGrindingWheel.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/process/grinder/TileGrindingWheel.java rename to src/main/scala/resonantinduction/mechanical/process/grinder/TileGrindingWheel.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/process/mixer/MixerNode.java b/src/main/scala/resonantinduction/mechanical/process/mixer/MixerNode.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/process/mixer/MixerNode.java rename to src/main/scala/resonantinduction/mechanical/process/mixer/MixerNode.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/process/mixer/RenderMixer.java b/src/main/scala/resonantinduction/mechanical/process/mixer/RenderMixer.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/process/mixer/RenderMixer.java rename to src/main/scala/resonantinduction/mechanical/process/mixer/RenderMixer.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/process/mixer/TileMixer.java b/src/main/scala/resonantinduction/mechanical/process/mixer/TileMixer.java similarity index 100% rename from mechanical/src/main/scala/resonantinduction/mechanical/process/mixer/TileMixer.java rename to src/main/scala/resonantinduction/mechanical/process/mixer/TileMixer.java diff --git a/electrical/src/main/scala/resonantinduction/quantum/gate/IQuantumGate.java b/src/main/scala/resonantinduction/quantum/gate/IQuantumGate.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/quantum/gate/IQuantumGate.java rename to src/main/scala/resonantinduction/quantum/gate/IQuantumGate.java diff --git a/electrical/src/main/scala/resonantinduction/quantum/gate/ItemQuantumGlyph.java b/src/main/scala/resonantinduction/quantum/gate/ItemQuantumGlyph.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/quantum/gate/ItemQuantumGlyph.java rename to src/main/scala/resonantinduction/quantum/gate/ItemQuantumGlyph.java diff --git a/electrical/src/main/scala/resonantinduction/quantum/gate/PartQuantumGlyph.java b/src/main/scala/resonantinduction/quantum/gate/PartQuantumGlyph.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/quantum/gate/PartQuantumGlyph.java rename to src/main/scala/resonantinduction/quantum/gate/PartQuantumGlyph.java diff --git a/electrical/src/main/scala/resonantinduction/quantum/gate/QuantumGateManager.java b/src/main/scala/resonantinduction/quantum/gate/QuantumGateManager.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/quantum/gate/QuantumGateManager.java rename to src/main/scala/resonantinduction/quantum/gate/QuantumGateManager.java diff --git a/electrical/src/main/scala/resonantinduction/quantum/gate/RenderQuantumGlyph.java b/src/main/scala/resonantinduction/quantum/gate/RenderQuantumGlyph.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/quantum/gate/RenderQuantumGlyph.java rename to src/main/scala/resonantinduction/quantum/gate/RenderQuantumGlyph.java diff --git a/electrical/src/main/scala/resonantinduction/quantum/gate/TraitQuantumGate.java b/src/main/scala/resonantinduction/quantum/gate/TraitQuantumGate.java similarity index 100% rename from electrical/src/main/scala/resonantinduction/quantum/gate/TraitQuantumGate.java rename to src/main/scala/resonantinduction/quantum/gate/TraitQuantumGate.java