aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Java/binnie/Binnie.java23
-rw-r--r--src/Java/binnie/Constants.java11
-rw-r--r--src/Java/binnie/core/AbstractMod.java158
-rw-r--r--src/Java/binnie/core/BinnieCore.java240
-rw-r--r--src/Java/binnie/core/IInitializable.java10
-rw-r--r--src/Java/binnie/core/ManagerBase.java19
-rw-r--r--src/Java/binnie/core/Mods.java1
-rw-r--r--src/Java/binnie/core/block/BlockMetadata.java138
-rw-r--r--src/Java/binnie/core/block/IBlockMetadata.java21
-rw-r--r--src/Java/binnie/core/block/IMultipassBlock.java8
-rw-r--r--src/Java/binnie/core/block/ItemMetadata.java67
-rw-r--r--src/Java/binnie/core/block/ItemMetadataRenderer.java64
-rw-r--r--src/Java/binnie/core/block/MultipassBlockRenderer.java106
-rw-r--r--src/Java/binnie/core/block/MultipassItemRenderer.java78
-rw-r--r--src/Java/binnie/core/block/TileEntityMetadata.java116
-rw-r--r--src/Java/binnie/core/circuits/BinnieCircuit.java80
-rw-r--r--src/Java/binnie/core/circuits/BinnieCircuitLayout.java37
-rw-r--r--src/Java/binnie/core/gui/BinnieCoreGUI.java54
-rw-r--r--src/Java/binnie/core/gui/BinnieGUIHandler.java54
-rw-r--r--src/Java/binnie/core/gui/IBinnieGUID.java13
-rw-r--r--src/Java/binnie/core/item/IItemEnum.java14
-rw-r--r--src/Java/binnie/core/item/IItemMisc.java19
-rw-r--r--src/Java/binnie/core/item/ItemFieldKit.java82
-rw-r--r--src/Java/binnie/core/item/ItemGenesis.java42
-rw-r--r--src/Java/binnie/core/item/ItemMisc.java81
-rw-r--r--src/Java/binnie/core/item/ManagerItem.java11
-rw-r--r--src/Java/binnie/core/language/ManagerLanguage.java59
-rw-r--r--src/Java/binnie/core/machines/BlockMachine.java180
-rw-r--r--src/Java/binnie/core/machines/IBlockMachine.java8
-rw-r--r--src/Java/binnie/core/machines/IMachine.java25
-rw-r--r--src/Java/binnie/core/machines/IMachineType.java11
-rw-r--r--src/Java/binnie/core/machines/IOwnable.java10
-rw-r--r--src/Java/binnie/core/machines/ItemMachine.java29
-rw-r--r--src/Java/binnie/core/machines/Machine.java318
-rw-r--r--src/Java/binnie/core/machines/MachineComponent.java61
-rw-r--r--src/Java/binnie/core/machines/MachineGroup.java113
-rw-r--r--src/Java/binnie/core/machines/MachinePackage.java74
-rw-r--r--src/Java/binnie/core/machines/MachineRendererBlock.java41
-rw-r--r--src/Java/binnie/core/machines/MachineUtil.java216
-rw-r--r--src/Java/binnie/core/machines/ManagerMachine.java108
-rw-r--r--src/Java/binnie/core/machines/ModelBlock.java42
-rw-r--r--src/Java/binnie/core/machines/RendererMachine.java68
-rw-r--r--src/Java/binnie/core/machines/TileEntityMachine.java111
-rw-r--r--src/Java/binnie/core/machines/base/DefaultInventory.java82
-rw-r--r--src/Java/binnie/core/machines/base/DefaultPower.java70
-rw-r--r--src/Java/binnie/core/machines/base/DefaultTankContainer.java79
-rw-r--r--src/Java/binnie/core/machines/base/TileEntityMachineBase.java256
-rw-r--r--src/Java/binnie/core/machines/component/ComponentRecipe.java14
-rw-r--r--src/Java/binnie/core/machines/component/IBuildcraft.java20
-rw-r--r--src/Java/binnie/core/machines/component/IComponentRecipe.java12
-rw-r--r--src/Java/binnie/core/machines/component/IInteraction.java22
-rw-r--r--src/Java/binnie/core/machines/component/IRender.java28
-rw-r--r--src/Java/binnie/core/machines/inventory/AccessDirection.java97
-rw-r--r--src/Java/binnie/core/machines/inventory/BaseSlot.java148
-rw-r--r--src/Java/binnie/core/machines/inventory/ComponentChargedSlots.java115
-rw-r--r--src/Java/binnie/core/machines/inventory/ComponentInventory.java22
-rw-r--r--src/Java/binnie/core/machines/inventory/ComponentInventorySlots.java247
-rw-r--r--src/Java/binnie/core/machines/inventory/ComponentInventoryTransfer.java162
-rw-r--r--src/Java/binnie/core/machines/inventory/ComponentTankContainer.java207
-rw-r--r--src/Java/binnie/core/machines/inventory/IChargedSlots.java10
-rw-r--r--src/Java/binnie/core/machines/inventory/IInventoryMachine.java8
-rw-r--r--src/Java/binnie/core/machines/inventory/IInventorySlots.java14
-rw-r--r--src/Java/binnie/core/machines/inventory/IValidatedInventory.java9
-rw-r--r--src/Java/binnie/core/machines/inventory/IValidatedTankContainer.java10
-rw-r--r--src/Java/binnie/core/machines/inventory/InventorySlot.java115
-rw-r--r--src/Java/binnie/core/machines/inventory/MachineSide.java79
-rw-r--r--src/Java/binnie/core/machines/inventory/SetList.java36
-rw-r--r--src/Java/binnie/core/machines/inventory/SidedAccess.java106
-rw-r--r--src/Java/binnie/core/machines/inventory/SlotValidator.java66
-rw-r--r--src/Java/binnie/core/machines/inventory/TankSlot.java58
-rw-r--r--src/Java/binnie/core/machines/inventory/TransferHandler.java227
-rw-r--r--src/Java/binnie/core/machines/inventory/Validator.java9
-rw-r--r--src/Java/binnie/core/machines/inventory/ValidatorIcon.java25
-rw-r--r--src/Java/binnie/core/machines/network/INetwork.java30
-rw-r--r--src/Java/binnie/core/machines/power/ComponentPowerReceptor.java183
-rw-r--r--src/Java/binnie/core/machines/power/ComponentProcess.java90
-rw-r--r--src/Java/binnie/core/machines/power/ComponentProcessIndefinate.java119
-rw-r--r--src/Java/binnie/core/machines/power/ComponentProcessSetCost.java27
-rw-r--r--src/Java/binnie/core/machines/power/ErrorState.java187
-rw-r--r--src/Java/binnie/core/machines/power/IErrorStateSource.java8
-rw-r--r--src/Java/binnie/core/machines/power/IPoweredMachine.java12
-rw-r--r--src/Java/binnie/core/machines/power/IProcess.java13
-rw-r--r--src/Java/binnie/core/machines/power/IProcessTimed.java13
-rw-r--r--src/Java/binnie/core/machines/power/ITankMachine.java20
-rw-r--r--src/Java/binnie/core/machines/power/PowerInfo.java41
-rw-r--r--src/Java/binnie/core/machines/power/PowerInterface.java90
-rw-r--r--src/Java/binnie/core/machines/power/PowerSystem.java44
-rw-r--r--src/Java/binnie/core/machines/power/ProcessInfo.java67
-rw-r--r--src/Java/binnie/core/machines/power/TankInfo.java76
-rw-r--r--src/Java/binnie/core/machines/storage/Compartment.java64
-rw-r--r--src/Java/binnie/core/machines/storage/CompartmentTab.java77
-rw-r--r--src/Java/binnie/core/machines/storage/ComponentBinnieCoreGUI.java27
-rw-r--r--src/Java/binnie/core/machines/storage/ComponentCompartmentInventory.java128
-rw-r--r--src/Java/binnie/core/machines/storage/ControlColourSelector.java47
-rw-r--r--src/Java/binnie/core/machines/storage/MachineRendererCompartment.java50
-rw-r--r--src/Java/binnie/core/machines/storage/ModelCompartment.java171
-rw-r--r--src/Java/binnie/core/machines/storage/ModuleStorage.java39
-rw-r--r--src/Java/binnie/core/machines/storage/StandardCompartment.java142
-rw-r--r--src/Java/binnie/core/machines/storage/WindowCompartment.java594
-rw-r--r--src/Java/binnie/core/machines/storage/WindowTest.java40
-rw-r--r--src/Java/binnie/core/machines/transfer/TransferHandler.java3
-rw-r--r--src/Java/binnie/core/machines/transfer/TransferRequest.java419
-rw-r--r--src/Java/binnie/core/mod/config/BinnieConfiguration.java21
-rw-r--r--src/Java/binnie/core/mod/config/BinnieItemData.java15
-rw-r--r--src/Java/binnie/core/mod/config/ConfigFile.java11
-rw-r--r--src/Java/binnie/core/mod/config/ConfigProperty.java26
-rw-r--r--src/Java/binnie/core/mod/config/ConfigurationMain.java4
-rw-r--r--src/Java/binnie/core/mod/config/ConfigurationMods.java18
-rw-r--r--src/Java/binnie/core/mod/config/ManagerConfig.java71
-rw-r--r--src/Java/binnie/core/mod/config/PropBoolean.java38
-rw-r--r--src/Java/binnie/core/mod/config/PropDouble.java38
-rw-r--r--src/Java/binnie/core/mod/config/PropInteger.java38
-rw-r--r--src/Java/binnie/core/mod/config/PropPercentage.java43
-rw-r--r--src/Java/binnie/core/mod/config/PropertyBase.java72
-rw-r--r--src/Java/binnie/core/mod/parser/FieldParser.java55
-rw-r--r--src/Java/binnie/core/mod/parser/ItemParser.java24
-rw-r--r--src/Java/binnie/core/multiblock/BlockMultiblockMachine.java27
-rw-r--r--src/Java/binnie/core/multiblock/TileEntityMultiblockMachine.java37
-rw-r--r--src/Java/binnie/core/network/BinnieCorePacketID.java77
-rw-r--r--src/Java/binnie/core/network/BinniePacketHandler.java43
-rw-r--r--src/Java/binnie/core/network/INetworkedEntity.java10
-rw-r--r--src/Java/binnie/core/network/IOrdinaled.java6
-rw-r--r--src/Java/binnie/core/network/IPacketID.java10
-rw-r--r--src/Java/binnie/core/network/IPacketProvider.java8
-rw-r--r--src/Java/binnie/core/network/packet/IPacket.java8
-rw-r--r--src/Java/binnie/core/network/packet/IPacketLocation.java15
-rw-r--r--src/Java/binnie/core/network/packet/IndexInPayload.java15
-rw-r--r--src/Java/binnie/core/network/packet/MachinePayload.java77
-rw-r--r--src/Java/binnie/core/network/packet/MessageBase.java69
-rw-r--r--src/Java/binnie/core/network/packet/MessageBinnie.java40
-rw-r--r--src/Java/binnie/core/network/packet/MessageContainerUpdate.java17
-rw-r--r--src/Java/binnie/core/network/packet/MessageCoordinates.java59
-rw-r--r--src/Java/binnie/core/network/packet/MessageCraftGUI.java18
-rw-r--r--src/Java/binnie/core/network/packet/MessageMetadata.java36
-rw-r--r--src/Java/binnie/core/network/packet/MessageNBT.java49
-rw-r--r--src/Java/binnie/core/network/packet/MessageTileNBT.java82
-rw-r--r--src/Java/binnie/core/network/packet/MessageUpdate.java92
-rw-r--r--src/Java/binnie/core/network/packet/PacketPayload.java70
-rw-r--r--src/Java/binnie/core/proxy/BinnieModProxy.java67
-rw-r--r--src/Java/binnie/core/proxy/BinnieProxy.java156
-rw-r--r--src/Java/binnie/core/proxy/BinnieProxyClient.java158
-rw-r--r--src/Java/binnie/core/proxy/BinnieProxyServer.java6
-rw-r--r--src/Java/binnie/core/proxy/IBinnieModProxy.java21
-rw-r--r--src/Java/binnie/core/proxy/IBinnieProxy.java54
-rw-r--r--src/Java/binnie/core/proxy/IProxyCore.java7
-rw-r--r--src/Java/binnie/core/resource/BinnieIcon.java47
-rw-r--r--src/Java/binnie/core/resource/BinnieResource.java38
-rw-r--r--src/Java/binnie/core/resource/IBinnieTexture.java6
-rw-r--r--src/Java/binnie/core/resource/ManagerResource.java48
-rw-r--r--src/Java/binnie/core/resource/ResourceType.java18
-rw-r--r--src/Java/binnie/core/texture/BinnieCoreTexture.java28
-rw-r--r--src/Java/binnie/core/texture/TextureManager.java15
-rw-r--r--src/Java/binnie/core/triggers/ActionProvider.java38
-rw-r--r--src/Java/binnie/core/triggers/BinnieAction.java88
-rw-r--r--src/Java/binnie/core/triggers/BinnieTrigger.java116
-rw-r--r--src/Java/binnie/core/triggers/ModuleTrigger.java45
-rw-r--r--src/Java/binnie/core/triggers/TriggerData.java37
-rw-r--r--src/Java/binnie/core/triggers/TriggerInventory.java11
-rw-r--r--src/Java/binnie/core/triggers/TriggerPower.java48
-rw-r--r--src/Java/binnie/core/triggers/TriggerProvider.java57
-rw-r--r--src/Java/binnie/core/triggers/TriggerWorking.java47
-rw-r--r--src/Java/binnie/core/util/FluidStackSet.java128
-rw-r--r--src/Java/binnie/core/util/IValidator.java6
-rw-r--r--src/Java/binnie/core/util/ItemStackSet.java128
-rw-r--r--src/Java/binnie/core/util/UniqueFluidStackSet.java28
-rw-r--r--src/Java/binnie/core/util/UniqueItemStackSet.java28
-rw-r--r--src/Java/binnie/craftgui/binniecore/WindowFieldKit.java334
-rw-r--r--src/Java/binnie/craftgui/binniecore/WindowGenesis.java264
-rw-r--r--src/Java/binnie/craftgui/controls/ControlCheckbox.java75
-rw-r--r--src/Java/binnie/craftgui/controls/ControlText.java50
-rw-r--r--src/Java/binnie/craftgui/controls/ControlTextCentered.java15
-rw-r--r--src/Java/binnie/craftgui/controls/ControlTextEdit.java154
-rw-r--r--src/Java/binnie/craftgui/controls/IControlSelection.java10
-rw-r--r--src/Java/binnie/craftgui/controls/IControlSelectionOption.java6
-rw-r--r--src/Java/binnie/craftgui/controls/button/ControlButton.java70
-rw-r--r--src/Java/binnie/craftgui/controls/button/ControlEnumButton.java61
-rw-r--r--src/Java/binnie/craftgui/controls/button/ControlToggleButton.java21
-rw-r--r--src/Java/binnie/craftgui/controls/core/Control.java85
-rw-r--r--src/Java/binnie/craftgui/controls/core/IControlIndexed.java8
-rw-r--r--src/Java/binnie/craftgui/controls/core/IControlValue.java11
-rw-r--r--src/Java/binnie/craftgui/controls/core/IControlValues.java11
-rw-r--r--src/Java/binnie/craftgui/controls/listbox/ControlList.java146
-rw-r--r--src/Java/binnie/craftgui/controls/listbox/ControlListBox.java76
-rw-r--r--src/Java/binnie/craftgui/controls/listbox/ControlOption.java73
-rw-r--r--src/Java/binnie/craftgui/controls/listbox/ControlTextOption.java37
-rw-r--r--src/Java/binnie/craftgui/controls/page/ControlPage.java36
-rw-r--r--src/Java/binnie/craftgui/controls/page/ControlPages.java57
-rw-r--r--src/Java/binnie/craftgui/controls/scroll/ControlScroll.java22
-rw-r--r--src/Java/binnie/craftgui/controls/scroll/ControlScrollBar.java94
-rw-r--r--src/Java/binnie/craftgui/controls/scroll/ControlScrollableContent.java134
-rw-r--r--src/Java/binnie/craftgui/controls/scroll/IControlScrollable.java17
-rw-r--r--src/Java/binnie/craftgui/controls/tab/ControlTab.java128
-rw-r--r--src/Java/binnie/craftgui/controls/tab/ControlTabBar.java86
-rw-r--r--src/Java/binnie/craftgui/core/Attribute.java9
-rw-r--r--src/Java/binnie/craftgui/core/CraftGUI.java10
-rw-r--r--src/Java/binnie/craftgui/core/ITooltip.java6
-rw-r--r--src/Java/binnie/craftgui/core/ITooltipHelp.java6
-rw-r--r--src/Java/binnie/craftgui/core/ITopLevelWidget.java29
-rw-r--r--src/Java/binnie/craftgui/core/IWidget.java138
-rw-r--r--src/Java/binnie/craftgui/core/IWidgetAttribute.java3
-rw-r--r--src/Java/binnie/craftgui/core/RenderStage.java8
-rw-r--r--src/Java/binnie/craftgui/core/Tooltip.java84
-rw-r--r--src/Java/binnie/craftgui/core/TopLevelWidget.java248
-rw-r--r--src/Java/binnie/craftgui/core/Widget.java499
-rw-r--r--src/Java/binnie/craftgui/core/geometry/CraftGUIUtil.java77
-rw-r--r--src/Java/binnie/craftgui/core/geometry/IArea.java143
-rw-r--r--src/Java/binnie/craftgui/core/geometry/IBorder.java126
-rw-r--r--src/Java/binnie/craftgui/core/geometry/IPoint.java83
-rw-r--r--src/Java/binnie/craftgui/core/geometry/Position.java41
-rw-r--r--src/Java/binnie/craftgui/core/geometry/TextJustification.java25
-rw-r--r--src/Java/binnie/craftgui/core/renderer/Renderer.java252
-rw-r--r--src/Java/binnie/craftgui/core/renderer/TextureType.java8
-rw-r--r--src/Java/binnie/craftgui/events/Event.java23
-rw-r--r--src/Java/binnie/craftgui/events/EventButtonClicked.java21
-rw-r--r--src/Java/binnie/craftgui/events/EventCycleChanged.java20
-rw-r--r--src/Java/binnie/craftgui/events/EventHandler.java53
-rw-r--r--src/Java/binnie/craftgui/events/EventKey.java63
-rw-r--r--src/Java/binnie/craftgui/events/EventMouse.java156
-rw-r--r--src/Java/binnie/craftgui/events/EventTextEdit.java21
-rw-r--r--src/Java/binnie/craftgui/events/EventToggleButtonClicked.java20
-rw-r--r--src/Java/binnie/craftgui/events/EventValueChanged.java29
-rw-r--r--src/Java/binnie/craftgui/events/EventValuesChanged.java20
-rw-r--r--src/Java/binnie/craftgui/events/EventWidget.java272
-rw-r--r--src/Java/binnie/craftgui/minecraft/ContainerCraftGUI.java549
-rw-r--r--src/Java/binnie/craftgui/minecraft/CustomSlot.java54
-rw-r--r--src/Java/binnie/craftgui/minecraft/Dialog.java53
-rw-r--r--src/Java/binnie/craftgui/minecraft/EnumColor.java32
-rw-r--r--src/Java/binnie/craftgui/minecraft/GUIIcon.java30
-rw-r--r--src/Java/binnie/craftgui/minecraft/GuiCraftGUI.java605
-rw-r--r--src/Java/binnie/craftgui/minecraft/IMachineInformation.java6
-rw-r--r--src/Java/binnie/craftgui/minecraft/IMinecraftTooltip.java9
-rw-r--r--src/Java/binnie/craftgui/minecraft/IWindowAffectsShiftClick.java8
-rw-r--r--src/Java/binnie/craftgui/minecraft/InventoryType.java8
-rw-r--r--src/Java/binnie/craftgui/minecraft/ListMap.java149
-rw-r--r--src/Java/binnie/craftgui/minecraft/MinecraftGUI.java14
-rw-r--r--src/Java/binnie/craftgui/minecraft/MinecraftTooltip.java63
-rw-r--r--src/Java/binnie/craftgui/minecraft/ModuleCraftGUI.java18
-rw-r--r--src/Java/binnie/craftgui/minecraft/Window.java338
-rw-r--r--src/Java/binnie/craftgui/minecraft/WindowInventory.java144
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlEnergyBar.java161
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlErrorState.java113
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlHelp.java41
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlIconDisplay.java25
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlImage.java25
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlInfo.java38
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlItemDisplay.java98
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlLiquidTank.java223
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlMachineProgress.java14
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlPlayerInventory.java108
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlPowerSystem.java39
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlProgress.java30
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlProgressBase.java100
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlSlide.java113
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlSlot.java221
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlSlotArray.java76
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlSlotBase.java77
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlSlotCharge.java43
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlTabIcon.java47
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/ControlUser.java41
-rw-r--r--src/Java/binnie/craftgui/minecraft/control/EnumHighlighting.java28
-rw-r--r--src/Java/binnie/craftgui/minecraft/render/MinecraftTexture.java10
-rw-r--r--src/Java/binnie/craftgui/minecraft/render/RenderCommand.java16
-rw-r--r--src/Java/binnie/craftgui/mod/database/ControlBranchBox.java20
-rw-r--r--src/Java/binnie/craftgui/mod/database/ControlBranchBoxOption.java14
-rw-r--r--src/Java/binnie/craftgui/mod/database/ControlBreedingProgress.java41
-rw-r--r--src/Java/binnie/craftgui/mod/database/ControlDatabaseIndividualDisplay.java120
-rw-r--r--src/Java/binnie/craftgui/mod/database/ControlItemStackOption.java38
-rw-r--r--src/Java/binnie/craftgui/mod/database/ControlMutationBox.java71
-rw-r--r--src/Java/binnie/craftgui/mod/database/ControlMutationItem.java51
-rw-r--r--src/Java/binnie/craftgui/mod/database/ControlMutationSymbol.java80
-rw-r--r--src/Java/binnie/craftgui/mod/database/ControlSpeciesBox.java55
-rw-r--r--src/Java/binnie/craftgui/mod/database/ControlSpeciexBoxOption.java42
-rw-r--r--src/Java/binnie/craftgui/mod/database/DatabaseTab.java32
-rw-r--r--src/Java/binnie/craftgui/mod/database/EnumDiscoveryState.java8
-rw-r--r--src/Java/binnie/craftgui/mod/database/IDatabaseMode.java6
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageAbstract.java16
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageBranch.java13
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageBranchOverview.java67
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageBranchSpecies.java43
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageBreeder.java51
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageBreederStats.java23
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageSpecies.java13
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageSpeciesClassification.java54
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageSpeciesMutations.java27
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageSpeciesOverview.java88
-rw-r--r--src/Java/binnie/craftgui/mod/database/PageSpeciesResultant.java27
-rw-r--r--src/Java/binnie/craftgui/mod/database/WindowAbstractDatabase.java314
-rw-r--r--src/Java/binnie/craftgui/resource/IStyleSheet.java6
-rw-r--r--src/Java/binnie/craftgui/resource/StyleSheet.java18
-rw-r--r--src/Java/binnie/craftgui/resource/StyleSheetManager.java28
-rw-r--r--src/Java/binnie/craftgui/resource/Texture.java128
-rw-r--r--src/Java/binnie/craftgui/resource/minecraft/CraftGUIResourceManager.java155
-rw-r--r--src/Java/binnie/craftgui/resource/minecraft/CraftGUITexture.java18
-rw-r--r--src/Java/binnie/craftgui/resource/minecraft/CraftGUITextureSheet.java33
-rw-r--r--src/Java/binnie/craftgui/resource/minecraft/PaddedTexture.java21
-rw-r--r--src/Java/binnie/craftgui/resource/minecraft/ParsedTextureSheet.java25
-rw-r--r--src/Java/binnie/craftgui/resource/minecraft/StandardTexture.java36
-rw-r--r--src/Java/binnie/craftgui/window/Panel.java58
-rw-r--r--src/Java/binnie/extrabees/ExtraBees.java123
-rw-r--r--src/Java/binnie/extrabees/apiary/ComponentBeeModifier.java88
-rw-r--r--src/Java/binnie/extrabees/apiary/ComponentExtraBeeGUI.java28
-rw-r--r--src/Java/binnie/extrabees/apiary/EnumHiveFrame.java140
-rw-r--r--src/Java/binnie/extrabees/apiary/IndustrialFrame.java141
-rw-r--r--src/Java/binnie/extrabees/apiary/ItemHiveFrame.java100
-rw-r--r--src/Java/binnie/extrabees/apiary/ItemIndustrialFrame.java66
-rw-r--r--src/Java/binnie/extrabees/apiary/ModuleApiary.java96
-rw-r--r--src/Java/binnie/extrabees/apiary/TileExtraBeeAlveary.java355
-rw-r--r--src/Java/binnie/extrabees/apiary/machine/AlvearyFrame.java125
-rw-r--r--src/Java/binnie/extrabees/apiary/machine/AlvearyHatchery.java106
-rw-r--r--src/Java/binnie/extrabees/apiary/machine/AlvearyLighting.java41
-rw-r--r--src/Java/binnie/extrabees/apiary/machine/AlvearyMachine.java66
-rw-r--r--src/Java/binnie/extrabees/apiary/machine/AlvearyMutator.java125
-rw-r--r--src/Java/binnie/extrabees/apiary/machine/AlvearyRainShield.java41
-rw-r--r--src/Java/binnie/extrabees/apiary/machine/AlvearyStimulator.java430
-rw-r--r--src/Java/binnie/extrabees/apiary/machine/AlvearyTransmission.java81
-rw-r--r--src/Java/binnie/extrabees/config/ConfigurationMachines.java17
-rw-r--r--src/Java/binnie/extrabees/config/ConfigurationMain.java26
-rw-r--r--src/Java/binnie/extrabees/core/ExtraBeeGUID.java54
-rw-r--r--src/Java/binnie/extrabees/core/ExtraBeeItems.java172
-rw-r--r--src/Java/binnie/extrabees/core/ExtraBeeTexture.java28
-rw-r--r--src/Java/binnie/extrabees/core/ModuleCore.java19
-rw-r--r--src/Java/binnie/extrabees/gui/WindowAlvearyFrame.java53
-rw-r--r--src/Java/binnie/extrabees/gui/WindowAlvearyHatchery.java54
-rw-r--r--src/Java/binnie/extrabees/gui/WindowAlvearyIndustrialFrame.java53
-rw-r--r--src/Java/binnie/extrabees/gui/WindowAlvearyMutator.java78
-rw-r--r--src/Java/binnie/extrabees/gui/WindowAlvearyStimulator.java56
-rw-r--r--src/Java/binnie/extrabees/liquids/ExtraBeeLiquid.java80
-rw-r--r--src/Java/binnie/extrabees/liquids/ModuleLiquids.java19
-rw-r--r--src/Java/binnie/extrabees/proxy/ExtraBeesProxy.java13
-rw-r--r--src/Java/binnie/extrabees/proxy/ExtraBeesProxyClient.java5
-rw-r--r--src/Java/binnie/extrabees/proxy/ExtraBeesProxyServer.java5
-rw-r--r--src/Java/miscutil/MiscUtils.java21
-rw-r--r--src/Java/miscutil/core/CommonProxy.java70
-rw-r--r--src/Java/miscutil/core/block/BasicBlock.java4
-rw-r--r--src/Java/miscutil/core/block/ModBlocks.java6
-rw-r--r--src/Java/miscutil/core/commands/CommandMath.java8
-rw-r--r--src/Java/miscutil/core/creativetabs/AddToCreativeTab.java (renamed from src/Java/miscutil/core/creativetabs/TMCreativeTabs.java)2
-rw-r--r--src/Java/miscutil/core/item/ModItems.java58
-rw-r--r--src/Java/miscutil/core/item/materials/MaterialHandler.java1
-rw-r--r--src/Java/miscutil/core/lib/Strings.java5
-rw-r--r--src/Java/miscutil/core/proxy/ClientProxy.java2
-rw-r--r--src/Java/miscutil/core/proxy/ServerProxy.java2
-rw-r--r--src/Java/miscutil/gregtech/init/machines/GregtechEnergyBuffer.java4
343 files changed, 68 insertions, 24188 deletions
diff --git a/src/Java/binnie/Binnie.java b/src/Java/binnie/Binnie.java
deleted file mode 100644
index eb976368cd..0000000000
--- a/src/Java/binnie/Binnie.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package binnie;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import binnie.core.ManagerBase;
-import binnie.core.item.ManagerItem;
-import binnie.core.language.ManagerLanguage;
-import binnie.core.machines.ManagerMachine;
-import binnie.core.mod.config.ManagerConfig;
-import binnie.core.resource.ManagerResource;
-
-public final class Binnie
-{
- public static final List<ManagerBase> Managers = new ArrayList();
- public static final ManagerLanguage Language = new ManagerLanguage();
- //public static final ManagerGenetics Genetics = new ManagerGenetics();
- public static final ManagerConfig Configuration = new ManagerConfig();
- //public static final ManagerLiquid Liquid = new ManagerLiquid();
- public static final ManagerMachine Machine = new ManagerMachine();
- public static final ManagerItem Item = new ManagerItem();
- public static final ManagerResource Resource = new ManagerResource();
-}
diff --git a/src/Java/binnie/Constants.java b/src/Java/binnie/Constants.java
deleted file mode 100644
index 30abf2c3c2..0000000000
--- a/src/Java/binnie/Constants.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package binnie;
-
-public final class Constants
-{
- public static final String LiquidJuice = "juice";
- public static final String LiquidWater = "water";
- public static final String LiquidSeedOil = "seedoil";
- public static final String LiquidCreosote = "Creosote Oil";
- public static final String LiquidEthanol = "bioethanol";
- public static final String LiquidHoney = "for.honey";
-}
diff --git a/src/Java/binnie/core/AbstractMod.java b/src/Java/binnie/core/AbstractMod.java
deleted file mode 100644
index 74f274cdb7..0000000000
--- a/src/Java/binnie/core/AbstractMod.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package binnie.core;
-
-import binnie.Binnie;
-import binnie.core.gui.IBinnieGUID;
-import binnie.core.mod.config.ManagerConfig;
-import binnie.core.mod.parser.FieldParser;
-import binnie.core.network.BinniePacketHandler;
-import binnie.core.network.IPacketID;
-import binnie.core.network.IPacketProvider;
-import binnie.core.network.packet.MessageBinnie;
-import binnie.core.proxy.IProxyCore;
-import cpw.mods.fml.common.eventhandler.EventBus;
-import cpw.mods.fml.common.network.NetworkRegistry;
-import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
-import cpw.mods.fml.relauncher.Side;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.LinkedHashSet;
-import java.util.List;
-import net.minecraftforge.common.MinecraftForge;
-
-public abstract class AbstractMod
- implements IPacketProvider, IInitializable
-{
- private SimpleNetworkWrapper wrapper;
-
- public AbstractMod()
- {
- BinnieCore.registerMod(this);
- MinecraftForge.EVENT_BUS.register(this);
- }
-
- public abstract boolean isActive();
-
- public abstract String getChannel();
-
- public IPacketID[] getPacketIDs()
- {
- return new IPacketID[0];
- }
-
- public IBinnieGUID[] getGUIDs()
- {
- return new IBinnieGUID[0];
- }
-
- public Class[] getConfigs()
- {
- return new Class[0];
- }
-
- public abstract IProxyCore getProxy();
-
- public abstract String getModID();
-
- public SimpleNetworkWrapper getNetworkWrapper()
- {
- return this.wrapper;
- }
-
- protected abstract Class<? extends BinniePacketHandler> getPacketHandler();
-
- public void preInit()
- {
- if (!isActive()) {
- return;
- }
- if (getConfigs() != null) {
- for (Class cls : getConfigs()) {
- Binnie.Configuration.registerConfiguration(cls, this);
- }
- }
- getProxy().preInit();
- for (IInitializable module : this.modules) {
- module.preInit();
- }
- for (Field field : getClass().getFields()) {
- this.fields.add(field);
- }
- for (Class cls : getClass().getClasses()) {
- for (Field field : getClass().getFields()) {
- this.fields.add(field);
- }
- }
- for (IInitializable module : this.modules) {
- for (Field field : module.getClass().getFields()) {
- this.fields.add(field);
- }
- }
- for (Field field : this.fields) {
- try
- {
- FieldParser.preInitParse(field, this);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- public void init()
- {
- if (!isActive()) {
- return;
- }
- getProxy().init();
-
- this.wrapper = NetworkRegistry.INSTANCE.newSimpleChannel(getChannel());
-
- this.wrapper.registerMessage(getPacketHandler(), MessageBinnie.class, 1, Side.CLIENT);
- this.wrapper.registerMessage(getPacketHandler(), MessageBinnie.class, 1, Side.SERVER);
- for (IInitializable module : this.modules) {
- module.init();
- }
- for (Field field : this.fields) {
- try
- {
- FieldParser.initParse(field, this);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- private LinkedHashSet<Field> fields = new LinkedHashSet();
-
- public void postInit()
- {
- if (!isActive()) {
- return;
- }
- getProxy().postInit();
- for (IInitializable module : this.modules) {
- module.postInit();
- }
- for (Field field : this.fields) {
- try
- {
- FieldParser.postInitParse(field, this);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- protected final void addModule(IInitializable init)
- {
- this.modules.add(init);
- MinecraftForge.EVENT_BUS.register(init);
- }
-
- protected List<IInitializable> modules = new ArrayList();
-}
diff --git a/src/Java/binnie/core/BinnieCore.java b/src/Java/binnie/core/BinnieCore.java
deleted file mode 100644
index e2dbc502e3..0000000000
--- a/src/Java/binnie/core/BinnieCore.java
+++ /dev/null
@@ -1,240 +0,0 @@
-package binnie.core;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.server.MinecraftServer;
-import net.minecraftforge.client.event.TextureStitchEvent;
-import binnie.Binnie;
-import binnie.core.block.MultipassBlockRenderer;
-import binnie.core.block.TileEntityMetadata;
-import binnie.core.gui.BinnieCoreGUI;
-import binnie.core.gui.BinnieGUIHandler;
-import binnie.core.gui.IBinnieGUID;
-import binnie.core.item.ItemFieldKit;
-import binnie.core.item.ItemGenesis;
-import binnie.core.machines.MachineGroup;
-import binnie.core.machines.storage.ModuleStorage;
-import binnie.core.mod.config.ConfigurationMain;
-import binnie.core.mod.config.ConfigurationMods;
-import binnie.core.mod.parser.FieldParser;
-import binnie.core.mod.parser.ItemParser;
-import binnie.core.network.BinnieCorePacketID;
-import binnie.core.network.BinniePacketHandler;
-import binnie.core.network.IPacketID;
-import binnie.core.proxy.BinnieProxy;
-import binnie.core.proxy.IBinnieProxy;
-import binnie.core.triggers.ModuleTrigger;
-import binnie.craftgui.minecraft.ModuleCraftGUI;
-import cpw.mods.fml.client.registry.RenderingRegistry;
-import cpw.mods.fml.common.Loader;
-import cpw.mods.fml.common.Mod;
-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.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.network.NetworkRegistry;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import forestry.api.core.ForestryEvent;
-import forestry.plugins.PluginManager;
-
-@Mod(modid="BinnieCore", name="Binnie Core", useMetadata=true)
-public final class BinnieCore
- extends AbstractMod
-{
- @Mod.Instance("BinnieCore")
- public static BinnieCore instance;
- @SidedProxy(clientSide="binnie.core.proxy.BinnieProxyClient", serverSide="binnie.core.proxy.BinnieProxyServer")
- public static BinnieProxy proxy;
- public static int multipassRenderID;
-
- @Mod.EventHandler
- public void preInit(FMLPreInitializationEvent evt)
- {
- Binnie.Configuration.registerConfiguration(ConfigurationMods.class, this);
- for (ManagerBase baseManager : Binnie.Managers) {
- addModule(baseManager);
- }
- addModule(new ModuleCraftGUI());
- addModule(new ModuleStorage());
- //addModule(new ModuleItems());
- if (Loader.isModLoaded("BuildCraft|Silicon")) {
- addModule(new ModuleTrigger());
- }
- preInit();
- }
-
- @Mod.EventHandler
- public void init(FMLInitializationEvent evt)
- {
- init();
- }
-
- @Mod.EventHandler
- public void postInit(FMLPostInitializationEvent evt)
- {
- postInit();
- }
-
- public IBinnieGUID[] getGUIDs()
- {
- return BinnieCoreGUI.values();
- }
-
- public void preInit()
- {
- instance = this;
- FieldParser.parsers.add(new ItemParser());
-
- super.preInit();
- }
-
- public void init()
- {
- super.init();
- for (AbstractMod mod : getActiveMods()) {
- NetworkRegistry.INSTANCE.registerGuiHandler(mod, new BinnieGUIHandler(mod));
- }
- multipassRenderID = RenderingRegistry.getNextAvailableRenderId();
- RenderingRegistry.registerBlockHandler(new MultipassBlockRenderer());
-
- GameRegistry.registerTileEntity(TileEntityMetadata.class, "binnie.tile.metadata");
- }
-
- public static boolean isLepidopteryActive()
- {
- return PluginManager.Module.LEPIDOPTEROLOGY.isEnabled();
- }
-
- public static boolean isApicultureActive()
- {
- return PluginManager.Module.APICULTURE.isEnabled();
- }
-
- public static boolean isArboricultureActive()
- {
- return PluginManager.Module.ARBORICULTURE.isEnabled();
- }
-
- public static boolean isBotanyActive()
- {
- return ConfigurationMods.botany;
- }
-
- public static boolean isGeneticsActive()
- {
- return ConfigurationMods.genetics;
- }
-
- public static boolean isExtraBeesActive()
- {
- return (ConfigurationMods.extraBees) && (isApicultureActive());
- }
-
- public static boolean isExtraTreesActive()
- {
- return (ConfigurationMods.extraTrees) && (isArboricultureActive());
- }
-
- public void postInit()
- {
- super.postInit();
- }
-
- private static List<AbstractMod> modList = new ArrayList();
- public static MachineGroup packageCompartment;
- public static ItemGenesis genesis;
- public static ItemFieldKit fieldKit;
-
- static void registerMod(AbstractMod mod)
- {
- modList.add(mod);
- }
-
- private static List<AbstractMod> getActiveMods()
- {
- List<AbstractMod> list = new ArrayList();
- for (AbstractMod mod : modList) {
- if (mod.isActive()) {
- list.add(mod);
- }
- }
- return list;
- }
-
- @SubscribeEvent
- @SideOnly(Side.CLIENT)
- public void handleSpeciesDiscovered(ForestryEvent.SpeciesDiscovered event)
- {
- try
- {
- EntityPlayerMP player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(event.username.getName());
- if (player == null) {
- return;
- }
- event.tracker.synchToPlayer(player);
- NBTTagCompound nbt = new NBTTagCompound();
- nbt.setString("species", event.species.getUID());
- }
- catch (Exception e) {}
- }
-
- public String getChannel()
- {
- return "BIN";
- }
-
- public IBinnieProxy getProxy()
- {
- return proxy;
- }
-
- public String getModID()
- {
- return "binniecore";
- }
-
- public IPacketID[] getPacketIDs()
- {
- return BinnieCorePacketID.values();
- }
-
- @SubscribeEvent
- @SideOnly(Side.CLIENT)
- public void handleTextureRemap(TextureStitchEvent.Pre event)
- {
- if (event.map.getTextureType() == 0) {
- //Binnie.Liquid.reloadIcons(event.map);
- }
- Binnie.Resource.registerIcons(event.map, event.map.getTextureType());
- }
-
- public Class<?>[] getConfigs()
- {
- return new Class[] { ConfigurationMain.class };
- }
-
- protected Class<? extends BinniePacketHandler> getPacketHandler()
- {
- return PacketHandler.class;
- }
-
- public static class PacketHandler
- extends BinniePacketHandler
- {
- public PacketHandler()
- {
- super(instance);
- }
- }
-
- public boolean isActive()
- {
- return true;
- }
-}
diff --git a/src/Java/binnie/core/IInitializable.java b/src/Java/binnie/core/IInitializable.java
deleted file mode 100644
index 7a357faa12..0000000000
--- a/src/Java/binnie/core/IInitializable.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package binnie.core;
-
-public abstract interface IInitializable
-{
- public abstract void preInit();
-
- public abstract void init();
-
- public abstract void postInit();
-}
diff --git a/src/Java/binnie/core/ManagerBase.java b/src/Java/binnie/core/ManagerBase.java
deleted file mode 100644
index 9627ed20bd..0000000000
--- a/src/Java/binnie/core/ManagerBase.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package binnie.core;
-
-import binnie.Binnie;
-import java.util.List;
-
-public abstract class ManagerBase
- implements IInitializable
-{
- public ManagerBase()
- {
- Binnie.Managers.add(this);
- }
-
- public void preInit() {}
-
- public void init() {}
-
- public void postInit() {}
-}
diff --git a/src/Java/binnie/core/Mods.java b/src/Java/binnie/core/Mods.java
deleted file mode 100644
index 9c242aa712..0000000000
--- a/src/Java/binnie/core/Mods.java
+++ /dev/null
@@ -1 +0,0 @@
-// INTERNAL ERROR // \ No newline at end of file
diff --git a/src/Java/binnie/core/block/BlockMetadata.java b/src/Java/binnie/core/block/BlockMetadata.java
deleted file mode 100644
index 39b461d01d..0000000000
--- a/src/Java/binnie/core/block/BlockMetadata.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package binnie.core.block;
-
-import binnie.core.BinnieCore;
-import binnie.core.proxy.BinnieProxy;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.PlayerCapabilities;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.MovingObjectPosition;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class BlockMetadata
- extends BlockContainer
- implements IBlockMetadata
-{
- public BlockMetadata(Material material)
- {
- super(material);
- }
-
- public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune)
- {
- return getBlockDropped(this, world, x, y, z, blockMeta);
- }
-
- public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z)
- {
- return breakBlock(this, player, world, x, y, z);
- }
-
- public TileEntity createNewTileEntity(World var1, int i)
- {
- return new TileEntityMetadata();
- }
-
- public boolean hasTileEntity(int meta)
- {
- return true;
- }
-
- public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6)
- {
- super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
- TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
- return tileentity != null ? tileentity.receiveClientEvent(par5, par6) : false;
- }
-
- public IIcon getIcon(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
- {
- int metadata = TileEntityMetadata.getTileMetadata(par1IBlockAccess, par2, par3, par4);
- return getIcon(par5, metadata);
- }
-
- public String getBlockName(ItemStack par1ItemStack)
- {
- return getLocalizedName();
- }
-
- public void getBlockTooltip(ItemStack par1ItemStack, List par3List) {}
-
- public int getPlacedMeta(ItemStack item, World world, int x, int y, int z, ForgeDirection clickedBlock)
- {
- int damage = TileEntityMetadata.getItemDamage(item);
- return damage;
- }
-
- public int getDroppedMeta(int tileMeta, int blockMeta)
- {
- return tileMeta;
- }
-
- public static ArrayList<ItemStack> getBlockDropped(IBlockMetadata block, World world, int x, int y, int z, int blockMeta)
- {
- ArrayList<ItemStack> array = new ArrayList();
- TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
- if ((tile != null) && (!tile.hasDroppedBlock()))
- {
- int meta = block.getDroppedMeta(world.getBlockMetadata(x, y, z), tile.getTileMetadata());
- array.add(TileEntityMetadata.getItemStack((Block)block, meta));
- }
- return array;
- }
-
- static int temporyMeta = -1;
-
- public static boolean breakBlock(IBlockMetadata block, EntityPlayer player, World world, int i, int j, int k)
- {
- List<ItemStack> drops = new ArrayList();
-
- Block block2 = (Block)block;
-
- TileEntityMetadata tile = TileEntityMetadata.getTile(world, i, j, k);
- if ((tile != null) && (!tile.hasDroppedBlock()))
- {
- int tileMeta = TileEntityMetadata.getTileMetadata(world, i, j, k);
- drops = block2.getDrops(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
- }
- boolean hasBeenBroken = world.setBlockToAir(i, j, k);
- if ((hasBeenBroken) && (BinnieCore.proxy.isSimulating(world)) && (drops.size() > 0) && ((player == null) || (!player.capabilities.isCreativeMode)))
- {
- for (ItemStack drop : drops) {
- block.dropAsStack(world, i, j, k, drop);
- }
- tile.dropBlock();
- }
- return hasBeenBroken;
- }
-
- public void dropAsStack(World world, int x, int y, int z, ItemStack drop)
- {
- dropBlockAsItem(world, x, y, z, drop);
- }
-
- public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6)
- {
- super.breakBlock(par1World, par2, par3, par4, par5, par6);
- par1World.removeTileEntity(par2, par3, par4);
- }
-
- public static ItemStack getPickBlock(World world, int x, int y, int z)
- {
- List<ItemStack> list = getBlockDropped((IBlockMetadata)world.getBlock(x, y, z), world, x, y, z, world.getBlockMetadata(x, y, z));
- return list.isEmpty() ? null : (ItemStack)list.get(0);
- }
-
- public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
- {
- return getPickBlock(world, x, y, z);
- }
-}
diff --git a/src/Java/binnie/core/block/IBlockMetadata.java b/src/Java/binnie/core/block/IBlockMetadata.java
deleted file mode 100644
index b182139de7..0000000000
--- a/src/Java/binnie/core/block/IBlockMetadata.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package binnie.core.block;
-
-import java.util.List;
-import net.minecraft.block.ITileEntityProvider;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public abstract interface IBlockMetadata
- extends ITileEntityProvider
-{
- public abstract int getPlacedMeta(ItemStack paramItemStack, World paramWorld, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection);
-
- public abstract int getDroppedMeta(int paramInt1, int paramInt2);
-
- public abstract String getBlockName(ItemStack paramItemStack);
-
- public abstract void getBlockTooltip(ItemStack paramItemStack, List paramList);
-
- public abstract void dropAsStack(World paramWorld, int paramInt1, int paramInt2, int paramInt3, ItemStack paramItemStack);
-}
diff --git a/src/Java/binnie/core/block/IMultipassBlock.java b/src/Java/binnie/core/block/IMultipassBlock.java
deleted file mode 100644
index fd578c0ee5..0000000000
--- a/src/Java/binnie/core/block/IMultipassBlock.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.core.block;
-
-public abstract interface IMultipassBlock
-{
- public abstract int getNumberOfPasses();
-
- public abstract int colorMultiplier(int paramInt);
-}
diff --git a/src/Java/binnie/core/block/ItemMetadata.java b/src/Java/binnie/core/block/ItemMetadata.java
deleted file mode 100644
index a3cd5173a9..0000000000
--- a/src/Java/binnie/core/block/ItemMetadata.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package binnie.core.block;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.List;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-
-public class ItemMetadata
- extends ItemBlock
-{
- public ItemMetadata(Block block)
- {
- super(block);
- }
-
- public int getMetadata(int par1)
- {
- return 0;
- }
-
- 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)
- {
- Block block = this.field_150939_a;
- if (!(block instanceof IBlockMetadata)) {
- return false;
- }
- int placedMeta = ((IBlockMetadata)block).getPlacedMeta(stack, world, x, y, z, net.minecraftforge.common.util.ForgeDirection.values()[side]);
- if (placedMeta < 0) {
- return false;
- }
- if (!world.setBlock(x, y, z, block, metadata, 3)) {
- return false;
- }
- if (world.getBlock(x, y, z) == block)
- {
- TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
- if (tile != null) {
- tile.setTileMetadata(placedMeta, false);
- }
- block.onBlockPlacedBy(world, x, y, z, player, stack);
- block.onPostBlockPlaced(world, x, y, z, metadata);
- }
- return true;
- }
-
- @SideOnly(Side.CLIENT)
- public String getItemStackDisplayName(ItemStack par1ItemStack)
- {
- return ((IBlockMetadata)this.field_150939_a).getBlockName(par1ItemStack);
- }
-
- @SideOnly(Side.CLIENT)
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
- {
- ((IBlockMetadata)this.field_150939_a).getBlockTooltip(par1ItemStack, par3List);
- }
-
- public IIcon getIconFromDamage(int par1)
- {
- return this.field_150939_a.getIcon(1, par1);
- }
-}
diff --git a/src/Java/binnie/core/block/ItemMetadataRenderer.java b/src/Java/binnie/core/block/ItemMetadataRenderer.java
deleted file mode 100644
index e96dd068c1..0000000000
--- a/src/Java/binnie/core/block/ItemMetadataRenderer.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package binnie.core.block;
-
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.OpenGlHelper;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.client.IItemRenderer;
-import net.minecraftforge.client.IItemRenderer.ItemRenderType;
-import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
-import org.lwjgl.opengl.GL11;
-
-public class ItemMetadataRenderer
- implements IItemRenderer
-{
- public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type)
- {
- return (type == IItemRenderer.ItemRenderType.INVENTORY) || (type == IItemRenderer.ItemRenderType.ENTITY) || (type == IItemRenderer.ItemRenderType.EQUIPPED) || (type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON);
- }
-
- public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper)
- {
- if (type == IItemRenderer.ItemRenderType.INVENTORY) {
- return helper == IItemRenderer.ItemRendererHelper.INVENTORY_BLOCK;
- }
- if (type == IItemRenderer.ItemRenderType.ENTITY) {
- return (helper == IItemRenderer.ItemRendererHelper.ENTITY_BOBBING) || (helper == IItemRenderer.ItemRendererHelper.ENTITY_ROTATION);
- }
- if ((type == IItemRenderer.ItemRenderType.EQUIPPED) || (type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON)) {
- return helper == IItemRenderer.ItemRendererHelper.EQUIPPED_BLOCK;
- }
- return false;
- }
-
- public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data)
- {
- GL11.glPushMatrix();
-
-
-
-
-
-
-
-
-
-
- Block block = Block.getBlockFromItem(item.getItem());
- if (type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) {
- GL11.glTranslated(0.5D, 0.5D, 0.5D);
- }
- if ((type == IItemRenderer.ItemRenderType.INVENTORY) &&
- (block.getRenderBlockPass() != 0))
- {
- GL11.glAlphaFunc(516, 0.1F);
- GL11.glEnable(3042);
- OpenGlHelper.glBlendFunc(770, 771, 1, 0);
- }
- GL11.glPushMatrix();
- ((RenderBlocks)data[0]).renderBlockAsItem(block, TileEntityMetadata.getItemDamage(item), 1.0F);
-
- GL11.glPopMatrix();
- GL11.glPopMatrix();
- }
-}
diff --git a/src/Java/binnie/core/block/MultipassBlockRenderer.java b/src/Java/binnie/core/block/MultipassBlockRenderer.java
deleted file mode 100644
index cc809fb8e5..0000000000
--- a/src/Java/binnie/core/block/MultipassBlockRenderer.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package binnie.core.block;
-
-import binnie.core.BinnieCore;
-import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.world.IBlockAccess;
-import org.lwjgl.opengl.GL11;
-
-public class MultipassBlockRenderer
- implements ISimpleBlockRenderingHandler
-{
- public static MultipassBlockRenderer instance;
-
- public MultipassBlockRenderer()
- {
- instance = this;
- }
-
- private void setColour(Tessellator tess, int colour)
- {
- float var6 = (colour >> 16 & 0xFF) / 255.0F;
- float var7 = (colour >> 8 & 0xFF) / 255.0F;
- float var8 = (colour & 0xFF) / 255.0F;
- GL11.glColor3f(var6, var7, var8);
- }
-
- private static int layer = 0;
-
- public static int getLayer()
- {
- return layer;
- }
-
- public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer)
- {
- block.setBlockBoundsForItemRender();
- renderer.setRenderBoundsFromBlock(block);
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
- for (layer = 0; layer < ((IMultipassBlock)block).getNumberOfPasses(); layer += 1) {
- renderItem(block, renderer, meta);
- }
- layer = 0;
- }
-
- public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
- {
- boolean r = true;
- for (layer = 0; layer < ((IMultipassBlock)block).getNumberOfPasses(); layer += 1) {
- r = renderer.renderStandardBlock(block, x, y, z);
- }
- layer = 0;
- return r;
- }
-
- public boolean shouldRender3DInInventory(int i)
- {
- return true;
- }
-
- public int getRenderId()
- {
- return BinnieCore.multipassRenderID;
- }
-
- public void renderItem(Block block, RenderBlocks renderer, int meta)
- {
- setColor(((IMultipassBlock)block).colorMultiplier(meta));
-
- Tessellator tessellator = Tessellator.instance;
-
- tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, -1.0F, 0.0F);
- renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
- tessellator.draw();
- tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 1.0F, 0.0F);
- renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
- tessellator.draw();
- tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, -1.0F);
- renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
- tessellator.draw();
- tessellator.startDrawingQuads();
- tessellator.setNormal(0.0F, 0.0F, 1.0F);
- renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
- tessellator.draw();
- tessellator.startDrawingQuads();
- tessellator.setNormal(-1.0F, 0.0F, 0.0F);
- renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
- tessellator.draw();
- tessellator.startDrawingQuads();
- tessellator.setNormal(1.0F, 0.0F, 0.0F);
- renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
- tessellator.draw();
- }
-
- public void setColor(int l)
- {
- float f = (l >> 16 & 0xFF) / 255.0F;
- float f1 = (l >> 8 & 0xFF) / 255.0F;
- float f2 = (l & 0xFF) / 255.0F;
- GL11.glColor3f(f, f1, f2);
- }
-}
diff --git a/src/Java/binnie/core/block/MultipassItemRenderer.java b/src/Java/binnie/core/block/MultipassItemRenderer.java
deleted file mode 100644
index 6e53642b2f..0000000000
--- a/src/Java/binnie/core/block/MultipassItemRenderer.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package binnie.core.block;
-
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.OpenGlHelper;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.client.IItemRenderer;
-import net.minecraftforge.client.IItemRenderer.ItemRenderType;
-import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
-import org.lwjgl.opengl.GL11;
-
-public class MultipassItemRenderer
- implements IItemRenderer
-{
- private void render(RenderBlocks renderer, ItemStack item, float f, float g, float h)
- {
- GL11.glTranslatef(f, g, h);
-
- Block block = ((ItemBlock)item.getItem()).field_150939_a;
-
- GL11.glEnable(3008);
- if (block.getRenderBlockPass() != 0)
- {
- GL11.glAlphaFunc(516, 0.1F);
- GL11.glEnable(3042);
- OpenGlHelper.glBlendFunc(770, 771, 1, 0);
- }
- else
- {
- GL11.glAlphaFunc(516, 0.5F);
- GL11.glDisable(3042);
- }
- MultipassBlockRenderer.instance.renderInventoryBlock(block, TileEntityMetadata.getItemDamage(item), 0, renderer);
- if (block.getRenderBlockPass() == 0) {
- GL11.glAlphaFunc(516, 0.1F);
- }
- GL11.glTranslatef(-f, -g, -h);
- }
-
- public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type)
- {
- switch (1.$SwitchMap$net$minecraftforge$client$IItemRenderer$ItemRenderType[type.ordinal()])
- {
- case 1:
- return true;
- case 2:
- return true;
- case 3:
- return true;
- case 4:
- return true;
- }
- return false;
- }
-
- public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper)
- {
- return true;
- }
-
- public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data)
- {
- switch (1.$SwitchMap$net$minecraftforge$client$IItemRenderer$ItemRenderType[type.ordinal()])
- {
- case 1:
- render((RenderBlocks)data[0], item, 0.0F, 0.0F, 0.0F);
- break;
- case 2:
- case 4:
- render((RenderBlocks)data[0], item, 0.5F, 0.5F, 0.5F);
- break;
- case 3:
- render((RenderBlocks)data[0], item, 0.0F, 0.0F, 0.0F);
- break;
- }
- }
-}
diff --git a/src/Java/binnie/core/block/TileEntityMetadata.java b/src/Java/binnie/core/block/TileEntityMetadata.java
deleted file mode 100644
index 28563e66e7..0000000000
--- a/src/Java/binnie/core/block/TileEntityMetadata.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package binnie.core.block;
-
-import binnie.core.BinnieCore;
-import binnie.core.network.packet.MessageMetadata;
-import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.Packet;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-public class TileEntityMetadata
- extends TileEntity
-{
- private int meta;
-
- public boolean receiveClientEvent(int par1, int par2)
- {
- if (par1 == 42)
- {
- this.meta = par2;
- this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
- }
- return true;
- }
-
- public void readFromNBT(NBTTagCompound nbt)
- {
- super.readFromNBT(nbt);
- this.meta = nbt.getInteger("meta");
- }
-
- public void writeToNBT(NBTTagCompound nbt)
- {
- super.writeToNBT(nbt);
- nbt.setInteger("meta", this.meta);
- }
-
- public boolean canUpdate()
- {
- return false;
- }
-
- public int getTileMetadata()
- {
- return this.meta;
- }
-
- public void setTileMetadata(int meta, boolean notify)
- {
- if (this.meta != meta)
- {
- this.meta = meta;
- if (notify) {
- this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
- }
- }
- }
-
- public Packet getDescriptionPacket()
- {
- return BinnieCore.instance.getNetworkWrapper().getPacketFrom(new MessageMetadata(this.xCoord, this.yCoord, this.zCoord, this.meta).GetMessage());
- }
-
- public static TileEntityMetadata getTile(IBlockAccess world, int x, int y, int z)
- {
- TileEntity tile = world.getTileEntity(x, y, z);
- if (!(tile instanceof TileEntityMetadata)) {
- return null;
- }
- return (TileEntityMetadata)tile;
- }
-
- public static ItemStack getItemStack(Block block, int damage)
- {
- ItemStack item = new ItemStack(block, 1, 0);
- setItemDamage(item, damage);
- return item;
- }
-
- public static void setItemDamage(ItemStack item, int i)
- {
- item.setItemDamage(i < 16387 ? i : 16387);
- NBTTagCompound tag = new NBTTagCompound();
- tag.setInteger("meta", i);
- item.setTagCompound(tag);
- }
-
- public static int getItemDamage(ItemStack item)
- {
- if ((item.hasTagCompound()) && (item.getTagCompound().hasKey("meta"))) {
- return item.getTagCompound().getInteger("meta");
- }
- return item.getItemDamage();
- }
-
- public static int getTileMetadata(IBlockAccess world, int x, int y, int z)
- {
- TileEntityMetadata tile = getTile(world, x, y, z);
- return tile == null ? 0 : tile.getTileMetadata();
- }
-
- private boolean droppedBlock = false;
-
- public boolean hasDroppedBlock()
- {
- return this.droppedBlock;
- }
-
- public void dropBlock()
- {
- this.droppedBlock = true;
- }
-}
diff --git a/src/Java/binnie/core/circuits/BinnieCircuit.java b/src/Java/binnie/core/circuits/BinnieCircuit.java
deleted file mode 100644
index e7e2db0203..0000000000
--- a/src/Java/binnie/core/circuits/BinnieCircuit.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package binnie.core.circuits;
-
-import forestry.api.circuits.ChipsetManager;
-import forestry.api.circuits.ICircuit;
-import forestry.api.circuits.ICircuitLayout;
-import forestry.api.circuits.ICircuitRegistry;
-import forestry.api.circuits.ISolderManager;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-
-public class BinnieCircuit
- implements ICircuit
-{
- private String uid;
- private int limit;
- private List<String> tooltips = new ArrayList();
-
- public BinnieCircuit(String uid, int limit, ICircuitLayout layout, ItemStack itemStack)
- {
- this.uid = ("binnie.circuit." + uid);
- this.limit = limit;
- ChipsetManager.circuitRegistry.registerCircuit(this);
- if (itemStack != null) {
- ChipsetManager.solderManager.addRecipe(layout, itemStack, this);
- }
- }
-
- public BinnieCircuit(String uid, int limit, ICircuitLayout layout, Item item, int itemMeta)
- {
- this(uid, limit, layout, new ItemStack(item, 1, itemMeta));
- }
-
- public void addTooltipString(String string)
- {
- this.tooltips.add(string);
- }
-
- public String getUID()
- {
- return this.uid;
- }
-
- public boolean requiresDiscovery()
- {
- return false;
- }
-
- public int getLimit()
- {
- return this.limit;
- }
-
- public String getName()
- {
- return this.uid;
- }
-
- public boolean isCircuitable(TileEntity tile)
- {
- return false;
- }
-
- public void onInsertion(int slot, TileEntity tile) {}
-
- public void onLoad(int slot, TileEntity tile) {}
-
- public void onRemoval(int slot, TileEntity tile) {}
-
- public void onTick(int slot, TileEntity tile) {}
-
- public void addTooltip(List<String> list)
- {
- for (String string : this.tooltips) {
- list.add(" - " + string);
- }
- }
-}
diff --git a/src/Java/binnie/core/circuits/BinnieCircuitLayout.java b/src/Java/binnie/core/circuits/BinnieCircuitLayout.java
deleted file mode 100644
index 0f160054ce..0000000000
--- a/src/Java/binnie/core/circuits/BinnieCircuitLayout.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package binnie.core.circuits;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import binnie.core.language.ManagerLanguage;
-import forestry.api.circuits.ChipsetManager;
-import forestry.api.circuits.ICircuitLayout;
-import forestry.api.circuits.ICircuitRegistry;
-
-public class BinnieCircuitLayout
- implements ICircuitLayout
-{
- private String uid;
- private AbstractMod mod;
-
- public BinnieCircuitLayout(AbstractMod mod, String uid)
- {
- this.uid = uid;
- this.mod = mod;
- ChipsetManager.circuitRegistry.registerLayout(this);
- }
-
- public String getUID()
- {
- return "binnie.circuitLayout" + this.uid;
- }
-
- public String getName()
- {
- return Binnie.Language.localise(this.mod, "circuit.layout." + this.uid.toLowerCase());
- }
-
- public String getUsage()
- {
- return Binnie.Language.localise(this.mod, "circuit.layout." + this.uid.toLowerCase() + ".usage");
- }
-}
diff --git a/src/Java/binnie/core/gui/BinnieCoreGUI.java b/src/Java/binnie/core/gui/BinnieCoreGUI.java
deleted file mode 100644
index 50f99306f1..0000000000
--- a/src/Java/binnie/core/gui/BinnieCoreGUI.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package binnie.core.gui;
-
-import binnie.core.machines.storage.WindowCompartment;
-import binnie.craftgui.binniecore.WindowFieldKit;
-import binnie.craftgui.binniecore.WindowGenesis;
-import binnie.craftgui.minecraft.Window;
-import cpw.mods.fml.relauncher.Side;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public enum BinnieCoreGUI
- implements IBinnieGUID
-{
- Compartment, FieldKit, Genesis;
-
- private BinnieCoreGUI() {}
-
- public Window getWindow(EntityPlayer player, IInventory object, Side side)
- throws Exception
- {
- switch (1.$SwitchMap$binnie$core$gui$BinnieCoreGUI[ordinal()])
- {
- case 1:
- return new WindowCompartment(player, object, side);
- case 2:
- return new WindowFieldKit(player, null, side);
- case 3:
- return new WindowGenesis(player, null, side);
- }
- return null;
- }
-
- public Window getWindow(EntityPlayer player, World world, int x, int y, int z, Side side)
- {
- Window window = null;
- TileEntity tileEntity = world.getTileEntity(x, y, z);
-
- IInventory object = null;
- if ((tileEntity instanceof IInventory)) {
- object = (IInventory)tileEntity;
- }
- try
- {
- window = getWindow(player, object, side);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- return window;
- }
-}
diff --git a/src/Java/binnie/core/gui/BinnieGUIHandler.java b/src/Java/binnie/core/gui/BinnieGUIHandler.java
deleted file mode 100644
index c146d914e0..0000000000
--- a/src/Java/binnie/core/gui/BinnieGUIHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package binnie.core.gui;
-
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.proxy.BinnieProxy;
-import binnie.craftgui.minecraft.Window;
-import cpw.mods.fml.common.network.IGuiHandler;
-import cpw.mods.fml.relauncher.Side;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.world.World;
-
-public final class BinnieGUIHandler
- implements IGuiHandler
-{
- private AbstractMod mod;
-
- public BinnieGUIHandler(AbstractMod mod)
- {
- this.mod = mod;
- }
-
- public final Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
- {
- Window window = getWindow(id, player, world, x, y, z, Side.SERVER);
- if (window == null) {
- return null;
- }
- window.initialiseServer();
-
- return window.getContainer();
- }
-
- public final Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
- {
- if (BinnieCore.proxy.isSimulating(world)) {
- return getServerGuiElement(id, player, world, x, y, z);
- }
- Window window = getWindow(id, player, world, x, y, z, Side.CLIENT);
- if (window == null) {
- return null;
- }
- return window.getGui();
- }
-
- public Window getWindow(int id, EntityPlayer player, World world, int x, int y, int z, Side side)
- {
- for (IBinnieGUID guid : this.mod.getGUIDs()) {
- if (guid.ordinal() == id) {
- return guid.getWindow(player, world, x, y, z, side);
- }
- }
- return null;
- }
-}
diff --git a/src/Java/binnie/core/gui/IBinnieGUID.java b/src/Java/binnie/core/gui/IBinnieGUID.java
deleted file mode 100644
index be0fd174da..0000000000
--- a/src/Java/binnie/core/gui/IBinnieGUID.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package binnie.core.gui;
-
-import binnie.core.network.IOrdinaled;
-import binnie.craftgui.minecraft.Window;
-import cpw.mods.fml.relauncher.Side;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.world.World;
-
-public abstract interface IBinnieGUID
- extends IOrdinaled
-{
- public abstract Window getWindow(EntityPlayer paramEntityPlayer, World paramWorld, int paramInt1, int paramInt2, int paramInt3, Side paramSide);
-}
diff --git a/src/Java/binnie/core/item/IItemEnum.java b/src/Java/binnie/core/item/IItemEnum.java
deleted file mode 100644
index 70b27d7aa7..0000000000
--- a/src/Java/binnie/core/item/IItemEnum.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package binnie.core.item;
-
-import net.minecraft.item.ItemStack;
-
-public abstract interface IItemEnum
-{
- public abstract boolean isActive();
-
- public abstract String getName(ItemStack paramItemStack);
-
- public abstract int ordinal();
-
- public abstract ItemStack get(int paramInt);
-}
diff --git a/src/Java/binnie/core/item/IItemMisc.java b/src/Java/binnie/core/item/IItemMisc.java
deleted file mode 100644
index 1538297884..0000000000
--- a/src/Java/binnie/core/item/IItemMisc.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package binnie.core.item;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.List;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-public abstract interface IItemMisc
- extends IItemEnum
-{
- public abstract IIcon getIcon(ItemStack paramItemStack);
-
- @SideOnly(Side.CLIENT)
- public abstract void registerIcons(IIconRegister paramIIconRegister);
-
- public abstract void addInformation(List paramList);
-}
diff --git a/src/Java/binnie/core/item/ItemFieldKit.java b/src/Java/binnie/core/item/ItemFieldKit.java
deleted file mode 100644
index 0a6ec0b813..0000000000
--- a/src/Java/binnie/core/item/ItemFieldKit.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package binnie.core.item;
-
-import binnie.core.BinnieCore;
-import binnie.core.gui.BinnieCoreGUI;
-import binnie.core.proxy.BinnieProxy;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.List;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-
-public class ItemFieldKit
- extends Item
-{
- private IIcon fieldKit0;
- private IIcon fieldKit1;
- private IIcon fieldKit2;
- private IIcon fieldKit3;
-
- public ItemFieldKit()
- {
- setUnlocalizedName("fieldKit");
- setCreativeTab(CreativeTabs.tabTools);
- setMaxStackSize(1);
- setMaxDamage(64);
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister register)
- {
- this.fieldKit0 = BinnieCore.proxy.getIcon(register, "fieldKit");
- this.fieldKit1 = BinnieCore.proxy.getIcon(register, "fieldKit1");
- this.fieldKit2 = BinnieCore.proxy.getIcon(register, "fieldKit2");
- this.fieldKit3 = BinnieCore.proxy.getIcon(register, "fieldKit3");
- this.itemIcon = this.fieldKit0;
- }
-
- public IIcon getIcon(ItemStack stack, int pass)
- {
- int damage = stack.getItemDamage();
- if (damage < 24) {
- return this.fieldKit3;
- }
- if (damage < 48) {
- return this.fieldKit2;
- }
- if (damage < 64) {
- return this.fieldKit1;
- }
- return this.fieldKit0;
- }
-
- public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
- {
- if (!player.isSneaking()) {
- BinnieCore.proxy.openGui(BinnieCoreGUI.FieldKit, player, (int)player.posX, (int)player.posY, (int)player.posZ);
- }
- return itemstack;
- }
-
- @SideOnly(Side.CLIENT)
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_)
- {
- int i = getMaxDamage() - p_77624_1_.getItemDamage();
- if (i == 0) {
- p_77624_3_.add("No paper");
- } else {
- p_77624_3_.add("" + i + " sheet" + (i > 1 ? "s" : "") + " of paper");
- }
- super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
- }
-
- public String getItemStackDisplayName(ItemStack p_77653_1_)
- {
- return "Field Kit";
- }
-}
diff --git a/src/Java/binnie/core/item/ItemGenesis.java b/src/Java/binnie/core/item/ItemGenesis.java
deleted file mode 100644
index 1e946372be..0000000000
--- a/src/Java/binnie/core/item/ItemGenesis.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package binnie.core.item;
-
-import binnie.core.BinnieCore;
-import binnie.core.gui.BinnieCoreGUI;
-import binnie.core.proxy.BinnieProxy;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import forestry.api.core.Tabs;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-public class ItemGenesis
- extends Item
-{
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister register)
- {
- this.itemIcon = BinnieCore.proxy.getIcon(register, "genesis");
- }
-
- public ItemGenesis()
- {
- setCreativeTab(Tabs.tabApiculture);
- setUnlocalizedName("genesis");
- setMaxStackSize(1);
- }
-
- public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
- {
- BinnieCore.proxy.openGui(BinnieCoreGUI.Genesis, player, (int)player.posX, (int)player.posY, (int)player.posZ);
-
- return itemstack;
- }
-
- public String getItemStackDisplayName(ItemStack i)
- {
- return "Genesis";
- }
-}
diff --git a/src/Java/binnie/core/item/ItemMisc.java b/src/Java/binnie/core/item/ItemMisc.java
deleted file mode 100644
index db54b2c1dd..0000000000
--- a/src/Java/binnie/core/item/ItemMisc.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package binnie.core.item;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.List;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-public class ItemMisc
- extends Item
-{
- private IItemMisc[] items;
-
- protected ItemMisc(CreativeTabs tab, IItemMisc[] items2)
- {
- setCreativeTab(tab);
- setHasSubtypes(true);
- setUnlocalizedName("misc");
- this.items = items2;
- }
-
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List)
- {
- for (IItemMisc item : this.items) {
- if (item.isActive()) {
- par3List.add(getStack(item, 1));
- }
- }
- }
-
- private IItemMisc getItem(int damage)
- {
- return damage >= this.items.length ? this.items[0] : this.items[damage];
- }
-
- public ItemStack getStack(IItemMisc type, int size)
- {
- return new ItemStack(this, size, type.ordinal());
- }
-
- @SideOnly(Side.CLIENT)
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
- {
- super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
- IItemMisc item = getItem(par1ItemStack.getItemDamage());
- if (item != null) {
- item.addInformation(par3List);
- }
- }
-
- public String getItemStackDisplayName(ItemStack stack)
- {
- IItemMisc item = getItem(stack.getItemDamage());
- return item != null ? item.getName(stack) : "null";
- }
-
- public IIcon getIcon(ItemStack stack, int pass)
- {
- IItemMisc item = getItem(stack.getItemDamage());
- return item != null ? item.getIcon(stack) : null;
- }
-
- public IIcon getIconFromDamage(int damage)
- {
- IItemMisc item = getItem(damage);
- return item != null ? item.getIcon(null) : null;
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister register)
- {
- for (IItemMisc item : this.items) {
- item.registerIcons(register);
- }
- }
-}
diff --git a/src/Java/binnie/core/item/ManagerItem.java b/src/Java/binnie/core/item/ManagerItem.java
deleted file mode 100644
index 39ea70f826..0000000000
--- a/src/Java/binnie/core/item/ManagerItem.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package binnie.core.item;
-
-import net.minecraft.creativetab.CreativeTabs;
-
-public class ManagerItem
-{
- public ItemMisc registerMiscItems(IItemMisc[] items, CreativeTabs tab)
- {
- return new ItemMisc(tab, items);
- }
-}
diff --git a/src/Java/binnie/core/language/ManagerLanguage.java b/src/Java/binnie/core/language/ManagerLanguage.java
deleted file mode 100644
index b4deb37344..0000000000
--- a/src/Java/binnie/core/language/ManagerLanguage.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package binnie.core.language;
-
-import binnie.core.AbstractMod;
-import binnie.core.ManagerBase;
-import java.util.HashMap;
-import java.util.Map;
-import net.minecraft.util.StatCollector;
-
-public class ManagerLanguage
- extends ManagerBase
-{
- private Map<Object, String> objNames = new HashMap();
-
- public void addObjectName(Object obj, String name)
- {
- this.objNames.put(obj, name);
- }
-
- public String unlocalised(AbstractMod mod, String id)
- {
- return mod.getModID() + "." + id;
- }
-
- public String localise(Object key)
- {
- String loc = StatCollector.translateToLocal(key.toString());
- if (loc.equals(key.toString())) {
- return this.objNames.containsKey(key) ? localise(this.objNames.get(key)) : key.toString();
- }
- return loc;
- }
-
- public String localise(AbstractMod mod, String id)
- {
- return localise(unlocalised(mod, id));
- }
-
- public String localiseOrBlank(AbstractMod mod, String id)
- {
- return localiseOrBlank(unlocalised(mod, id));
- }
-
- public String localise(AbstractMod mod, String id, Object... objs)
- {
- return String.format(localise(mod, id), objs);
- }
-
- public String localiseOrBlank(Object key)
- {
- String trans = localise(key);
- return trans.equals(key) ? "" : trans;
- }
-
- public boolean canLocalise(Object key)
- {
- String trans = localise(key);
- return !trans.equals(key);
- }
-}
diff --git a/src/Java/binnie/core/machines/BlockMachine.java b/src/Java/binnie/core/machines/BlockMachine.java
deleted file mode 100644
index e2ad883207..0000000000
--- a/src/Java/binnie/core/machines/BlockMachine.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package binnie.core.machines;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import binnie.Binnie;
-import binnie.core.BinnieCore;
-import binnie.core.machines.component.IRender;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
-class BlockMachine
- extends BlockContainer
- implements IBlockMachine
-{
- private MachineGroup group;
-
- public BlockMachine(MachineGroup group, String blockName)
- {
- super(Material.iron);
- this.group = group;
- setHardness(1.5F);
- setBlockName(blockName);
- }
-
- public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List itemList)
- {
- for (MachinePackage pack : this.group.getPackages()) {
- if (pack.isActive()) {
- itemList.add(new ItemStack(this, 1, pack.getMetadata().intValue()));
- }
- }
- }
-
- public boolean isOpaqueCube()
- {
- return false;
- }
-
- public boolean renderAsNormalBlock()
- {
- return !this.group.customRenderer;
- }
-
- public int getRenderType()
- {
- return Binnie.Machine.getMachineRenderID();
- }
-
- public TileEntity createTileEntity(World world, int metadata)
- {
- if (this.group.getPackage(metadata) == null) {
- return null;
- }
- return this.group.getPackage(metadata).createTileEntity();
- }
-
- public MachinePackage getPackage(int meta)
- {
- return this.group.getPackage(meta);
- }
-
- public String getMachineName(int meta)
- {
- return getPackage(meta) == null ? "Unnamed Machine" : getPackage(meta).getDisplayName();
- }
-
- public int damageDropped(int par1)
- {
- return par1;
- }
-
- public TileEntity createNewTileEntity(World var1, int meta)
- {
- return createTileEntity(var1, meta);
- }
-
- public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
- {
- if (!BinnieCore.proxy.isSimulating(world)) {
- return true;
- }
- if (player.isSneaking()) {
- return true;
- }
- TileEntity entity = world.getTileEntity(x, y, z);
- if ((entity instanceof TileEntityMachine)) {
- ((TileEntityMachine)entity).getMachine().onRightClick(world, player, x, y, z);
- }
- return true;
- }
-
- public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack)
- {
- super.onBlockPlacedBy(world, i, j, k, entityliving, stack);
- if (!BinnieCore.proxy.isSimulating(world)) {
- return;
- }
- IMachine machine = Machine.getMachine(world.getTileEntity(i, j, k));
- if (machine == null) {
- return;
- }
- if ((entityliving instanceof EntityPlayer)) {
- machine.setOwner(((EntityPlayer)entityliving).getGameProfile());
- }
- }
-
- public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
- {
- TileEntity entity = world.getTileEntity(x, y, z);
- if (((entity instanceof TileEntityMachine)) && (((TileEntityMachine)entity).getMachine().hasInterface(IMachineTexturedFaces.class))) {
- return ((IMachineTexturedFaces)((TileEntityMachine)entity).getMachine().getInterface(IMachineTexturedFaces.class)).getIcon(side);
- }
- return Blocks.dirt.getIcon(0, 0);
- }
-
- public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
- {
- TileEntity tileentity = world.getTileEntity(x, y, z);
- if (!(tileentity instanceof TileEntityMachine)) {
- return;
- }
- TileEntityMachine entity = (TileEntityMachine)tileentity;
- if (entity != null) {
- entity.onBlockDestroy();
- }
- super.breakBlock(world, x, y, z, par5, par6);
- }
-
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister register) {}
-
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(World world, int x, int y, int z, Random rand)
- {
- IMachine machine = Machine.getMachine(world.getTileEntity(x, y, z));
- if (machine != null) {
- for (IRender.RandomDisplayTick renders : machine.getInterfaces(IRender.RandomDisplayTick.class)) {
- renders.onRandomDisplayTick(world, x, y, z, rand);
- }
- }
- }
-
- public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
- {
- return new ArrayList();
- }
-
- public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest)
- {
- if ((BinnieCore.proxy.isSimulating(world)) && (canHarvestBlock(player, world.getBlockMetadata(x, y, z))) &&
- (!player.capabilities.isCreativeMode))
- {
- int metadata = world.getBlockMetadata(x, y, z);
- ItemStack stack = new ItemStack(Item.getItemFromBlock(this), 1, damageDropped(metadata));
- dropBlockAsItem(world, x, y, z, stack);
- }
- return world.setBlockToAir(x, y, z);
- }
-
- public static abstract interface IMachineTexturedFaces
- {
- public abstract IIcon getIcon(int paramInt);
- }
-}
diff --git a/src/Java/binnie/core/machines/IBlockMachine.java b/src/Java/binnie/core/machines/IBlockMachine.java
deleted file mode 100644
index 01b7e321a1..0000000000
--- a/src/Java/binnie/core/machines/IBlockMachine.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.core.machines;
-
-abstract interface IBlockMachine
-{
- public abstract MachinePackage getPackage(int paramInt);
-
- public abstract String getMachineName(int paramInt);
-}
diff --git a/src/Java/binnie/core/machines/IMachine.java b/src/Java/binnie/core/machines/IMachine.java
deleted file mode 100644
index 9a57b0e019..0000000000
--- a/src/Java/binnie/core/machines/IMachine.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package binnie.core.machines;
-
-import java.util.Collection;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public abstract interface IMachine
- extends IOwnable
-{
- public abstract void addComponent(MachineComponent paramMachineComponent);
-
- public abstract MachineUtil getMachineUtil();
-
- public abstract <T> T getInterface(Class<T> paramClass);
-
- public abstract void markDirty();
-
- public abstract World getWorld();
-
- public abstract TileEntity getTileEntity();
-
- public abstract <T> Collection<T> getInterfaces(Class<T> paramClass);
-
- public abstract MachinePackage getPackage();
-}
diff --git a/src/Java/binnie/core/machines/IMachineType.java b/src/Java/binnie/core/machines/IMachineType.java
deleted file mode 100644
index 06c02218a0..0000000000
--- a/src/Java/binnie/core/machines/IMachineType.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package binnie.core.machines;
-
-import binnie.core.network.IOrdinaled;
-
-public abstract interface IMachineType
- extends IOrdinaled
-{
- public abstract Class<? extends MachinePackage> getPackageClass();
-
- public abstract boolean isActive();
-}
diff --git a/src/Java/binnie/core/machines/IOwnable.java b/src/Java/binnie/core/machines/IOwnable.java
deleted file mode 100644
index 78aa1a76f9..0000000000
--- a/src/Java/binnie/core/machines/IOwnable.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package binnie.core.machines;
-
-import com.mojang.authlib.GameProfile;
-
-abstract interface IOwnable
-{
- public abstract GameProfile getOwner();
-
- public abstract void setOwner(GameProfile paramGameProfile);
-}
diff --git a/src/Java/binnie/core/machines/ItemMachine.java b/src/Java/binnie/core/machines/ItemMachine.java
deleted file mode 100644
index 08426cdb7a..0000000000
--- a/src/Java/binnie/core/machines/ItemMachine.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package binnie.core.machines;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-
-public class ItemMachine
- extends ItemBlock
-{
- private IBlockMachine associatedBlock;
-
- public ItemMachine(Block block)
- {
- super(block);
- setMaxDamage(0);
- setHasSubtypes(true);
- this.associatedBlock = ((IBlockMachine)block);
- }
-
- public int getMetadata(int i)
- {
- return i;
- }
-
- public String getItemStackDisplayName(ItemStack itemstack)
- {
- return this.associatedBlock.getMachineName(itemstack.getItemDamage());
- }
-}
diff --git a/src/Java/binnie/core/machines/Machine.java b/src/Java/binnie/core/machines/Machine.java
deleted file mode 100644
index 70dc65c485..0000000000
--- a/src/Java/binnie/core/machines/Machine.java
+++ /dev/null
@@ -1,318 +0,0 @@
-package binnie.core.machines;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTUtil;
-import net.minecraft.network.Packet;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import binnie.core.BinnieCore;
-import binnie.core.machines.component.IInteraction;
-import binnie.core.machines.component.IRender;
-import binnie.core.machines.network.INetwork;
-import binnie.core.machines.power.ITankMachine;
-import binnie.core.network.BinnieCorePacketID;
-import binnie.core.network.INetworkedEntity;
-import binnie.core.network.packet.MessageTileNBT;
-import binnie.core.network.packet.PacketPayload;
-
-import com.mojang.authlib.GameProfile;
-
-import cpw.mods.fml.relauncher.Side;
-import forestry.api.core.INBTTagable;
-
-public class Machine
- implements INetworkedEntity, INBTTagable, INetwork.TilePacketSync, IMachine, INetwork.GuiNBT
-{
- private MachinePackage machinePackage;
- private Map<Class, List<MachineComponent>> componentInterfaceMap = new LinkedHashMap();
- private Map<Class<? extends MachineComponent>, MachineComponent> componentMap = new LinkedHashMap();
- private TileEntity tile;
-
- public Machine(MachinePackage pack, TileEntity tile)
- {
- this.tile = tile;
-
- pack.createMachine(this);
- this.machinePackage = pack;
- }
-
- public void addComponent(MachineComponent component)
- {
- if (component == null) {
- throw new NullPointerException("Can't have a null machine component!");
- }
- component.setMachine(this);
- this.componentMap.put(component.getClass(), component);
- for (Class inter : component.getComponentInterfaces())
- {
- if (!this.componentInterfaceMap.containsKey(inter)) {
- this.componentInterfaceMap.put(inter, new ArrayList());
- }
- ((List)this.componentInterfaceMap.get(inter)).add(component);
- }
- }
-
- public Collection<MachineComponent> getComponents()
- {
- return this.componentMap.values();
- }
-
- public <T extends MachineComponent> MachineComponent getComponent(Class<T> componentClass)
- {
- return hasComponent(componentClass) ? (MachineComponent)componentClass.cast(this.componentMap.get(componentClass)) : null;
- }
-
- public <T> T getInterface(Class<T> interfaceClass)
- {
- if (hasInterface(interfaceClass)) {
- return getInterfaces(interfaceClass).get(0);
- }
- if (interfaceClass.isInstance(getPackage())) {
- return interfaceClass.cast(getPackage());
- }
- for (MachineComponent component : getComponents()) {
- if (interfaceClass.isInstance(component)) {
- return interfaceClass.cast(component);
- }
- }
- return null;
- }
-
- public <T> List<T> getInterfaces(Class<T> interfaceClass)
- {
- ArrayList<T> interfaces = new ArrayList();
- if (!hasInterface(interfaceClass)) {
- return interfaces;
- }
- for (MachineComponent component : (List)this.componentInterfaceMap.get(interfaceClass)) {
- interfaces.add(interfaceClass.cast(component));
- }
- return interfaces;
- }
-
- public boolean hasInterface(Class<?> interfaceClass)
- {
- return this.componentInterfaceMap.containsKey(interfaceClass);
- }
-
- public boolean hasComponent(Class<? extends MachineComponent> componentClass)
- {
- return this.componentMap.containsKey(componentClass);
- }
-
- public TileEntity getTileEntity()
- {
- return this.tile;
- }
-
- public void sendPacket()
- {
- if (!BinnieCore.proxy.isSimulating(getTileEntity().getWorldObj())) {
- return;
- }
- BinnieCore.proxy.sendNetworkEntityPacket((INetworkedEntity)getTileEntity());
- }
-
- public Side getSide()
- {
- return BinnieCore.proxy.isSimulating(getTileEntity().getWorldObj()) ? Side.SERVER : Side.CLIENT;
- }
-
- public void writeToPacket(PacketPayload payload)
- {
- for (MachineComponent component : getComponents()) {
- if ((component instanceof INetworkedEntity)) {
- ((INetworkedEntity)component).writeToPacket(payload);
- }
- }
- }
-
- public void readFromPacket(PacketPayload payload)
- {
- for (MachineComponent component : getComponents()) {
- if ((component instanceof INetworkedEntity)) {
- ((INetworkedEntity)component).readFromPacket(payload);
- }
- }
- }
-
- public void onRightClick(World world, EntityPlayer player, int x, int y, int z)
- {
- for (IInteraction.RightClick component : getInterfaces(IInteraction.RightClick.class)) {
- component.onRightClick(world, player, x, y, z);
- }
- }
-
- public void markDirty()
- {
- this.queuedInventoryUpdate = true;
- }
-
- private boolean queuedInventoryUpdate = false;
-
- public void onUpdate()
- {
- if (BinnieCore.proxy.isSimulating(getWorld())) {
- for (MachineComponent component : getComponents()) {
- component.onUpdate();
- }
- } else {
- for (IRender.DisplayTick renders : getInterfaces(IRender.DisplayTick.class)) {
- renders.onDisplayTick(getWorld(), getTileEntity().xCoord, getTileEntity().yCoord, getTileEntity().zCoord, getWorld().rand);
- }
- }
- if (this.queuedInventoryUpdate)
- {
- for (MachineComponent component : getComponents()) {
- component.onInventoryUpdate();
- }
- this.queuedInventoryUpdate = false;
- }
- }
-
- public IInventory getInventory()
- {
- return (IInventory)getInterface(IInventory.class);
- }
-
- public ITankMachine getTankContainer()
- {
- return (ITankMachine)getInterface(ITankMachine.class);
- }
-
- public void readFromNBT(NBTTagCompound nbttagcompound)
- {
- for (MachineComponent component : getComponents()) {
- component.readFromNBT(nbttagcompound);
- }
- this.owner = NBTUtil.func_152459_a(nbttagcompound.getCompoundTag("owner"));
- markDirty();
- }
-
- public void writeToNBT(NBTTagCompound nbttagcompound)
- {
- for (MachineComponent component : getComponents()) {
- component.writeToNBT(nbttagcompound);
- }
- if (this.owner != null)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- NBTUtil.func_152460_a(nbt, this.owner);
- nbttagcompound.setTag("owner", nbt);
- }
- }
-
- public MachinePackage getPackage()
- {
- return this.machinePackage;
- }
-
- public static IMachine getMachine(Object inventory)
- {
- if ((inventory != null) && ((inventory instanceof IMachine))) {
- return (IMachine)inventory;
- }
- if ((inventory != null) && ((inventory instanceof TileEntityMachine))) {
- return ((TileEntityMachine)inventory).getMachine();
- }
- if ((inventory != null) && ((inventory instanceof MachineComponent))) {
- return ((MachineComponent)inventory).getMachine();
- }
- return null;
- }
-
- public static <T> T getInterface(Class<T> interfac, Object inventory)
- {
- IMachine machine = getMachine(inventory);
- if (machine != null) {
- return machine.getInterface(interfac);
- }
- if (interfac.isInstance(inventory)) {
- return interfac.cast(inventory);
- }
- return null;
- }
-
- public MachineUtil getMachineUtil()
- {
- return new MachineUtil(this);
- }
-
- public World getWorld()
- {
- return getTileEntity().getWorldObj();
- }
-
- public void onBlockDestroy()
- {
- for (MachineComponent component : getComponents()) {
- component.onDestruction();
- }
- }
-
- private int nextProgressBarID = 0;
-
- public int getUniqueProgressBarID()
- {
- return this.nextProgressBarID++;
- }
-
- private GameProfile owner = null;
-
- public GameProfile getOwner()
- {
- return this.owner;
- }
-
- public void setOwner(GameProfile owner)
- {
- this.owner = owner;
- }
-
- public Packet getDescriptionPacket()
- {
- NBTTagCompound nbt = new NBTTagCompound();
-
- syncToNBT(nbt);
- if (nbt.hasNoTags()) {
- return null;
- }
- return BinnieCore.instance.getNetworkWrapper().getPacketFrom(new MessageTileNBT(BinnieCorePacketID.TileDescriptionSync.ordinal(), getTileEntity(), nbt).GetMessage());
- }
-
- public void syncToNBT(NBTTagCompound nbt)
- {
- for (INetwork.TilePacketSync comp : getInterfaces(INetwork.TilePacketSync.class)) {
- comp.syncToNBT(nbt);
- }
- }
-
- public void syncFromNBT(NBTTagCompound nbt)
- {
- for (INetwork.TilePacketSync comp : getInterfaces(INetwork.TilePacketSync.class)) {
- comp.syncFromNBT(nbt);
- }
- }
-
- public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound nbt)
- {
- for (INetwork.RecieveGuiNBT recieve : getInterfaces(INetwork.RecieveGuiNBT.class)) {
- recieve.recieveGuiNBT(side, player, name, nbt);
- }
- }
-
- public void sendGuiNBT(Map<String, NBTTagCompound> nbt)
- {
- for (INetwork.SendGuiNBT recieve : getInterfaces(INetwork.SendGuiNBT.class)) {
- recieve.sendGuiNBT(nbt);
- }
- }
-}
diff --git a/src/Java/binnie/core/machines/MachineComponent.java b/src/Java/binnie/core/machines/MachineComponent.java
deleted file mode 100644
index 3b90497fc3..0000000000
--- a/src/Java/binnie/core/machines/MachineComponent.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package binnie.core.machines;
-
-import binnie.Binnie;
-import binnie.core.network.packet.MachinePayload;
-import forestry.api.core.INBTTagable;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class MachineComponent
- implements INBTTagable
-{
- private IMachine machine;
-
- public MachineComponent(IMachine machine)
- {
- setMachine(machine);
- machine.addComponent(this);
- }
-
- public void setMachine(IMachine machine)
- {
- this.machine = machine;
- }
-
- public IMachine getMachine()
- {
- return this.machine;
- }
-
- public void readFromNBT(NBTTagCompound nbttagcompound) {}
-
- public void writeToNBT(NBTTagCompound nbttagcompound) {}
-
- public void onUpdate() {}
-
- public Class[] getComponentInterfaces()
- {
- return Binnie.Machine.getComponentInterfaces(getClass());
- }
-
- public void onInventoryUpdate() {}
-
- public final MachinePayload getPayload()
- {
- return new MachinePayload(Binnie.Machine.getNetworkID(getClass()));
- }
-
- public void recieveData(MachinePayload payload) {}
-
- public MachineUtil getUtil()
- {
- return getMachine().getMachineUtil();
- }
-
- public void onDestruction() {}
-
- public IInventory getInventory()
- {
- return (IInventory)getMachine().getInterface(IInventory.class);
- }
-}
diff --git a/src/Java/binnie/core/machines/MachineGroup.java b/src/Java/binnie/core/machines/MachineGroup.java
deleted file mode 100644
index 03984f1f10..0000000000
--- a/src/Java/binnie/core/machines/MachineGroup.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package binnie.core.machines;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import cpw.mods.fml.common.registry.GameRegistry;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import net.minecraft.creativetab.CreativeTabs;
-
-public class MachineGroup
-{
- private AbstractMod mod;
- private String blockName;
- private String uid;
-
- public MachineGroup(AbstractMod mod, String uid, String blockName, IMachineType[] types)
- {
- this.mod = mod;
- this.uid = uid;
- this.blockName = blockName;
- for (IMachineType type : types) {
- if ((type.getPackageClass() != null) && (type.isActive())) {
- try
- {
- MachinePackage pack = (MachinePackage)type.getPackageClass().newInstance();
- pack.assignMetadata(type.ordinal());
- pack.setActive(type.isActive());
- addPackage(pack);
- }
- catch (Exception e)
- {
- throw new RuntimeException("Failed to create machine package " + type.toString(), e);
- }
- }
- }
- Binnie.Machine.registerMachineGroup(this);
-
- this.block = new BlockMachine(this, blockName);
- if (this.block != null)
- {
- GameRegistry.registerBlock(this.block, ItemMachine.class, blockName);
- for (MachinePackage pack : getPackages()) {
- pack.register();
- }
- }
- }
-
- private Map<String, MachinePackage> packages = new LinkedHashMap();
- private Map<Integer, MachinePackage> packagesID = new LinkedHashMap();
- private BlockMachine block;
-
- private void addPackage(MachinePackage pack)
- {
- this.packages.put(pack.getUID(), pack);
- this.packagesID.put(pack.getMetadata(), pack);
- pack.setGroup(this);
- }
-
- public Collection<MachinePackage> getPackages()
- {
- return this.packages.values();
- }
-
- public boolean customRenderer = true;
-
- public BlockMachine getBlock()
- {
- return this.block;
- }
-
- public MachinePackage getPackage(int metadata)
- {
- return (MachinePackage)this.packagesID.get(Integer.valueOf(metadata));
- }
-
- public MachinePackage getPackage(String name)
- {
- return (MachinePackage)this.packages.get(name);
- }
-
- public String getUID()
- {
- return this.mod.getModID() + "." + this.uid;
- }
-
- public String getShortUID()
- {
- return this.uid;
- }
-
- private boolean renderedTileEntity = true;
-
- boolean isTileEntityRenderered()
- {
- return this.renderedTileEntity;
- }
-
- public void renderAsBlock()
- {
- this.renderedTileEntity = false;
- }
-
- public void setCreativeTab(CreativeTabs tab)
- {
- this.block.setCreativeTab(tab);
- }
-
- public AbstractMod getMod()
- {
- return this.mod;
- }
-}
diff --git a/src/Java/binnie/core/machines/MachinePackage.java b/src/Java/binnie/core/machines/MachinePackage.java
deleted file mode 100644
index 943db084b6..0000000000
--- a/src/Java/binnie/core/machines/MachinePackage.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package binnie.core.machines;
-
-import binnie.Binnie;
-import binnie.core.language.ManagerLanguage;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.tileentity.TileEntity;
-
-public abstract class MachinePackage
-{
- private String uid;
- private boolean active = true;
- boolean powered = false;
- private int metadata = -1;
- private MachineGroup group;
-
- public String getUID()
- {
- return this.uid;
- }
-
- protected MachinePackage(String uid, boolean powered)
- {
- this.uid = uid;
- this.powered = powered;
- }
-
- public abstract void createMachine(Machine paramMachine);
-
- public abstract TileEntity createTileEntity();
-
- public abstract void register();
-
- public final String getDisplayName()
- {
- return Binnie.Language.localise(this.group.getMod(), "machine." + this.group.getShortUID() + "." + getUID());
- }
-
- public final Integer getMetadata()
- {
- return Integer.valueOf(this.metadata);
- }
-
- public void assignMetadata(int meta)
- {
- this.metadata = meta;
- }
-
- public MachineGroup getGroup()
- {
- return this.group;
- }
-
- public void setGroup(MachineGroup group)
- {
- this.group = group;
- }
-
- public abstract void renderMachine(Machine paramMachine, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat, RenderBlocks paramRenderBlocks);
-
- public boolean isActive()
- {
- return this.active;
- }
-
- public void setActive(boolean active)
- {
- this.active = active;
- }
-
- public final String getInformation()
- {
- return Binnie.Language.localise(this.group.getMod(), "machine." + this.group.getShortUID() + "." + getUID() + ".info");
- }
-}
diff --git a/src/Java/binnie/core/machines/MachineRendererBlock.java b/src/Java/binnie/core/machines/MachineRendererBlock.java
deleted file mode 100644
index 9506746df4..0000000000
--- a/src/Java/binnie/core/machines/MachineRendererBlock.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package binnie.core.machines;
-
-import binnie.core.BinnieCore;
-import binnie.core.proxy.BinnieProxy;
-import binnie.core.resource.BinnieResource;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import org.lwjgl.opengl.GL11;
-
-@SideOnly(Side.CLIENT)
-public class MachineRendererBlock
-{
- public static MachineRendererBlock instance = new MachineRendererBlock();
- private BinnieResource texture;
- private ModelBlock model;
-
- public MachineRendererBlock()
- {
- this.model = new ModelBlock();
- }
-
- public void renderMachine(BinnieResource texture, double x, double y, double z, float var8)
- {
- this.texture = texture;
-
- GL11.glPushMatrix();
-
- GL11.glTranslated(x + 0.5D, y + 1.5D, z + 0.5D);
- GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
-
- BinnieCore.proxy.bindTexture(texture);
-
- GL11.glPushMatrix();
-
- this.model.render((float)x, (float)y, (float)z, 0.0625F, 0.0625F, 0.0625F);
-
- GL11.glPopMatrix();
-
- GL11.glPopMatrix();
- }
-}
diff --git a/src/Java/binnie/core/machines/MachineUtil.java b/src/Java/binnie/core/machines/MachineUtil.java
deleted file mode 100644
index 97ff515061..0000000000
--- a/src/Java/binnie/core/machines/MachineUtil.java
+++ /dev/null
@@ -1,216 +0,0 @@
-package binnie.core.machines;
-
-import binnie.core.BinnieCore;
-import binnie.core.machines.inventory.IChargedSlots;
-import binnie.core.machines.power.IPoweredMachine;
-import binnie.core.machines.power.IProcess;
-import binnie.core.machines.power.ITankMachine;
-import binnie.core.machines.power.PowerInterface;
-import binnie.core.machines.power.PowerSystem;
-import binnie.core.proxy.BinnieProxy;
-import binnie.core.util.ItemStackSet;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidTank;
-
-public class MachineUtil
-{
- private IMachine machine;
-
- public MachineUtil(IMachine machine)
- {
- this.machine = machine;
- }
-
- public IInventory getInventory()
- {
- return (IInventory)this.machine.getInterface(IInventory.class);
- }
-
- public ITankMachine getTankContainer()
- {
- return (ITankMachine)this.machine.getInterface(ITankMachine.class);
- }
-
- public IPoweredMachine getPoweredMachine()
- {
- return (IPoweredMachine)this.machine.getInterface(IPoweredMachine.class);
- }
-
- public boolean isSlotEmpty(int slot)
- {
- return getInventory().getStackInSlot(slot) == null;
- }
-
- public IFluidTank getTank(int id)
- {
- return getTankContainer().getTanks()[id];
- }
-
- public boolean spaceInTank(int id, int amount)
- {
- IFluidTank tank = getTank(id);
- int space = tank.getCapacity() - tank.getFluidAmount();
- return amount <= space;
- }
-
- public ItemStack getStack(int slot)
- {
- return getInventory().getStackInSlot(slot);
- }
-
- public void deleteStack(int slot)
- {
- setStack(slot, null);
- }
-
- public ItemStack decreaseStack(int slotWood, int amount)
- {
- return getInventory().decrStackSize(slotWood, amount);
- }
-
- public void setStack(int slot, ItemStack stack)
- {
- getInventory().setInventorySlotContents(slot, stack);
- }
-
- public void fillTank(int id, FluidStack liquidStack)
- {
- IFluidTank tank = getTank(id);
- tank.fill(liquidStack, true);
- }
-
- public void addStack(int slot, ItemStack addition)
- {
- if (isSlotEmpty(slot))
- {
- setStack(slot, addition);
- }
- else
- {
- ItemStack merge = getStack(slot);
- if ((merge.isItemEqual(addition)) && (merge.stackSize + addition.stackSize <= merge.getMaxStackSize()))
- {
- merge.stackSize += addition.stackSize;
- setStack(slot, merge);
- }
- }
- }
-
- public FluidStack drainTank(int tank, int amount)
- {
- return getTank(tank).drain(amount, true);
- }
-
- public boolean liquidInTank(int tank, int amount)
- {
- return (getTank(tank).drain(amount, false) != null) && (getTank(tank).drain(amount, false).amount == amount);
- }
-
- public void damageItem(int slot, int damage)
- {
- ItemStack item = getStack(slot);
- if (damage < 0) {
- item.setItemDamage(Math.max(0, item.getItemDamage() + damage));
- } else if (item.attemptDamageItem(damage, new Random())) {
- setStack(slot, null);
- }
- setStack(slot, item);
- }
-
- public boolean isTankEmpty(int tankInput)
- {
- return getTank(tankInput).getFluidAmount() == 0;
- }
-
- public FluidStack getFluid(int tankInput)
- {
- return getTank(tankInput).getFluid() == null ? null : getTank(tankInput).getFluid();
- }
-
- public ItemStack[] getStacks(int[] slotGrains)
- {
- ItemStack[] stacks = new ItemStack[slotGrains.length];
- for (int i = 0; i < slotGrains.length; i++) {
- stacks[i] = getStack(slotGrains[i]);
- }
- return stacks;
- }
-
- public ItemStack hasIngredients(int recipe, int[] inventory)
- {
- return null;
- }
-
- public boolean hasIngredients(int[] recipe, int[] inventory)
- {
- ItemStackSet requiredStacks = new ItemStackSet();
- for (ItemStack stack : getStacks(recipe)) {
- requiredStacks.add(stack);
- }
- ItemStackSet inventoryStacks = new ItemStackSet();
- for (ItemStack stack : getStacks(inventory)) {
- inventoryStacks.add(stack);
- }
- requiredStacks.removeAll(inventoryStacks);
-
- return requiredStacks.isEmpty();
- }
-
- public void useEnergyMJ(float powerUsage)
- {
- getPoweredMachine().getInterface().useEnergy(PowerSystem.MJ, powerUsage, true);
- }
-
- public boolean hasEnergyMJ(float powerUsage)
- {
- return getPoweredMachine().getInterface().useEnergy(PowerSystem.MJ, powerUsage, false) >= powerUsage;
- }
-
- public float getSlotCharge(int slot)
- {
- return ((IChargedSlots)this.machine.getInterface(IChargedSlots.class)).getCharge(slot);
- }
-
- public void useCharge(int slot, float loss)
- {
- ((IChargedSlots)this.machine.getInterface(IChargedSlots.class)).alterCharge(slot, -loss);
- }
-
- public Random getRandom()
- {
- return new Random();
- }
-
- public void refreshBlock()
- {
- this.machine.getWorld().markBlockForUpdate(this.machine.getTileEntity().xCoord, this.machine.getTileEntity().yCoord, this.machine.getTileEntity().zCoord);
- }
-
- public IProcess getProcess()
- {
- return (IProcess)this.machine.getInterface(IProcess.class);
- }
-
- public List<ItemStack> getNonNullStacks(int[] slotacclimatiser)
- {
- List<ItemStack> stacks = new ArrayList();
- for (ItemStack stack : getStacks(slotacclimatiser)) {
- if (stack != null) {
- stacks.add(stack);
- }
- }
- return stacks;
- }
-
- public boolean isServer()
- {
- return BinnieCore.proxy.isSimulating(this.machine.getWorld());
- }
-}
diff --git a/src/Java/binnie/core/machines/ManagerMachine.java b/src/Java/binnie/core/machines/ManagerMachine.java
deleted file mode 100644
index 53920e5496..0000000000
--- a/src/Java/binnie/core/machines/ManagerMachine.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package binnie.core.machines;
-
-import binnie.core.BinnieCore;
-import binnie.core.ManagerBase;
-import binnie.core.machines.inventory.ValidatorIcon;
-import binnie.core.proxy.BinnieProxy;
-import forestry.api.core.INBTTagable;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-public class ManagerMachine
- extends ManagerBase
-{
- private Map<Class<?>, Class<?>[]> componentInterfaceMap = new HashMap();
- private Map<String, MachineGroup> machineGroups = new HashMap();
- private Map<Integer, Class<?>> networkIDToComponent = new HashMap();
- private Map<Class<?>, Integer> componentToNetworkID = new HashMap();
- private int nextNetworkID = 0;
- private int machineRenderID;
-
- public void registerMachineGroup(MachineGroup group)
- {
- this.machineGroups.put(group.getUID(), group);
- }
-
- public MachineGroup getGroup(String name)
- {
- return (MachineGroup)this.machineGroups.get(name);
- }
-
- public MachinePackage getPackage(String group, String name)
- {
- MachineGroup machineGroup = getGroup(group);
- return machineGroup == null ? null : machineGroup.getPackage(name);
- }
-
- private void registerComponentClass(Class<? extends MachineComponent> component)
- {
- if (this.componentInterfaceMap.containsKey(component)) {
- return;
- }
- Set<Class<?>> interfaces = new HashSet();
-
- Class<?> currentClass = component;
- while (currentClass != null)
- {
- for (Class<?> clss : currentClass.getInterfaces()) {
- interfaces.add(clss);
- }
- currentClass = currentClass.getSuperclass();
- if (currentClass == Object.class) {
- currentClass = null;
- }
- }
- interfaces.remove(INBTTagable.class);
-
- this.componentInterfaceMap.put(component, interfaces.toArray(new Class[0]));
-
- int networkID = this.nextNetworkID++;
-
- this.networkIDToComponent.put(Integer.valueOf(networkID), component);
- this.componentToNetworkID.put(component, Integer.valueOf(networkID));
- }
-
- public int getNetworkID(Class<?> component)
- {
- return ((Integer)this.componentToNetworkID.get(component)).intValue();
- }
-
- public Class<?> getComponentClass(int networkID)
- {
- return (Class)this.networkIDToComponent.get(Integer.valueOf(networkID));
- }
-
- public int getMachineRenderID()
- {
- return this.machineRenderID;
- }
-
- public void init()
- {
- this.machineRenderID = BinnieCore.proxy.getUniqueRenderID();
-
- binnie.core.machines.inventory.SlotValidator.IconBee = new ValidatorIcon(BinnieCore.instance, "validator/bee.0", "validator/bee.1");
-
- binnie.core.machines.inventory.SlotValidator.IconFrame = new ValidatorIcon(BinnieCore.instance, "validator/frame.0", "validator/frame.1");
-
- binnie.core.machines.inventory.SlotValidator.IconCircuit = new ValidatorIcon(BinnieCore.instance, "validator/circuit.0", "validator/circuit.1");
-
- binnie.core.machines.inventory.SlotValidator.IconBlock = new ValidatorIcon(BinnieCore.instance, "validator/block.0", "validator/block.1");
- }
-
- public void postInit()
- {
- BinnieCore.proxy.registerBlockRenderer(BinnieCore.proxy.createObject("binnie.core.machines.RendererMachine"));
- BinnieCore.proxy.registerTileEntity(TileEntityMachine.class, "binnie.tile.machine", BinnieCore.proxy.createObject("binnie.core.machines.RendererMachine"));
- }
-
- public Class<?>[] getComponentInterfaces(Class<? extends MachineComponent> clss)
- {
- if (!this.componentInterfaceMap.containsKey(clss)) {
- registerComponentClass(clss);
- }
- return (Class[])this.componentInterfaceMap.get(clss);
- }
-}
diff --git a/src/Java/binnie/core/machines/ModelBlock.java b/src/Java/binnie/core/machines/ModelBlock.java
deleted file mode 100644
index 7258ec8654..0000000000
--- a/src/Java/binnie/core/machines/ModelBlock.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package binnie.core.machines;
-
-import net.minecraft.client.model.ModelBase;
-import net.minecraft.client.model.ModelRenderer;
-
-class ModelBlock
- extends ModelBase
-{
- private ModelRenderer Block;
-
- public ModelBlock()
- {
- this.textureWidth = 64;
- this.textureHeight = 32;
-
- this.Block = new ModelRenderer(this, 0, 0);
- this.Block.addBox(0.0F, 0.0F, 0.0F, 16, 16, 16);
- this.Block.setRotationPoint(-8.0F, 8.0F, -8.0F);
- this.Block.setTextureSize(64, 32);
- this.Block.mirror = true;
- setRotation(this.Block, 0.0F, 0.0F, 0.0F);
- }
-
- public void render(float f, float f1, float f2, float f3, float f4, float f5)
- {
- super.render(null, f, f1, f2, f3, f4, f5);
- setRotationAngles(f, f1, f2, f3, f4, f5);
- this.Block.render(f5);
- }
-
- private void setRotation(ModelRenderer model, float x, float y, float z)
- {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
-
- public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
- {
- super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
- }
-}
diff --git a/src/Java/binnie/core/machines/RendererMachine.java b/src/Java/binnie/core/machines/RendererMachine.java
deleted file mode 100644
index 18ad4afe92..0000000000
--- a/src/Java/binnie/core/machines/RendererMachine.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package binnie.core.machines;
-
-import binnie.Binnie;
-import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-public class RendererMachine
- extends TileEntitySpecialRenderer
- implements ISimpleBlockRenderingHandler
-{
- RenderBlocks blockRenderer;
-
- public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float var8)
- {
- renderTileEntity((TileEntityMachine)entity, x, y, z, var8, this.blockRenderer);
- }
-
- public void renderTileEntity(TileEntityMachine entity, double x, double y, double z, float var8, RenderBlocks renderer)
- {
- if ((entity != null) && (entity.getMachine() != null))
- {
- MachinePackage machinePackage = entity.getMachine().getPackage();
- machinePackage.renderMachine(entity.getMachine(), x, y, z, var8, renderer);
- }
- }
-
- public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j)
- {
- TileEntity entity = block.createTileEntity(null, i);
- renderTileEntity((TileEntityMachine)entity, 0.0D, -0.1D, 0.0D, 0.0625F, renderblocks);
- }
-
- public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
- {
- if (modelID == Binnie.Machine.getMachineRenderID()) {
- renderInvBlock(renderer, block, metadata, modelID);
- }
- }
-
- public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
- {
- TileEntityMachine tile = (TileEntityMachine)world.getTileEntity(x, y, z);
- if ((tile != null) && (tile.getMachine() != null) && (tile.getMachine().getPackage() != null) && (tile.getMachine().getPackage().getGroup() != null) && (!tile.getMachine().getPackage().getGroup().customRenderer)) {
- renderTileEntity(tile, x, y, z, 1.0F, renderer);
- }
- return true;
- }
-
- public boolean shouldRender3DInInventory(int i)
- {
- return true;
- }
-
- public int getRenderId()
- {
- return Binnie.Machine.getMachineRenderID();
- }
-
- public void func_147496_a(World par1World)
- {
- this.blockRenderer = new RenderBlocks(par1World);
- }
-}
diff --git a/src/Java/binnie/core/machines/TileEntityMachine.java b/src/Java/binnie/core/machines/TileEntityMachine.java
deleted file mode 100644
index 27038b1c1c..0000000000
--- a/src/Java/binnie/core/machines/TileEntityMachine.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package binnie.core.machines;
-
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.Packet;
-import binnie.Binnie;
-import binnie.core.machines.base.TileEntityMachineBase;
-import binnie.core.machines.component.IInteraction;
-import binnie.core.network.INetworkedEntity;
-import binnie.core.network.packet.PacketPayload;
-
-public class TileEntityMachine
- extends TileEntityMachineBase
- implements INetworkedEntity
-{
- private Machine machine;
-
- public void updateEntity()
- {
- super.updateEntity();
- if (this.machine != null) {
- this.machine.onUpdate();
- }
- }
-
- public boolean canUpdate()
- {
- return super.canUpdate();
- }
-
- public TileEntityMachine(MachinePackage pack)
- {
- setMachine(pack);
- }
-
- public TileEntityMachine() {}
-
- public void setMachine(MachinePackage pack)
- {
- if (pack != null) {
- this.machine = new Machine(pack, this);
- }
- }
-
- public void readFromNBT(NBTTagCompound nbtTagCompound)
- {
- super.readFromNBT(nbtTagCompound);
- String name = nbtTagCompound.getString("name");
- String group = nbtTagCompound.getString("group");
- MachinePackage pack = Binnie.Machine.getPackage(group, name);
- if (pack == null)
- {
- invalidate();
- return;
- }
- setMachine(pack);
- getMachine().readFromNBT(nbtTagCompound);
- }
-
- public void writeToNBT(NBTTagCompound nbtTagCompound)
- {
- super.writeToNBT(nbtTagCompound);
- String name = this.machine.getPackage().getUID();
- String group = this.machine.getPackage().getGroup().getUID();
- nbtTagCompound.setString("group", group);
- nbtTagCompound.setString("name", name);
- getMachine().writeToNBT(nbtTagCompound);
- }
-
- public void writeToPacket(PacketPayload payload)
- {
- this.machine.writeToPacket(payload);
- }
-
- public void readFromPacket(PacketPayload payload)
- {
- this.machine.readFromPacket(payload);
- }
-
- public Machine getMachine()
- {
- return this.machine;
- }
-
- public void onBlockDestroy()
- {
- if (getMachine() != null) {
- getMachine().onBlockDestroy();
- }
- }
-
- public final Packet getDescriptionPacket()
- {
- return getMachine() != null ? getMachine().getDescriptionPacket() : null;
- }
-
- public void invalidate()
- {
- super.invalidate();
- for (IInteraction.Invalidation c : getMachine().getInterfaces(IInteraction.Invalidation.class)) {
- c.onInvalidation();
- }
- }
-
- public void onChunkUnload()
- {
- super.onChunkUnload();
- for (IInteraction.ChunkUnload c : getMachine().getInterfaces(IInteraction.ChunkUnload.class)) {
- c.onChunkUnload();
- }
- }
-}
diff --git a/src/Java/binnie/core/machines/base/DefaultInventory.java b/src/Java/binnie/core/machines/base/DefaultInventory.java
deleted file mode 100644
index b72ebd3b57..0000000000
--- a/src/Java/binnie/core/machines/base/DefaultInventory.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package binnie.core.machines.base;
-
-import binnie.core.machines.inventory.IInventoryMachine;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-
-class DefaultInventory
- implements IInventoryMachine
-{
- public int getSizeInventory()
- {
- return 0;
- }
-
- public ItemStack getStackInSlot(int i)
- {
- return null;
- }
-
- public ItemStack decrStackSize(int i, int j)
- {
- return null;
- }
-
- public ItemStack getStackInSlotOnClosing(int i)
- {
- return null;
- }
-
- public void setInventorySlotContents(int i, ItemStack itemstack) {}
-
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- public boolean isUseableByPlayer(EntityPlayer entityplayer)
- {
- return false;
- }
-
- public boolean isItemValidForSlot(int i, ItemStack itemstack)
- {
- return false;
- }
-
- public int[] getAccessibleSlotsFromSide(int var1)
- {
- return new int[0];
- }
-
- public boolean canInsertItem(int i, ItemStack itemstack, int j)
- {
- return false;
- }
-
- public boolean canExtractItem(int i, ItemStack itemstack, int j)
- {
- return false;
- }
-
- public boolean isReadOnly(int slot)
- {
- return false;
- }
-
- public String getInventoryName()
- {
- return "";
- }
-
- public boolean hasCustomInventoryName()
- {
- return false;
- }
-
- public void markDirty() {}
-
- public void openInventory() {}
-
- public void closeInventory() {}
-}
diff --git a/src/Java/binnie/core/machines/base/DefaultPower.java b/src/Java/binnie/core/machines/base/DefaultPower.java
deleted file mode 100644
index 527ce0801a..0000000000
--- a/src/Java/binnie/core/machines/base/DefaultPower.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package binnie.core.machines.base;
-
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.ForgeDirection;
-import binnie.core.machines.power.IPoweredMachine;
-import binnie.core.machines.power.PowerInfo;
-import binnie.core.machines.power.PowerInterface;
-
-class DefaultPower
- implements IPoweredMachine
-{
- public PowerInfo getPowerInfo()
- {
- return new PowerInfo(this, 0.0F);
- }
-
-
- public double getDemandedEnergy()
- {
- return 0.0D;
- }
-
-
- public int getSinkTier()
- {
- return 0;
- }
-
-
- public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage)
- {
- return 0.0D;
- }
-
-
- public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
- {
- return false;
- }
-
- public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
- {
- return 0;
- }
-
- public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
- {
- return 0;
- }
-
- public int getEnergyStored(ForgeDirection from)
- {
- return 0;
- }
-
- public int getMaxEnergyStored(ForgeDirection from)
- {
- return 0;
- }
-
- public boolean canConnectEnergy(ForgeDirection from)
- {
- return false;
- }
-
- public PowerInterface getInterface()
- {
- return null;
- }
-}
diff --git a/src/Java/binnie/core/machines/base/DefaultTankContainer.java b/src/Java/binnie/core/machines/base/DefaultTankContainer.java
deleted file mode 100644
index a0c93b1168..0000000000
--- a/src/Java/binnie/core/machines/base/DefaultTankContainer.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package binnie.core.machines.base;
-
-import binnie.core.machines.inventory.TankSlot;
-import binnie.core.machines.power.ITankMachine;
-import binnie.core.machines.power.TankInfo;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-import net.minecraftforge.fluids.IFluidTank;
-
-class DefaultTankContainer
- implements ITankMachine
-{
- public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
- {
- return 0;
- }
-
- public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
- {
- return null;
- }
-
- public TankInfo[] getTankInfos()
- {
- return new TankInfo[0];
- }
-
- public boolean isTankReadOnly(int tank)
- {
- return false;
- }
-
- public boolean isLiquidValidForTank(FluidStack liquid, int tank)
- {
- return false;
- }
-
- public TankSlot addTank(int index, String name, int capacity)
- {
- return null;
- }
-
- public IFluidTank getTank(int index)
- {
- return null;
- }
-
- public TankSlot getTankSlot(int slot)
- {
- return null;
- }
-
- public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
- {
- return null;
- }
-
- public boolean canFill(ForgeDirection from, Fluid fluid)
- {
- return false;
- }
-
- public boolean canDrain(ForgeDirection from, Fluid fluid)
- {
- return false;
- }
-
- public FluidTankInfo[] getTankInfo(ForgeDirection from)
- {
- return new FluidTankInfo[0];
- }
-
- public IFluidTank[] getTanks()
- {
- return new IFluidTank[0];
- }
-}
diff --git a/src/Java/binnie/core/machines/base/TileEntityMachineBase.java b/src/Java/binnie/core/machines/base/TileEntityMachineBase.java
deleted file mode 100644
index 471bb4ab68..0000000000
--- a/src/Java/binnie/core/machines/base/TileEntityMachineBase.java
+++ /dev/null
@@ -1,256 +0,0 @@
-package binnie.core.machines.base;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-import net.minecraftforge.fluids.IFluidTank;
-import binnie.core.machines.Machine;
-import binnie.core.machines.inventory.IInventoryMachine;
-import binnie.core.machines.inventory.TankSlot;
-import binnie.core.machines.power.IPoweredMachine;
-import binnie.core.machines.power.ITankMachine;
-import binnie.core.machines.power.PowerInfo;
-import binnie.core.machines.power.PowerInterface;
-import binnie.core.machines.power.TankInfo;
-
-public class TileEntityMachineBase
- extends TileEntity
- implements IInventoryMachine, ITankMachine, IPoweredMachine
-{
- public IInventoryMachine getInventory()
- {
- IInventoryMachine inv = (IInventoryMachine)Machine.getInterface(IInventoryMachine.class, this);
- return (inv == null) || (inv == this) ? new DefaultInventory() : inv;
- }
-
- public ITankMachine getTankContainer()
- {
- ITankMachine inv = (ITankMachine)Machine.getInterface(ITankMachine.class, this);
- return (inv == null) || (inv == this) ? new DefaultTankContainer() : inv;
- }
-
- public IPoweredMachine getPower()
- {
- IPoweredMachine inv = (IPoweredMachine)Machine.getInterface(IPoweredMachine.class, this);
- return (inv == null) || (inv == this) ? new DefaultPower() : inv;
- }
-
- public int getSizeInventory()
- {
- return getInventory().getSizeInventory();
- }
-
- public ItemStack getStackInSlot(int index)
- {
- return getInventory().getStackInSlot(index);
- }
-
- public ItemStack decrStackSize(int index, int amount)
- {
- return getInventory().decrStackSize(index, amount);
- }
-
- public ItemStack getStackInSlotOnClosing(int var1)
- {
- return getInventory().getStackInSlotOnClosing(var1);
- }
-
- public void setInventorySlotContents(int index, ItemStack itemStack)
- {
- getInventory().setInventorySlotContents(index, itemStack);
- }
-
- public String getInventoryName()
- {
- return getInventory().getInventoryName();
- }
-
- public int getInventoryStackLimit()
- {
- return getInventory().getInventoryStackLimit();
- }
-
- public boolean isUseableByPlayer(EntityPlayer entityplayer)
- {
- if (isInvalid()) {
- return false;
- }
- if (getWorldObj().getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this) {
- return false;
- }
- if (entityplayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) > 64.0D) {
- return false;
- }
- return getInventory().isUseableByPlayer(entityplayer);
- }
-
- public void openInventory()
- {
- getInventory().openInventory();
- }
-
- public void closeInventory()
- {
- getInventory().closeInventory();
- }
-
- public boolean hasCustomInventoryName()
- {
- return getInventory().hasCustomInventoryName();
- }
-
- public void markDirty()
- {
- super.markDirty();
- getInventory().markDirty();
- }
-
- public boolean isItemValidForSlot(int slot, ItemStack itemStack)
- {
- return getInventory().isItemValidForSlot(slot, itemStack);
- }
-
- public int[] getAccessibleSlotsFromSide(int var1)
- {
- return getInventory().getAccessibleSlotsFromSide(var1);
- }
-
- public boolean canInsertItem(int i, ItemStack itemstack, int j)
- {
- return getInventory().canInsertItem(i, itemstack, j);
- }
-
- public boolean canExtractItem(int i, ItemStack itemstack, int j)
- {
- return getInventory().canExtractItem(i, itemstack, j);
- }
-
- public boolean isReadOnly(int slot)
- {
- return getInventory().isReadOnly(slot);
- }
-
- public PowerInfo getPowerInfo()
- {
- return getPower().getPowerInfo();
- }
-
- public TankInfo[] getTankInfos()
- {
- return getTankContainer().getTankInfos();
- }
-
- public boolean isTankReadOnly(int tank)
- {
- return getTankContainer().isTankReadOnly(tank);
- }
-
- public boolean isLiquidValidForTank(FluidStack liquid, int tank)
- {
- return getTankContainer().isLiquidValidForTank(liquid, tank);
- }
-
- public TankSlot addTank(int index, String name, int capacity)
- {
- return getTankContainer().addTank(index, name, capacity);
- }
-
- public IFluidTank getTank(int index)
- {
- return getTankContainer().getTank(index);
- }
-
- public TankSlot getTankSlot(int index)
- {
- return getTankContainer().getTankSlot(index);
- }
-
- public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
- {
- return getTankContainer().fill(from, resource, doFill);
- }
-
- public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
- {
- return getTankContainer().drain(from, resource, doDrain);
- }
-
- public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
- {
- return getTankContainer().drain(from, maxDrain, doDrain);
- }
-
- public boolean canFill(ForgeDirection from, Fluid fluid)
- {
- return getTankContainer().canFill(from, fluid);
- }
-
- public boolean canDrain(ForgeDirection from, Fluid fluid)
- {
- return getTankContainer().canDrain(from, fluid);
- }
-
- public FluidTankInfo[] getTankInfo(ForgeDirection from)
- {
- return getTankContainer().getTankInfo(from);
- }
-
- public IFluidTank[] getTanks()
- {
- return getTankContainer().getTanks();
- }
-
- public double getDemandedEnergy()
- {
- return getPower().getDemandedEnergy();
- }
-
- public int getSinkTier()
- {
- return getPower().getSinkTier();
- }
-
- public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage)
- {
- return getPower().injectEnergy(directionFrom, amount, voltage);
- }
-
- public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
- {
- return getPower().acceptsEnergyFrom(emitter, direction);
- }
-
- public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
- {
- return getPower().receiveEnergy(from, maxReceive, simulate);
- }
-
- public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
- {
- return getPower().extractEnergy(from, maxExtract, simulate);
- }
-
- public int getEnergyStored(ForgeDirection from)
- {
- return getPower().getEnergyStored(from);
- }
-
- public int getMaxEnergyStored(ForgeDirection from)
- {
- return getPower().getMaxEnergyStored(from);
- }
-
- public boolean canConnectEnergy(ForgeDirection from)
- {
- return getPower().canConnectEnergy(from);
- }
-
- public PowerInterface getInterface()
- {
- return getPower().getInterface();
- }
-}
diff --git a/src/Java/binnie/core/machines/component/ComponentRecipe.java b/src/Java/binnie/core/machines/component/ComponentRecipe.java
deleted file mode 100644
index 502967e83a..0000000000
--- a/src/Java/binnie/core/machines/component/ComponentRecipe.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package binnie.core.machines.component;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachineComponent;
-
-public abstract class ComponentRecipe
- extends MachineComponent
- implements IComponentRecipe
-{
- public ComponentRecipe(Machine machine)
- {
- super(machine);
- }
-}
diff --git a/src/Java/binnie/core/machines/component/IBuildcraft.java b/src/Java/binnie/core/machines/component/IBuildcraft.java
deleted file mode 100644
index 42c4b315e6..0000000000
--- a/src/Java/binnie/core/machines/component/IBuildcraft.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package binnie.core.machines.component;
-
-import binnie.core.triggers.TriggerData;
-import buildcraft.api.statements.IActionExternal;
-import buildcraft.api.statements.IActionReceptor;
-import java.util.List;
-
-public abstract interface IBuildcraft
-{
- public static abstract interface TriggerProvider
- {
- public abstract void getTriggers(List<TriggerData> paramList);
- }
-
- public static abstract interface ActionProvider
- extends IActionReceptor
- {
- public abstract void getActions(List<IActionExternal> paramList);
- }
-}
diff --git a/src/Java/binnie/core/machines/component/IComponentRecipe.java b/src/Java/binnie/core/machines/component/IComponentRecipe.java
deleted file mode 100644
index f512d1090f..0000000000
--- a/src/Java/binnie/core/machines/component/IComponentRecipe.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package binnie.core.machines.component;
-
-import net.minecraft.item.ItemStack;
-
-public abstract interface IComponentRecipe
-{
- public abstract boolean isRecipe();
-
- public abstract ItemStack doRecipe(boolean paramBoolean);
-
- public abstract ItemStack getProduct();
-}
diff --git a/src/Java/binnie/core/machines/component/IInteraction.java b/src/Java/binnie/core/machines/component/IInteraction.java
deleted file mode 100644
index 7556b5d567..0000000000
--- a/src/Java/binnie/core/machines/component/IInteraction.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package binnie.core.machines.component;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.world.World;
-
-public abstract interface IInteraction
-{
- public static abstract interface ChunkUnload
- {
- public abstract void onChunkUnload();
- }
-
- public static abstract interface Invalidation
- {
- public abstract void onInvalidation();
- }
-
- public static abstract interface RightClick
- {
- public abstract void onRightClick(World paramWorld, EntityPlayer paramEntityPlayer, int paramInt1, int paramInt2, int paramInt3);
- }
-}
diff --git a/src/Java/binnie/core/machines/component/IRender.java b/src/Java/binnie/core/machines/component/IRender.java
deleted file mode 100644
index 0b79e985bb..0000000000
--- a/src/Java/binnie/core/machines/component/IRender.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package binnie.core.machines.component;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.Random;
-import net.minecraft.client.renderer.entity.RenderItem;
-import net.minecraft.world.World;
-
-public abstract interface IRender
-{
- public static abstract interface DisplayTick
- {
- @SideOnly(Side.CLIENT)
- public abstract void onDisplayTick(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Random paramRandom);
- }
-
- public static abstract interface RandomDisplayTick
- {
- @SideOnly(Side.CLIENT)
- public abstract void onRandomDisplayTick(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Random paramRandom);
- }
-
- public static abstract interface Render
- {
- @SideOnly(Side.CLIENT)
- public abstract void renderInWorld(RenderItem paramRenderItem, double paramDouble1, double paramDouble2, double paramDouble3);
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/AccessDirection.java b/src/Java/binnie/core/machines/inventory/AccessDirection.java
deleted file mode 100644
index 10abf8d7f0..0000000000
--- a/src/Java/binnie/core/machines/inventory/AccessDirection.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package binnie.core.machines.inventory;
-
- enum AccessDirection
-{
- Both, In, Out, Neither;
-
- private AccessDirection() {}
-
- boolean canInsert()
- {
- return (this == Both) || (this == In);
- }
-
- boolean canExtract()
- {
- return (this == Both) || (this == Out);
- }
-
- boolean canAccess()
- {
- return this != Neither;
- }
-
- AccessDirection changeInsert(boolean b)
- {
- if (b)
- {
- if (this == Out) {
- return Both;
- }
- if (this == Neither) {
- return In;
- }
- }
- else
- {
- if (this == Both) {
- return Out;
- }
- if (this == In) {
- return Neither;
- }
- }
- return this;
- }
-
- AccessDirection changeExtract(boolean b)
- {
- if (b)
- {
- if (this == In) {
- return Both;
- }
- if (this == Neither) {
- return Out;
- }
- }
- else
- {
- if (this == Both) {
- return In;
- }
- if (this == Out) {
- return Neither;
- }
- }
- return this;
- }
-
- public String getTextColour()
- {
- switch (1.$SwitchMap$binnie$core$machines$inventory$AccessDirection[ordinal()])
- {
- case 1:
- return "§a";
- case 2:
- return "§e";
- case 3:
- return "§c";
- }
- return "§b";
- }
-
- public int getShadeColour()
- {
- switch (1.$SwitchMap$binnie$core$machines$inventory$AccessDirection[ordinal()])
- {
- case 1:
- return 1431699285;
- case 2:
- return 1442840405;
- case 3:
- return 1442796885;
- }
- return 1431699455;
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/BaseSlot.java b/src/Java/binnie/core/machines/inventory/BaseSlot.java
deleted file mode 100644
index fe5cde21d3..0000000000
--- a/src/Java/binnie/core/machines/inventory/BaseSlot.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package binnie.core.machines.inventory;
-
-import binnie.core.util.IValidator;
-import forestry.api.core.INBTTagable;
-import java.util.Collection;
-import java.util.EnumSet;
-import net.minecraftforge.common.util.ForgeDirection;
-
-abstract class BaseSlot<T>
- implements INBTTagable, IValidator<T>
-{
- private SidedAccess access = new SidedAccess();
- Validator<T> validator = null;
- private boolean readOnly = false;
- private int index;
-
- public BaseSlot(int index, String unlocName)
- {
- setIndex(index);
- setUnlocalisedName(unlocName);
- }
-
- public void setReadOnly()
- {
- this.readOnly = true;
- forbidInsertion();
- }
-
- public boolean isValid(T item)
- {
- if (item == null) {
- return true;
- }
- if (this.validator != null) {
- return this.validator.isValid(item);
- }
- return true;
- }
-
- public abstract T getContent();
-
- public abstract void setContent(T paramT);
-
- public void setValidator(Validator<T> val)
- {
- this.validator = val;
- }
-
- public boolean isEmpty()
- {
- return getContent() == null;
- }
-
- public boolean isReadOnly()
- {
- return this.readOnly;
- }
-
- public int getIndex()
- {
- return this.index;
- }
-
- private void setIndex(int index)
- {
- this.index = index;
- }
-
- public boolean canInsert()
- {
- return !this.access.getInsertionSides().isEmpty();
- }
-
- public boolean canExtract()
- {
- return !this.access.getExtractionSides().isEmpty();
- }
-
- public void forbidInteraction()
- {
- forbidInsertion();
- forbidExtraction();
- }
-
- public void setInputSides(EnumSet<ForgeDirection> sides)
- {
- for (ForgeDirection side : EnumSet.complementOf(sides)) {
- if (side != ForgeDirection.UNKNOWN) {
- this.access.setInsert(side, false);
- }
- }
- }
-
- public void setOutputSides(EnumSet<ForgeDirection> sides)
- {
- for (ForgeDirection side : EnumSet.complementOf(sides)) {
- if (side != ForgeDirection.UNKNOWN) {
- this.access.setExtract(side, false);
- }
- }
- }
-
- public void forbidExtraction()
- {
- this.access.setExtract(false);
- this.access.forbidExtractChange();
- }
-
- public void forbidInsertion()
- {
- this.access.setInsert(false);
- this.access.forbidInsertChange();
- }
-
- public boolean canInsert(ForgeDirection dir)
- {
- return this.access.canInsert(dir);
- }
-
- public boolean canExtract(ForgeDirection dir)
- {
- return this.access.canExtract(dir);
- }
-
- public Collection<ForgeDirection> getInputSides()
- {
- return this.access.getInsertionSides();
- }
-
- public Collection<ForgeDirection> getOutputSides()
- {
- return this.access.getExtractionSides();
- }
-
- protected String unlocName = "";
-
- public void setUnlocalisedName(String name)
- {
- this.unlocName = name;
- }
-
- public abstract String getName();
-
- public Validator<T> getValidator()
- {
- return this.validator;
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/ComponentChargedSlots.java b/src/Java/binnie/core/machines/inventory/ComponentChargedSlots.java
deleted file mode 100644
index ceaab46538..0000000000
--- a/src/Java/binnie/core/machines/inventory/ComponentChargedSlots.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package binnie.core.machines.inventory;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachineComponent;
-import binnie.core.machines.network.INetwork;
-import cpw.mods.fml.relauncher.Side;
-
-public class ComponentChargedSlots
- extends MachineComponent
- implements INetwork.GuiNBT, IChargedSlots
-{
- public ComponentChargedSlots(Machine machine)
- {
- super(machine);
- }
-
- public void readFromNBT(NBTTagCompound nbttagcompound)
- {
- super.readFromNBT(nbttagcompound);
- this.charges.clear();
- NBTTagList list = nbttagcompound.getTagList("charges", 10);
- for (int i = 0; i < list.tagCount(); i++)
- {
- NBTTagCompound tag = list.getCompoundTagAt(i);
- this.charges.put(Integer.valueOf(tag.getByte("i")), Float.valueOf(tag.getByte("v") / 100.0F));
- }
- }
-
- public void writeToNBT(NBTTagCompound nbttagcompound)
- {
- super.writeToNBT(nbttagcompound);
-
- NBTTagList chargeList = new NBTTagList();
- for (Map.Entry<Integer, Float> entry : this.charges.entrySet())
- {
- NBTTagCompound chargesNBT = new NBTTagCompound();
- chargesNBT.setByte("i", (byte)(0 + ((Integer)entry.getKey()).intValue()));
- chargesNBT.setByte("v", (byte)(int)(((Float)entry.getValue()).floatValue() * 100.0F));
- chargeList.appendTag(chargesNBT);
- }
- nbttagcompound.setTag("charges", chargeList);
- }
-
- private Map<Integer, Float> charges = new HashMap();
-
- public void addCharge(int slot)
- {
- this.charges.put(Integer.valueOf(slot), Float.valueOf(0.0F));
- }
-
- public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound nbt)
- {
- Iterator i$;
- if (name.equals("slot-charges")) {
- for (i$ = this.charges.keySet().iterator(); i$.hasNext();)
- {
- int i = ((Integer)i$.next()).intValue();
- this.charges.put(Integer.valueOf(i), Float.valueOf(nbt.getShort("" + i) / 100.0F));
- }
- }
- }
-
- public void sendGuiNBT(Map<String, NBTTagCompound> nbt)
- {
- NBTTagCompound tag = new NBTTagCompound();
- for (Iterator i$ = this.charges.keySet().iterator(); i$.hasNext();)
- {
- int i = ((Integer)i$.next()).intValue();
- tag.setShort("" + i, (short)(int)(((Float)this.charges.get(Integer.valueOf(i))).floatValue() * 100.0F));
- }
- nbt.put("slot-charges", tag);
- }
-
- public float getCharge(int slot)
- {
- return this.charges.containsKey(Integer.valueOf(slot)) ? ((Float)this.charges.get(Integer.valueOf(slot))).floatValue() : 0.0F;
- }
-
- public void setCharge(int slot, float charge)
- {
- if (charge > 1.0F) {
- charge = 1.0F;
- }
- if (charge < 0.0F) {
- charge = 0.0F;
- }
- if (this.charges.containsKey(Integer.valueOf(slot))) {
- this.charges.put(Integer.valueOf(slot), Float.valueOf(charge));
- }
- }
-
- public void onUpdate()
- {
- for (Iterator i$ = this.charges.keySet().iterator(); i$.hasNext();)
- {
- int slot = ((Integer)i$.next()).intValue();
- if ((getCharge(slot) <= 0.0F) &&
- (getUtil().decreaseStack(slot, 1) != null)) {
- setCharge(slot, 1.0F);
- }
- }
- }
-
- public void alterCharge(int slot, float charge)
- {
- setCharge(slot, getCharge(slot) + charge);
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/ComponentInventory.java b/src/Java/binnie/core/machines/inventory/ComponentInventory.java
deleted file mode 100644
index 66566e511c..0000000000
--- a/src/Java/binnie/core/machines/inventory/ComponentInventory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package binnie.core.machines.inventory;
-
-import binnie.core.machines.IMachine;
-import binnie.core.machines.MachineComponent;
-import net.minecraft.inventory.IInventory;
-
-public abstract class ComponentInventory
- extends MachineComponent
- implements IInventory
-{
- public ComponentInventory(IMachine machine)
- {
- super(machine);
- }
-
- public void markDirty()
- {
- if (getMachine() != null) {
- getMachine().markDirty();
- }
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/ComponentInventorySlots.java b/src/Java/binnie/core/machines/inventory/ComponentInventorySlots.java
deleted file mode 100644
index 42334f4485..0000000000
--- a/src/Java/binnie/core/machines/inventory/ComponentInventorySlots.java
+++ /dev/null
@@ -1,247 +0,0 @@
-package binnie.core.machines.inventory;
-
-import binnie.core.machines.IMachine;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Random;
-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.nbt.NBTTagList;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class ComponentInventorySlots
- extends ComponentInventory
- implements IInventoryMachine, IInventorySlots
-{
- public ComponentInventorySlots(IMachine machine)
- {
- super(machine);
- }
-
- private Map<Integer, InventorySlot> inventory = new LinkedHashMap();
-
- public int getSizeInventory()
- {
- int size = 0;
- for (Integer index : this.inventory.keySet()) {
- size = Math.max(size, index.intValue() + 1);
- }
- return size;
- }
-
- public ItemStack getStackInSlot(int index)
- {
- if (this.inventory.containsKey(Integer.valueOf(index))) {
- return ((InventorySlot)this.inventory.get(Integer.valueOf(index))).getContent();
- }
- return null;
- }
-
- public ItemStack decrStackSize(int index, int amount)
- {
- if (this.inventory.containsKey(Integer.valueOf(index)))
- {
- ItemStack stack = ((InventorySlot)this.inventory.get(Integer.valueOf(index))).decrStackSize(amount);
- markDirty();
- return stack;
- }
- return null;
- }
-
- public ItemStack getStackInSlotOnClosing(int var1)
- {
- return null;
- }
-
- public void setInventorySlotContents(int index, ItemStack itemStack)
- {
- if ((this.inventory.containsKey(Integer.valueOf(index))) && ((itemStack == null) || (((InventorySlot)this.inventory.get(Integer.valueOf(index))).isValid(itemStack)))) {
- ((InventorySlot)this.inventory.get(Integer.valueOf(index))).setContent(itemStack);
- }
- markDirty();
- }
-
- protected void transferItem(int indexFrom, int indexTo)
- {
- if ((this.inventory.containsKey(Integer.valueOf(indexFrom))) && (this.inventory.containsKey(Integer.valueOf(indexTo))))
- {
- ItemStack newStack = ((InventorySlot)this.inventory.get(Integer.valueOf(indexFrom))).getContent().copy();
- ((InventorySlot)this.inventory.get(Integer.valueOf(indexFrom))).setContent(null);
- ((InventorySlot)this.inventory.get(Integer.valueOf(indexTo))).setContent(newStack);
- }
- markDirty();
- }
-
- public String getInventoryName()
- {
- return "";
- }
-
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- public boolean isUseableByPlayer(EntityPlayer var1)
- {
- return true;
- }
-
- public void openInventory() {}
-
- public void closeInventory() {}
-
- public void readFromNBT(NBTTagCompound nbttagcompound)
- {
- super.readFromNBT(nbttagcompound);
- if (nbttagcompound.hasKey("inventory"))
- {
- NBTTagList inventoryNBT = nbttagcompound.getTagList("inventory", 10);
- for (int i = 0; i < inventoryNBT.tagCount(); i++)
- {
- NBTTagCompound slotNBT = inventoryNBT.getCompoundTagAt(i);
- int index = slotNBT.getInteger("id");
- if (slotNBT.hasKey("Slot")) {
- index = slotNBT.getByte("Slot") & 0xFF;
- }
- if (this.inventory.containsKey(Integer.valueOf(index))) {
- ((InventorySlot)this.inventory.get(Integer.valueOf(index))).readFromNBT(slotNBT);
- }
- }
- }
- markDirty();
- }
-
- public void writeToNBT(NBTTagCompound nbttagcompound)
- {
- super.writeToNBT(nbttagcompound);
-
- NBTTagList inventoryNBT = new NBTTagList();
- for (Map.Entry<Integer, InventorySlot> entry : this.inventory.entrySet())
- {
- NBTTagCompound slotNBT = new NBTTagCompound();
- slotNBT.setInteger("id", ((Integer)entry.getKey()).intValue());
- ((InventorySlot)entry.getValue()).writeToNBT(slotNBT);
- inventoryNBT.appendTag(slotNBT);
- }
- nbttagcompound.setTag("inventory", inventoryNBT);
- }
-
- public final InventorySlot addSlot(int index, String unlocName)
- {
- this.inventory.put(Integer.valueOf(index), new InventorySlot(index, unlocName));
- return getSlot(index);
- }
-
- public final InventorySlot[] addSlotArray(int[] indexes, String unlocName)
- {
- for (int k : indexes) {
- addSlot(k, unlocName);
- }
- return getSlots(indexes);
- }
-
- public InventorySlot getSlot(int index)
- {
- if (this.inventory.containsKey(Integer.valueOf(index))) {
- return (InventorySlot)this.inventory.get(Integer.valueOf(index));
- }
- return null;
- }
-
- public InventorySlot[] getAllSlots()
- {
- return (InventorySlot[])this.inventory.values().toArray(new InventorySlot[0]);
- }
-
- public InventorySlot[] getSlots(int[] indexes)
- {
- List<InventorySlot> list = new ArrayList();
- for (int i : indexes) {
- if (getSlot(i) != null) {
- list.add(getSlot(i));
- }
- }
- return (InventorySlot[])list.toArray(new InventorySlot[0]);
- }
-
- public boolean isReadOnly(int slot)
- {
- InventorySlot iSlot = getSlot(slot);
- return iSlot == null ? true : iSlot.isReadOnly();
- }
-
- public boolean hasCustomInventoryName()
- {
- return true;
- }
-
- public boolean isItemValidForSlot(int slot, ItemStack itemStack)
- {
- InventorySlot iSlot = getSlot(slot);
- return iSlot != null;
- }
-
- public void onDestruction()
- {
- for (InventorySlot slot : this.inventory.values())
- {
- ItemStack stack = slot.getContent();
- if ((!slot.isRecipe()) && (stack != null))
- {
- float f = getMachine().getWorld().rand.nextFloat() * 0.8F + 0.1F;
- float f1 = getMachine().getWorld().rand.nextFloat() * 0.8F + 0.1F;
- float f2 = getMachine().getWorld().rand.nextFloat() * 0.8F + 0.1F;
- if (stack.stackSize == 0) {
- stack.stackSize = 1;
- }
- EntityItem entityitem = new EntityItem(getMachine().getWorld(), getMachine().getTileEntity().xCoord + f, getMachine().getTileEntity().yCoord + f1, getMachine().getTileEntity().zCoord + f2, stack.copy());
-
-
-
-
- float accel = 0.05F;
- entityitem.motionX = ((float)getMachine().getWorld().rand.nextGaussian() * accel);
-
- entityitem.motionY = ((float)getMachine().getWorld().rand.nextGaussian() * accel + 0.2F);
-
- entityitem.motionZ = ((float)getMachine().getWorld().rand.nextGaussian() * accel);
-
- getMachine().getWorld().spawnEntityInWorld(entityitem);
- }
- }
- }
-
- public int[] getAccessibleSlotsFromSide(int var1)
- {
- List<Integer> slots = new ArrayList();
- for (InventorySlot slot : this.inventory.values()) {
- if ((slot.canInsert()) || (slot.canExtract())) {
- slots.add(Integer.valueOf(slot.getIndex()));
- }
- }
- int[] ids = new int[slots.size()];
- for (int i = 0; i < slots.size(); i++) {
- ids[i] = ((Integer)slots.get(i)).intValue();
- }
- return ids;
- }
-
- public boolean canInsertItem(int i, ItemStack itemstack, int j)
- {
- return (isItemValidForSlot(i, itemstack)) && (getSlot(i).canInsert(ForgeDirection.getOrientation(j)));
- }
-
- public boolean canExtractItem(int i, ItemStack itemstack, int j)
- {
- return getSlot(i).canExtract(ForgeDirection.getOrientation(j));
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/ComponentInventoryTransfer.java b/src/Java/binnie/core/machines/inventory/ComponentInventoryTransfer.java
deleted file mode 100644
index e8bbf00f88..0000000000
--- a/src/Java/binnie/core/machines/inventory/ComponentInventoryTransfer.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package binnie.core.machines.inventory;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import binnie.core.machines.IMachine;
-import binnie.core.machines.MachineComponent;
-import binnie.core.machines.transfer.TransferRequest;
-
-public class ComponentInventoryTransfer
- extends MachineComponent
-{
- public ComponentInventoryTransfer(IMachine machine)
- {
- super(machine);
- }
-
- public abstract class Transfer
- {
- protected ComponentInventoryTransfer.Condition condition;
- protected IMachine machine;
-
- private Transfer(IMachine machine)
- {
- this.machine = machine;
- }
-
- public final void transfer(IInventory inv)
- {
- if ((this.condition == null) || (fufilled(inv))) {
- doTransfer(inv);
- }
- }
-
- protected boolean fufilled(IInventory inv)
- {
- return true;
- }
-
- protected void doTransfer(IInventory inv) {}
-
- public final Transfer setCondition(ComponentInventoryTransfer.Condition condition)
- {
- this.condition = condition;
- condition.transfer = this;
- return this;
- }
-
- public final IMachine getMachine()
- {
- return this.machine;
- }
- }
-
- private class Restock
- extends ComponentInventoryTransfer.Transfer
- {
- int[] buffer;
- int destination;
- int limit;
-
- private Restock(IMachine machine, int[] buffer, int destination, int limit)
- {
- super(machine);
- this.buffer = buffer;
- this.destination = destination;
- this.limit = limit;
- }
-
- private Restock(IMachine machine, int[] buffer, int destination)
- {
- this(machine, buffer, destination, 64);
- }
-
- protected void doTransfer(IInventory inv)
- {
- if (inv.getStackInSlot(this.destination) == null) {
- for (int i : this.buffer) {
- if (inv.getStackInSlot(i) != null)
- {
- ItemStack newStack = inv.decrStackSize(i, this.limit);
- if (newStack != null)
- {
- inv.setInventorySlotContents(this.destination, newStack);
- return;
- }
- }
- }
- }
- }
- }
-
- private class Storage
- extends ComponentInventoryTransfer.Transfer
- {
- int source;
- int[] destination;
-
- private Storage(IMachine machine, int source, int[] destination)
- {
- super(machine);
- this.source = source;
- this.destination = destination;
- }
-
- protected void doTransfer(IInventory inv)
- {
- if (inv.getStackInSlot(this.source) != null) {
- inv.setInventorySlotContents(this.source, new TransferRequest(inv.getStackInSlot(this.source), inv).setTargetSlots(this.destination).ignoreValidation().transfer(true));
- }
- }
-
- protected boolean fufilled(IInventory inv)
- {
- ItemStack stack = inv.getStackInSlot(this.source);
- return (stack != null) && (this.condition.fufilled(stack));
- }
- }
-
- private List<Transfer> transfers = new ArrayList();
-
- public void addRestock(int[] buffer, int destination, int limit)
- {
- this.transfers.add(new Restock(getMachine(), buffer, destination, limit));
- }
-
- public void addRestock(int[] buffer, int destination)
- {
- this.transfers.add(new Restock(getMachine(), buffer, destination));
- }
-
- public void addStorage(int source, int[] destination)
- {
- this.transfers.add(new Storage(getMachine(), source, destination));
- }
-
- public void performTransfer(int source, int[] destination)
- {
- new Storage(getMachine(), source, destination).transfer((IInventory)getMachine().getInterface(IInventoryMachine.class));
- }
-
- public void onUpdate()
- {
- for (Transfer transfer : this.transfers) {
- transfer.transfer((IInventory)getMachine().getInterface(IInventoryMachine.class));
- }
- }
-
- public void addStorage(int source, int[] destination, Condition condition)
- {
- this.transfers.add(new Storage(getMachine(), source, destination).setCondition(condition));
- }
-
- public static abstract class Condition
- {
- public ComponentInventoryTransfer.Transfer transfer;
-
- public abstract boolean fufilled(ItemStack paramItemStack);
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/ComponentTankContainer.java b/src/Java/binnie/core/machines/inventory/ComponentTankContainer.java
deleted file mode 100644
index 0dee156475..0000000000
--- a/src/Java/binnie/core/machines/inventory/ComponentTankContainer.java
+++ /dev/null
@@ -1,207 +0,0 @@
-package binnie.core.machines.inventory;
-
-import binnie.core.machines.IMachine;
-import binnie.core.machines.MachineComponent;
-import binnie.core.machines.power.ITankMachine;
-import binnie.core.machines.power.TankInfo;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-import net.minecraftforge.fluids.IFluidTank;
-
-public class ComponentTankContainer
- extends MachineComponent
- implements ITankMachine
-{
- private Map<Integer, TankSlot> tanks = new LinkedHashMap();
-
- public ComponentTankContainer(IMachine machine)
- {
- super(machine);
- }
-
- public final TankSlot addTank(int index, String name, int capacity)
- {
- TankSlot tank = new TankSlot(index, name, capacity);
- this.tanks.put(Integer.valueOf(index), tank);
- return tank;
- }
-
- public final int fill(ForgeDirection from, FluidStack resource, boolean doFill)
- {
- int index = getTankIndexToFill(from, resource);
- if (this.tanks.containsKey(Integer.valueOf(index))) {
- return fill(index, resource, doFill);
- }
- return 0;
- }
-
- public final FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
- {
- int index = getTankIndexToDrain(from, null);
- if (this.tanks.containsKey(Integer.valueOf(index))) {
- return drain(index, maxDrain, doDrain);
- }
- return null;
- }
-
- private final int fill(int tankIndex, FluidStack resource, boolean doFill)
- {
- if (!this.tanks.containsKey(Integer.valueOf(tankIndex))) {
- return 0;
- }
- if (!isLiquidValidForTank(resource, tankIndex)) {
- return 0;
- }
- TankSlot tank = (TankSlot)this.tanks.get(Integer.valueOf(tankIndex));
- int filled = tank.getTank().fill(resource, doFill);
- if (filled > 0) {
- markDirty();
- }
- return filled;
- }
-
- private final FluidStack drain(int tankIndex, int maxDrain, boolean doDrain)
- {
- if (!this.tanks.containsKey(Integer.valueOf(tankIndex))) {
- return null;
- }
- TankSlot tank = (TankSlot)this.tanks.get(Integer.valueOf(tankIndex));
- FluidStack drained = tank.getTank().drain(maxDrain, doDrain);
- if (drained != null) {
- markDirty();
- }
- return drained;
- }
-
- private int getTankIndexToFill(ForgeDirection from, FluidStack resource)
- {
- for (TankSlot tank : this.tanks.values()) {
- if ((tank.isValid(resource)) && (tank.canInsert(from)) && ((tank.getContent() == null) || (tank.getContent().isFluidEqual(resource)))) {
- return tank.getIndex();
- }
- }
- return -1;
- }
-
- private int getTankIndexToDrain(ForgeDirection from, FluidStack resource)
- {
- for (TankSlot tank : this.tanks.values()) {
- if ((tank.getContent() != null) &&
- (tank.canExtract(from)) && ((resource == null) || (resource.isFluidEqual(tank.getContent())))) {
- return tank.getIndex();
- }
- }
- return -1;
- }
-
- public void readFromNBT(NBTTagCompound nbttagcompound)
- {
- super.readFromNBT(nbttagcompound);
- if (nbttagcompound.hasKey("liquidTanks"))
- {
- NBTTagList tanksNBT = nbttagcompound.getTagList("liquidTanks", 10);
- for (int i = 0; i < tanksNBT.tagCount(); i++)
- {
- NBTTagCompound tankNBT = tanksNBT.getCompoundTagAt(i);
- int index = tankNBT.getInteger("index");
- if (this.tanks.containsKey(Integer.valueOf(index))) {
- ((TankSlot)this.tanks.get(Integer.valueOf(index))).readFromNBT(tankNBT);
- }
- }
- }
- }
-
- public void writeToNBT(NBTTagCompound nbttagcompound)
- {
- super.writeToNBT(nbttagcompound);
-
- NBTTagList tanksNBT = new NBTTagList();
- for (Map.Entry<Integer, TankSlot> entry : this.tanks.entrySet())
- {
- NBTTagCompound tankNBT = new NBTTagCompound();
- tankNBT.setInteger("index", ((Integer)entry.getKey()).intValue());
- ((TankSlot)entry.getValue()).writeToNBT(tankNBT);
- tanksNBT.appendTag(tankNBT);
- }
- nbttagcompound.setTag("liquidTanks", tanksNBT);
- }
-
- public boolean isTankReadOnly(int tank)
- {
- return ((TankSlot)this.tanks.get(Integer.valueOf(tank))).isReadOnly();
- }
-
- public boolean isLiquidValidForTank(FluidStack liquid, int tank)
- {
- TankSlot slot = getTankSlot(tank);
- return slot != null;
- }
-
- public TankInfo[] getTankInfos()
- {
- return TankInfo.get(this);
- }
-
- public IFluidTank getTank(int index)
- {
- return getTanks()[index];
- }
-
- public IFluidTank[] getTanks()
- {
- List<IFluidTank> ltanks = new ArrayList();
- for (TankSlot tank : this.tanks.values()) {
- ltanks.add(tank.getTank());
- }
- return (IFluidTank[])ltanks.toArray(new IFluidTank[0]);
- }
-
- public TankSlot getTankSlot(int index)
- {
- return (TankSlot)this.tanks.get(Integer.valueOf(index));
- }
-
- public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
- {
- int index = getTankIndexToDrain(from, null);
- if (this.tanks.containsKey(Integer.valueOf(index))) {
- return drain(index, resource.amount, doDrain);
- }
- return null;
- }
-
- public boolean canFill(ForgeDirection from, Fluid fluid)
- {
- return fill(from, new FluidStack(fluid, 1), false) > 0;
- }
-
- public boolean canDrain(ForgeDirection from, Fluid fluid)
- {
- return drain(from, new FluidStack(fluid, 1), false) != null;
- }
-
- public FluidTankInfo[] getTankInfo(ForgeDirection from)
- {
- FluidTankInfo[] info = new FluidTankInfo[getTanks().length];
- for (int i = 0; i < info.length; i++) {
- info[i] = new FluidTankInfo(getTanks()[i]);
- }
- return info;
- }
-
- public void markDirty()
- {
- if (getMachine() != null) {
- getMachine().markDirty();
- }
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/IChargedSlots.java b/src/Java/binnie/core/machines/inventory/IChargedSlots.java
deleted file mode 100644
index e3fcae1f51..0000000000
--- a/src/Java/binnie/core/machines/inventory/IChargedSlots.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package binnie.core.machines.inventory;
-
-public abstract interface IChargedSlots
-{
- public abstract float getCharge(int paramInt);
-
- public abstract void setCharge(int paramInt, float paramFloat);
-
- public abstract void alterCharge(int paramInt, float paramFloat);
-}
diff --git a/src/Java/binnie/core/machines/inventory/IInventoryMachine.java b/src/Java/binnie/core/machines/inventory/IInventoryMachine.java
deleted file mode 100644
index 5c0c0a997f..0000000000
--- a/src/Java/binnie/core/machines/inventory/IInventoryMachine.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.core.machines.inventory;
-
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.ISidedInventory;
-
-public abstract interface IInventoryMachine
- extends IInventory, ISidedInventory, IValidatedInventory
-{}
diff --git a/src/Java/binnie/core/machines/inventory/IInventorySlots.java b/src/Java/binnie/core/machines/inventory/IInventorySlots.java
deleted file mode 100644
index c860f00a63..0000000000
--- a/src/Java/binnie/core/machines/inventory/IInventorySlots.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package binnie.core.machines.inventory;
-
-public abstract interface IInventorySlots
-{
- public abstract InventorySlot addSlot(int paramInt, String paramString);
-
- public abstract InventorySlot[] addSlotArray(int[] paramArrayOfInt, String paramString);
-
- public abstract InventorySlot getSlot(int paramInt);
-
- public abstract InventorySlot[] getSlots(int[] paramArrayOfInt);
-
- public abstract InventorySlot[] getAllSlots();
-}
diff --git a/src/Java/binnie/core/machines/inventory/IValidatedInventory.java b/src/Java/binnie/core/machines/inventory/IValidatedInventory.java
deleted file mode 100644
index 56543612c8..0000000000
--- a/src/Java/binnie/core/machines/inventory/IValidatedInventory.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package binnie.core.machines.inventory;
-
-import net.minecraft.inventory.IInventory;
-
-abstract interface IValidatedInventory
- extends IInventory
-{
- public abstract boolean isReadOnly(int paramInt);
-}
diff --git a/src/Java/binnie/core/machines/inventory/IValidatedTankContainer.java b/src/Java/binnie/core/machines/inventory/IValidatedTankContainer.java
deleted file mode 100644
index 6ca868ce02..0000000000
--- a/src/Java/binnie/core/machines/inventory/IValidatedTankContainer.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package binnie.core.machines.inventory;
-
-import net.minecraftforge.fluids.FluidStack;
-
-public abstract interface IValidatedTankContainer
-{
- public abstract boolean isTankReadOnly(int paramInt);
-
- public abstract boolean isLiquidValidForTank(FluidStack paramFluidStack, int paramInt);
-}
diff --git a/src/Java/binnie/core/machines/inventory/InventorySlot.java b/src/Java/binnie/core/machines/inventory/InventorySlot.java
deleted file mode 100644
index bfa904176a..0000000000
--- a/src/Java/binnie/core/machines/inventory/InventorySlot.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package binnie.core.machines.inventory;
-
-import binnie.Binnie;
-import binnie.core.BinnieCore;
-import binnie.core.language.ManagerLanguage;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class InventorySlot
- extends BaseSlot<ItemStack>
-{
- public static enum Type
- {
- Standard, Recipe;
-
- private Type() {}
- }
-
- private ItemStack itemStack = null;
- private Type type = Type.Standard;
-
- public InventorySlot(int index, String unlocName)
- {
- super(index, unlocName);
- }
-
- public ItemStack getContent()
- {
- return this.itemStack;
- }
-
- public ItemStack getItemStack()
- {
- return getContent();
- }
-
- public void setContent(ItemStack itemStack)
- {
- this.itemStack = itemStack;
- }
-
- public ItemStack decrStackSize(int amount)
- {
- if (this.itemStack == null) {
- return null;
- }
- if (this.itemStack.stackSize <= amount)
- {
- ItemStack returnStack = this.itemStack.copy();
- this.itemStack = null;
- return returnStack;
- }
- ItemStack returnStack = this.itemStack.copy();
- this.itemStack.stackSize -= amount;
- returnStack.stackSize = amount;
- return returnStack;
- }
-
- public void readFromNBT(NBTTagCompound slotNBT)
- {
- if (slotNBT.hasKey("item"))
- {
- NBTTagCompound itemNBT = slotNBT.getCompoundTag("item");
- this.itemStack = ItemStack.loadItemStackFromNBT(itemNBT);
- }
- else
- {
- this.itemStack = null;
- }
- }
-
- public void writeToNBT(NBTTagCompound slotNBT)
- {
- NBTTagCompound itemNBT = new NBTTagCompound();
- if (this.itemStack != null) {
- this.itemStack.writeToNBT(itemNBT);
- }
- slotNBT.setTag("item", itemNBT);
- }
-
- public void setItemStack(ItemStack duplicate)
- {
- setContent(duplicate);
- }
-
- public SlotValidator getValidator()
- {
- return (SlotValidator)this.validator;
- }
-
- public void setType(Type type)
- {
- this.type = type;
- if (type == Type.Recipe)
- {
- setReadOnly();
- forbidInteraction();
- }
- }
-
- public Type getType()
- {
- return this.type;
- }
-
- public boolean isRecipe()
- {
- return this.type == Type.Recipe;
- }
-
- public String getName()
- {
- return Binnie.Language.localise(BinnieCore.instance, "gui.slot." + this.unlocName);
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/MachineSide.java b/src/Java/binnie/core/machines/inventory/MachineSide.java
deleted file mode 100644
index cba1c7417b..0000000000
--- a/src/Java/binnie/core/machines/inventory/MachineSide.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package binnie.core.machines.inventory;
-
-import java.util.Collection;
-import java.util.EnumSet;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class MachineSide
-{
- private static EnumSet<ForgeDirection> All = EnumSet.of(ForgeDirection.UP, new ForgeDirection[] { ForgeDirection.DOWN, ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST });
- public static EnumSet<ForgeDirection> TopAndBottom = EnumSet.of(ForgeDirection.UP, ForgeDirection.DOWN);
- public static EnumSet<ForgeDirection> None = EnumSet.noneOf(ForgeDirection.class);
- public static EnumSet<ForgeDirection> Top = EnumSet.of(ForgeDirection.UP);
- public static EnumSet<ForgeDirection> Bottom = EnumSet.of(ForgeDirection.DOWN);
- public static EnumSet<ForgeDirection> Sides = EnumSet.of(ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST);
-
- public static String asString(Collection<ForgeDirection> sides)
- {
- if (sides.containsAll(All)) {
- return "Any";
- }
- if (sides.isEmpty()) {
- return "None";
- }
- String text = "";
- if (sides.contains(ForgeDirection.UP))
- {
- if (sides.size() > 0) {
- text = text + ", ";
- }
- text = text + "Up";
- }
- if (sides.contains(ForgeDirection.DOWN))
- {
- if (sides.size() > 0) {
- text = text + ", ";
- }
- text = text + "Down";
- }
- if (sides.containsAll(Sides))
- {
- if (sides.size() > 0) {
- text = text + ", ";
- }
- text = text + "Sides";
- }
- else
- {
- if (sides.contains(ForgeDirection.NORTH))
- {
- if (sides.size() > 0) {
- text = text + ", ";
- }
- text = text + "North";
- }
- if (sides.contains(ForgeDirection.EAST))
- {
- if (sides.size() > 0) {
- text = text + ", ";
- }
- text = text + "East";
- }
- if (sides.contains(ForgeDirection.SOUTH))
- {
- if (sides.size() > 0) {
- text = text + ", ";
- }
- text = text + "South";
- }
- if (sides.contains(ForgeDirection.WEST))
- {
- if (sides.size() > 0) {
- text = text + ", ";
- }
- text = text + "West";
- }
- }
- return text;
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/SetList.java b/src/Java/binnie/core/machines/inventory/SetList.java
deleted file mode 100644
index 41c455a2fc..0000000000
--- a/src/Java/binnie/core/machines/inventory/SetList.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package binnie.core.machines.inventory;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Set;
-
-public class SetList<E>
- extends ArrayList<E>
- implements Set<E>
-{
- private static final long serialVersionUID = 1277112003159980135L;
-
- public boolean add(E e)
- {
- return contains(e) ? false : super.add(e);
- }
-
- public void add(int index, E e)
- {
- if (!contains(e)) {
- super.add(index, e);
- }
- }
-
- public boolean addAll(Collection<? extends E> c)
- {
- return addAll(size(), c);
- }
-
- public boolean addAll(int index, Collection<? extends E> c)
- {
- Collection<E> copy = new ArrayList(c);
- copy.removeAll(this);
- return super.addAll(index, copy);
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/SidedAccess.java b/src/Java/binnie/core/machines/inventory/SidedAccess.java
deleted file mode 100644
index ee505891e2..0000000000
--- a/src/Java/binnie/core/machines/inventory/SidedAccess.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package binnie.core.machines.inventory;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import net.minecraftforge.common.util.ForgeDirection;
-
-class SidedAccess
-{
- private Map<ForgeDirection, AccessDirection> accesses = new HashMap();
- private AccessDirection base = AccessDirection.Both;
- private boolean insertLocked = false;
- private boolean extractLocked = false;
-
- public AccessDirection getAccess(ForgeDirection side)
- {
- return this.accesses.containsKey(side) ? (AccessDirection)this.accesses.get(side) : this.base;
- }
-
- public boolean canInsert(ForgeDirection side)
- {
- return getAccess(side).canInsert();
- }
-
- public boolean canExtract(ForgeDirection side)
- {
- return getAccess(side).canExtract();
- }
-
- public boolean canAccess(ForgeDirection side)
- {
- return getAccess(side).canAccess();
- }
-
- public boolean canChangeInsert()
- {
- return !this.insertLocked;
- }
-
- public boolean canChangeExtract()
- {
- return !this.extractLocked;
- }
-
- public void forbidInsertChange()
- {
- this.insertLocked = true;
- }
-
- public void forbidExtractChange()
- {
- this.extractLocked = true;
- }
-
- public Collection<ForgeDirection> getInsertionSides()
- {
- List<ForgeDirection> dirs = new ArrayList();
- for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
- if (getAccess(dir).canInsert()) {
- dirs.add(dir);
- }
- }
- return dirs;
- }
-
- public Collection<ForgeDirection> getExtractionSides()
- {
- List<ForgeDirection> dirs = new ArrayList();
- for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
- if (getAccess(dir).canExtract()) {
- dirs.add(dir);
- }
- }
- return dirs;
- }
-
- public void setInsert(ForgeDirection side, boolean b)
- {
- if (getAccess(side).canInsert() != b) {
- this.accesses.put(side, getAccess(side).changeInsert(b));
- }
- }
-
- public void setExtract(ForgeDirection side, boolean b)
- {
- if (getAccess(side).canExtract() != b) {
- this.accesses.put(side, getAccess(side).changeExtract(b));
- }
- }
-
- public void setInsert(boolean b)
- {
- if (this.base.canInsert() != b) {
- this.base = this.base.changeInsert(b);
- }
- }
-
- public void setExtract(boolean b)
- {
- if (this.base.canExtract() != b) {
- this.base = this.base.changeExtract(b);
- }
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/SlotValidator.java b/src/Java/binnie/core/machines/inventory/SlotValidator.java
deleted file mode 100644
index 0e0aab4e03..0000000000
--- a/src/Java/binnie/core/machines/inventory/SlotValidator.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package binnie.core.machines.inventory;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-import forestry.api.genetics.AlleleManager;
-
-public abstract class SlotValidator
- extends Validator<ItemStack>
-{
- public static ValidatorIcon IconBee;
- public static ValidatorIcon IconFrame;
- public static ValidatorIcon IconCircuit;
- public static ValidatorIcon IconBlock;
- private ValidatorIcon icon;
-
- public SlotValidator(ValidatorIcon icon)
- {
- this.icon = icon;
- }
-
- public IIcon getIcon(boolean input)
- {
- return this.icon == null ? null : this.icon.getIcon(input).getIcon();
- }
-
- public static class Item
- extends SlotValidator
- {
- private ItemStack target;
-
- public Item(ItemStack target, ValidatorIcon icon)
- {
- super(icon);
- this.target = target;
- }
-
- public boolean isValid(ItemStack itemStack)
- {
- return itemStack.isItemEqual(this.target);
- }
-
- public String getTooltip()
- {
- return this.target.getDisplayName();
- }
- }
-
- public static class Individual
- extends SlotValidator
- {
- public Individual()
- {
- super(IconBee);
- }
-
- public boolean isValid(ItemStack itemStack)
- {
- return AlleleManager.alleleRegistry.getIndividual(itemStack) != null;
- }
-
- public String getTooltip()
- {
- return "Breedable Individual";
- }
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/TankSlot.java b/src/Java/binnie/core/machines/inventory/TankSlot.java
deleted file mode 100644
index 275ebfd646..0000000000
--- a/src/Java/binnie/core/machines/inventory/TankSlot.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package binnie.core.machines.inventory;
-
-import binnie.Binnie;
-import binnie.core.BinnieCore;
-import binnie.core.language.ManagerLanguage;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTank;
-import net.minecraftforge.fluids.IFluidTank;
-
-public class TankSlot
- extends BaseSlot<FluidStack>
-{
- public static final String NameJuice = "Juice Tank";
- public static final String NameWater = "Water Tank";
- public static String NameCupboard = "Cupboard Slot";
- private FluidTank tank;
-
- public TankSlot(int index, String name, int capacity)
- {
- super(index, name);
- this.tank = new FluidTank(capacity);
- }
-
- public void readFromNBT(NBTTagCompound nbttagcompound)
- {
- FluidStack liquid = FluidStack.loadFluidStackFromNBT(nbttagcompound);
-
- setContent(liquid);
- }
-
- public void writeToNBT(NBTTagCompound nbttagcompound)
- {
- if (getContent() != null) {
- getContent().writeToNBT(nbttagcompound);
- }
- }
-
- public FluidStack getContent()
- {
- return this.tank.getFluid();
- }
-
- public void setContent(FluidStack itemStack)
- {
- this.tank.setFluid(itemStack);
- }
-
- public IFluidTank getTank()
- {
- return this.tank;
- }
-
- public String getName()
- {
- return Binnie.Language.localise(BinnieCore.instance, "gui.slot." + this.unlocName);
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/TransferHandler.java b/src/Java/binnie/core/machines/inventory/TransferHandler.java
deleted file mode 100644
index 1fa4b2cac5..0000000000
--- a/src/Java/binnie/core/machines/inventory/TransferHandler.java
+++ /dev/null
@@ -1,227 +0,0 @@
-package binnie.core.machines.inventory;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.power.ITankMachine;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidContainerRegistry;
-import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidTank;
-
-public class TransferHandler
-{
- public static ItemStack transfer(ItemStack item, IInventory origin, IInventory destination, boolean doAdd)
- {
- ItemStack ret = transferItemToInventory(item, destination, doAdd);
- if ((destination instanceof ITankMachine))
- {
- ret = transferContainerIntoTank(ret, origin, (ITankMachine)destination, doAdd);
- ret = transferTankIntoContainer(ret, origin, (ITankMachine)destination, doAdd);
- }
- return ret;
- }
-
- public static ItemStack transferItemToInventory(ItemStack item, IInventory destination, boolean doAdd)
- {
- if ((item == null) || (destination == null)) {
- return item;
- }
- ItemStack addition = item.copy();
- for (int i = 0; i < destination.getSizeInventory(); i++)
- {
- addition = transferToInventory(addition, destination, new int[] { i }, doAdd, false);
- if (addition == null) {
- return null;
- }
- }
- return addition;
- }
-
- public static ItemStack transferToInventory(ItemStack item, IInventory destination, int[] targetSlots, boolean doAdd, boolean ignoreValidation)
- {
- for (int i : targetSlots) {
- if ((destination.isItemValidForSlot(i, item)) || (ignoreValidation))
- {
- if (destination.getStackInSlot(i) == null)
- {
- if (doAdd) {
- destination.setInventorySlotContents(i, item.copy());
- }
- return null;
- }
- if (item.isStackable())
- {
- ItemStack merged = destination.getStackInSlot(i).copy();
- ItemStack[] newStacks = mergeStacks(item.copy(), merged.copy());
- item = newStacks[0];
- if (doAdd) {
- destination.setInventorySlotContents(i, newStacks[1]);
- }
- if (item == null) {
- return null;
- }
- }
- }
- }
- return item;
- }
-
- public static ItemStack[] mergeStacks(ItemStack itemstack, ItemStack merged)
- {
- if ((ItemStack.areItemStackTagsEqual(itemstack, merged)) && (itemstack.isItemEqual(merged)))
- {
- int space = merged.getMaxStackSize() - merged.stackSize;
- if (space > 0) {
- if (itemstack.stackSize > space)
- {
- itemstack.stackSize -= space;
- merged.stackSize += space;
- }
- else if (itemstack.stackSize <= space)
- {
- merged.stackSize += itemstack.stackSize;
- itemstack = null;
- }
- }
- }
- return new ItemStack[] { itemstack, merged };
- }
-
- public static ItemStack transferContainerIntoTank(ItemStack item, IInventory origin, ITankMachine destination, boolean doAdd)
- {
- if (item == null) {
- return null;
- }
- IFluidTank[] tanks = destination.getTanks();
- ItemStack stack = item.copy();
- for (int i = 0; i < tanks.length; i++) {
- stack = transferToTank(stack, origin, destination, i, doAdd);
- }
- return stack;
- }
-
- public static ItemStack transferTankIntoContainer(ItemStack item, IInventory origin, ITankMachine destination, boolean doAdd)
- {
- if (item == null) {
- return null;
- }
- IFluidTank[] tanks = destination.getTanks();
- ItemStack stack = item.copy();
- for (int i = 0; i < tanks.length; i++) {
- stack = transferFromTank(stack, origin, destination, i, doAdd);
- }
- return stack;
- }
-
- public static ItemStack transferToTank(ItemStack item, IInventory origin, ITankMachine destination, int tankID, boolean doAdd)
- {
- if (item == null) {
- return item;
- }
- FluidStack containerLiquid = null;
- FluidContainerRegistry.FluidContainerData containerLiquidData = null;
- for (FluidContainerRegistry.FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if (data.filledContainer.isItemEqual(item))
- {
- containerLiquidData = data;
- containerLiquid = data.fluid.copy();
- break;
- }
- }
- if (containerLiquid == null) {
- return item;
- }
- IFluidTank tank = destination.getTanks()[tankID];
-
- IValidatedTankContainer validated = (IValidatedTankContainer)Machine.getInterface(IValidatedTankContainer.class, destination);
- if ((validated != null) &&
- (!validated.isLiquidValidForTank(containerLiquid, tankID))) {
- return item;
- }
- FluidStack largeAmountOfLiquid = containerLiquid.copy();
- largeAmountOfLiquid.amount = tank.getCapacity();
- int amountAdded = tank.fill(largeAmountOfLiquid, false);
-
- int numberOfContainersToAdd = amountAdded / containerLiquid.amount;
- if (numberOfContainersToAdd > item.stackSize) {
- numberOfContainersToAdd = item.stackSize;
- }
- ItemStack leftOverContainers = item.copy();
- leftOverContainers.stackSize -= numberOfContainersToAdd;
- if (leftOverContainers.stackSize <= 0) {
- leftOverContainers = null;
- }
- ItemStack emptyContainers = containerLiquidData.emptyContainer.copy();
- emptyContainers.stackSize = 0;
- emptyContainers.stackSize += numberOfContainersToAdd;
- if (emptyContainers.stackSize <= 0) {
- emptyContainers = null;
- }
- ItemStack containersThatCantBeDumped = transferItemToInventory(emptyContainers, origin, false);
- if (containersThatCantBeDumped != null) {
- return item;
- }
- if (doAdd)
- {
- FluidStack liquidToFillTank = containerLiquid.copy();
- liquidToFillTank.amount *= numberOfContainersToAdd;
- tank.fill(liquidToFillTank, true);
- transferItemToInventory(emptyContainers, origin, true);
- }
- return leftOverContainers;
- }
-
- public static ItemStack transferFromTank(ItemStack item, IInventory origin, ITankMachine destination, int tankID, boolean doAdd)
- {
- if (item == null) {
- return item;
- }
- IFluidTank tank = destination.getTanks()[tankID];
- FluidStack liquidInTank = tank.getFluid();
- if (liquidInTank == null) {
- return item;
- }
- FluidContainerRegistry.FluidContainerData containerLiquidData = null;
- for (FluidContainerRegistry.FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if ((data.emptyContainer.isItemEqual(item)) && (liquidInTank.isFluidEqual(data.fluid)))
- {
- containerLiquidData = data;
- break;
- }
- }
- if (containerLiquidData == null) {
- return item;
- }
- int maximumExtractedLiquid = item.stackSize * containerLiquidData.fluid.amount;
-
- FluidStack drainedLiquid = tank.drain(maximumExtractedLiquid, false);
- int amountInTank = drainedLiquid == null ? 0 : drainedLiquid.amount;
-
- int numberOfContainersToFill = amountInTank / containerLiquidData.fluid.amount;
- if (numberOfContainersToFill > item.stackSize) {
- numberOfContainersToFill = item.stackSize;
- }
- ItemStack leftOverContainers = item.copy();
- leftOverContainers.stackSize -= numberOfContainersToFill;
- if (leftOverContainers.stackSize <= 0) {
- leftOverContainers = null;
- }
- ItemStack filledContainers = containerLiquidData.filledContainer.copy();
- filledContainers.stackSize = 0;
- filledContainers.stackSize += numberOfContainersToFill;
- if (filledContainers.stackSize <= 0) {
- filledContainers = null;
- }
- ItemStack containersThatCantBeDumped = transferItemToInventory(filledContainers, origin, false);
- if (containersThatCantBeDumped != null) {
- return item;
- }
- if (doAdd)
- {
- tank.drain(maximumExtractedLiquid, true);
- transferItemToInventory(filledContainers, origin, true);
- }
- return leftOverContainers;
- }
-}
diff --git a/src/Java/binnie/core/machines/inventory/Validator.java b/src/Java/binnie/core/machines/inventory/Validator.java
deleted file mode 100644
index f8dddf7fae..0000000000
--- a/src/Java/binnie/core/machines/inventory/Validator.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package binnie.core.machines.inventory;
-
-import binnie.core.util.IValidator;
-
-public abstract class Validator<T>
- implements IValidator<T>
-{
- public abstract String getTooltip();
-}
diff --git a/src/Java/binnie/core/machines/inventory/ValidatorIcon.java b/src/Java/binnie/core/machines/inventory/ValidatorIcon.java
deleted file mode 100644
index ff7f1ecb1e..0000000000
--- a/src/Java/binnie/core/machines/inventory/ValidatorIcon.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package binnie.core.machines.inventory;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import binnie.core.resource.BinnieIcon;
-import binnie.core.resource.ManagerResource;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ValidatorIcon
-{
- private List<BinnieIcon> iconsInput = new ArrayList();
- private List<BinnieIcon> iconsOutput = new ArrayList();
-
- public ValidatorIcon(AbstractMod mod, String pathInput, String pathOutput)
- {
- this.iconsInput.add(Binnie.Resource.getItemIcon(mod, pathInput));
- this.iconsOutput.add(Binnie.Resource.getItemIcon(mod, pathOutput));
- }
-
- public BinnieIcon getIcon(boolean input)
- {
- return input ? (BinnieIcon)this.iconsInput.get(0) : (BinnieIcon)this.iconsOutput.get(0);
- }
-}
diff --git a/src/Java/binnie/core/machines/network/INetwork.java b/src/Java/binnie/core/machines/network/INetwork.java
deleted file mode 100644
index 90b5621bed..0000000000
--- a/src/Java/binnie/core/machines/network/INetwork.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package binnie.core.machines.network;
-
-import cpw.mods.fml.relauncher.Side;
-import java.util.Map;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-
-public abstract interface INetwork
-{
- public static abstract interface SendGuiNBT
- {
- public abstract void sendGuiNBT(Map<String, NBTTagCompound> paramMap);
- }
-
- public static abstract interface TilePacketSync
- {
- public abstract void syncToNBT(NBTTagCompound paramNBTTagCompound);
-
- public abstract void syncFromNBT(NBTTagCompound paramNBTTagCompound);
- }
-
- public static abstract interface RecieveGuiNBT
- {
- public abstract void recieveGuiNBT(Side paramSide, EntityPlayer paramEntityPlayer, String paramString, NBTTagCompound paramNBTTagCompound);
- }
-
- public static abstract interface GuiNBT
- extends INetwork.RecieveGuiNBT, INetwork.SendGuiNBT
- {}
-}
diff --git a/src/Java/binnie/core/machines/power/ComponentPowerReceptor.java b/src/Java/binnie/core/machines/power/ComponentPowerReceptor.java
deleted file mode 100644
index 5392ea7012..0000000000
--- a/src/Java/binnie/core/machines/power/ComponentPowerReceptor.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package binnie.core.machines.power;
-
-import ic2.api.energy.event.EnergyTileLoadEvent;
-import ic2.api.energy.event.EnergyTileUnloadEvent;
-import ic2.api.energy.tile.IEnergyTile;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import miscutil.core.lib.LoadedMods;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.common.util.ForgeDirection;
-import binnie.core.machines.IMachine;
-import binnie.core.machines.MachineComponent;
-import binnie.core.machines.component.IBuildcraft;
-import binnie.core.machines.component.IInteraction;
-import binnie.core.triggers.TriggerData;
-import binnie.core.triggers.TriggerPower;
-
-public class ComponentPowerReceptor
- extends MachineComponent
- implements IPoweredMachine, IBuildcraft.TriggerProvider, IInteraction.ChunkUnload, IInteraction.Invalidation
-{
- private boolean registeredToIC2EnergyNet = false;
- float previousPower = 0.0F;
- LinkedList<Float> inputs = new LinkedList();
- static final int inputAverageTicks = 20;
- private PowerInterface container;
-
- public ComponentPowerReceptor(IMachine machine)
- {
- this(machine, 1000);
- }
-
- public ComponentPowerReceptor(IMachine machine, int storage)
- {
- super(machine);
- this.container = new PowerInterface(storage);
- if (!this.registeredToIC2EnergyNet) {
- addToEnergyNet();
- }
- }
-
- public void readFromNBT(NBTTagCompound nbttagcompound)
- {
- super.readFromNBT(nbttagcompound);
- this.container.readFromNBT(nbttagcompound);
- if (!this.registeredToIC2EnergyNet) {
- addToEnergyNet();
- }
- }
-
- public void writeToNBT(NBTTagCompound nbttagcompound)
- {
- super.writeToNBT(nbttagcompound);
- this.container.writeToNBT(nbttagcompound);
- }
-
- public void onUpdate()
- {
- if ((!this.registeredToIC2EnergyNet) && (!getMachine().getTileEntity().isInvalid())) {
- addToEnergyNet();
- }
- }
-
- public PowerInfo getPowerInfo()
- {
- return new PowerInfo(this, 0.0F);
- }
-
- public final void getTriggers(List<TriggerData> triggers)
- {
- triggers.add(TriggerPower.powerNone(this));
- triggers.add(TriggerPower.powerLow(this));
- triggers.add(TriggerPower.powerMedium(this));
- triggers.add(TriggerPower.powerHigh(this));
- triggers.add(TriggerPower.powerFull(this));
- }
-
- public double getDemandedEnergy()
- {
- return this.container.getEnergySpace(PowerSystem.EU);
- }
-
-
- public int getSinkTier()
- {
- return 1;
- }
-
-
- public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage)
- {
- this.container.addEnergy(PowerSystem.EU, amount, true);
- return 0.0D;
- }
-
-
- public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
- {
- return acceptsPowerSystem(PowerSystem.EU);
- }
-
- public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
- {
- return (int)this.container.addEnergy(PowerSystem.RF, maxReceive, !simulate);
- }
-
- public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
- {
- return 0;
- }
-
- public int getEnergyStored(ForgeDirection from)
- {
- return (int)this.container.getEnergy(PowerSystem.RF);
- }
-
- public int getMaxEnergyStored(ForgeDirection from)
- {
- return (int)this.container.getCapacity(PowerSystem.RF);
- }
-
- public boolean canConnectEnergy(ForgeDirection from)
- {
- boolean can = acceptsPowerSystem(PowerSystem.RF);
- return can;
- }
-
- public PowerInterface getInterface()
- {
- return this.container;
- }
-
- private boolean acceptsPowerSystem(PowerSystem system)
- {
- return true;
- }
-
- public void onInvalidation()
- {
- removeFromEnergyNet();
- }
-
- public void onChunkUnload()
- {
- removeFromEnergyNet();
- }
-
- private void addToEnergyNet()
- {
- if (getMachine().getWorld() == null) {
- return;
- }
- if (LoadedMods.IndustrialCraft2) {
- do_addToEnergyNet();
- }
- }
-
- private void removeFromEnergyNet()
- {
- if (getMachine().getWorld() == null) {
- return;
- }
- if (LoadedMods.IndustrialCraft2) {
- do_removeFromEnergyNet();
- }
- }
-
- private void do_addToEnergyNet()
- {
- MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent((IEnergyTile)getMachine().getTileEntity()));
- this.registeredToIC2EnergyNet = true;
- }
-
- private void do_removeFromEnergyNet()
- {
- MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)getMachine().getTileEntity()));
- this.registeredToIC2EnergyNet = false;
- }
-}
diff --git a/src/Java/binnie/core/machines/power/ComponentProcess.java b/src/Java/binnie/core/machines/power/ComponentProcess.java
deleted file mode 100644
index b49e919e2d..0000000000
--- a/src/Java/binnie/core/machines/power/ComponentProcess.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package binnie.core.machines.power;
-
-import binnie.core.machines.IMachine;
-import net.minecraft.nbt.NBTTagCompound;
-
-public abstract class ComponentProcess
- extends ComponentProcessIndefinate
- implements IProcessTimed
-{
- private float progressAmount = 0.0F;
-
- public ComponentProcess(IMachine machine)
- {
- super(machine, 0.0F);
- }
-
- public float getEnergyPerTick()
- {
- return getProcessEnergy() / getProcessLength();
- }
-
- public float getProgressPerTick()
- {
- return 100.0F / getProcessLength();
- }
-
- protected void onStartTask()
- {
- this.progressAmount += 0.01F;
- }
-
- protected void onCancelTask()
- {
- this.progressAmount = 0.0F;
- }
-
- public void onUpdate()
- {
- super.onUpdate();
- if (this.progressAmount >= 100.0F)
- {
- onFinishTask();
- this.progressAmount = 0.0F;
- }
- }
-
- public void alterProgress(float f)
- {
- this.progressAmount += f;
- }
-
- public void setProgress(float f)
- {
- this.progressAmount = f;
- }
-
- protected void progressTick()
- {
- super.progressTick();
- alterProgress(getProgressPerTick());
- }
-
- public boolean inProgress()
- {
- return this.progressAmount > 0.0F;
- }
-
- public float getProgress()
- {
- return this.progressAmount;
- }
-
- protected void onFinishTask() {}
-
- public void readFromNBT(NBTTagCompound nbt)
- {
- super.readFromNBT(nbt);
- this.progressAmount = nbt.getFloat("progress");
- }
-
- public void writeToNBT(NBTTagCompound nbt)
- {
- super.writeToNBT(nbt);
- nbt.setFloat("progress", this.progressAmount);
- }
-
- public abstract int getProcessLength();
-
- public abstract int getProcessEnergy();
-}
diff --git a/src/Java/binnie/core/machines/power/ComponentProcessIndefinate.java b/src/Java/binnie/core/machines/power/ComponentProcessIndefinate.java
deleted file mode 100644
index b4c81e0d62..0000000000
--- a/src/Java/binnie/core/machines/power/ComponentProcessIndefinate.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package binnie.core.machines.power;
-
-import net.minecraft.nbt.NBTTagCompound;
-import binnie.core.machines.IMachine;
-import binnie.core.machines.MachineComponent;
-import binnie.core.machines.network.INetwork;
-
-public abstract class ComponentProcessIndefinate
- extends MachineComponent
- implements IProcess, INetwork.TilePacketSync
-{
- private float energyPerTick = 0.1F;
- private boolean inProgress;
-
- public void syncFromNBT(NBTTagCompound nbt)
- {
- this.inProgress = nbt.getBoolean("progress");
- }
-
- public void syncToNBT(NBTTagCompound nbt)
- {
- nbt.setBoolean("progress", this.inProgress);
- }
-
- public ComponentProcessIndefinate(IMachine machine, float energyPerTick)
- {
- super(machine);
- this.energyPerTick = energyPerTick;
- }
-
- protected final IPoweredMachine getPower()
- {
- return (IPoweredMachine)getMachine().getInterface(IPoweredMachine.class);
- }
-
- public float getEnergyPerTick()
- {
- return this.energyPerTick;
- }
-
- private float actionPauseProcess = 0.0F;
- private float actionCancelTask = 0.0F;
-
- public void onUpdate()
- {
- float energyAvailable = (float)getPower().getInterface().useEnergy(PowerSystem.RF, getEnergyPerTick(), false);
- if (canWork() == null)
- {
- if ((!isInProgress()) && (canProgress() == null))
- {
- onStartTask();
- }
- else if (canProgress() == null)
- {
- progressTick();
- onTickTask();
- }
- }
- else if (isInProgress()) {
- onCancelTask();
- }
- if (this.actionPauseProcess > 0.0F) {
- this.actionPauseProcess -= 1.0F;
- }
- if (this.actionCancelTask > 0.0F) {
- this.actionCancelTask -= 1.0F;
- }
- super.onUpdate();
- if (this.inProgress != inProgress())
- {
- this.inProgress = inProgress();
- getUtil().refreshBlock();
- }
- }
-
- protected void progressTick()
- {
- getPower().getInterface().useEnergy(PowerSystem.RF, getEnergyPerTick(), true);
- }
-
- public ErrorState canWork()
- {
- return this.actionCancelTask == 0.0F ? null : new ErrorState("Task Cancelled", "Cancelled by Buildcraft Gate");
- }
-
- public ErrorState canProgress()
- {
- if (this.actionPauseProcess != 0.0F) {
- return new ErrorState("Process Paused", "Paused by Buildcraft Gate");
- }
- return getPower().getInterface().getEnergy(PowerSystem.RF) < getEnergyPerTick() ? new ErrorState.InsufficientPower() : null;
- }
-
- public final boolean isInProgress()
- {
- return this.inProgress;
- }
-
- int clientEnergyPerSecond = 0;
- int clientInProgress;
-
- protected abstract boolean inProgress();
-
- protected void onCancelTask() {}
-
- protected void onStartTask() {}
-
- protected void onTickTask() {}
-
- public String getTooltip()
- {
- return "Processing";
- }
-
- public final ProcessInfo getInfo()
- {
- return new ProcessInfo(this);
- }
-}
diff --git a/src/Java/binnie/core/machines/power/ComponentProcessSetCost.java b/src/Java/binnie/core/machines/power/ComponentProcessSetCost.java
deleted file mode 100644
index b269763136..0000000000
--- a/src/Java/binnie/core/machines/power/ComponentProcessSetCost.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package binnie.core.machines.power;
-
-import binnie.core.machines.IMachine;
-
-public class ComponentProcessSetCost
- extends ComponentProcess
-{
- private int processLength;
- private int processEnergy;
-
- public ComponentProcessSetCost(IMachine machine, int rfCost, int timePeriod)
- {
- super(machine);
- this.processLength = timePeriod;
- this.processEnergy = rfCost;
- }
-
- public int getProcessLength()
- {
- return this.processLength;
- }
-
- public int getProcessEnergy()
- {
- return this.processEnergy;
- }
-}
diff --git a/src/Java/binnie/core/machines/power/ErrorState.java b/src/Java/binnie/core/machines/power/ErrorState.java
deleted file mode 100644
index 65a3946829..0000000000
--- a/src/Java/binnie/core/machines/power/ErrorState.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package binnie.core.machines.power;
-
-import net.minecraft.nbt.NBTTagCompound;
-import forestry.api.core.INBTTagable;
-
-public class ErrorState
- implements INBTTagable
-{
- private String name = "";
- private String desc = "";
- private int[] data = new int[0];
- private boolean progress = false;
-
- public ErrorState(String name, String desc)
- {
- this.name = name;
- this.desc = desc;
- }
-
- public ErrorState(String name, String desc, int[] data)
- {
- this.name = name;
- this.desc = desc;
- this.data = data;
- }
-
- public String toString()
- {
- return this.name;
- }
-
- public String getTooltip()
- {
- return this.desc;
- }
-
- public int[] getData()
- {
- return this.data;
- }
-
- public boolean isProgress()
- {
- return this.progress;
- }
-
- public void setIsProgress()
- {
- this.progress = true;
- }
-
- public static class Item
- extends ErrorState
- {
- public Item(String name, String desc, int[] slots)
- {
- super(name, desc, slots);
- }
- }
-
- public static class Tank
- extends ErrorState
- {
- public Tank(String name, String desc, int[] slots)
- {
- super(name, desc, slots);
- }
- }
-
- public static class NoItem
- extends ErrorState.Item
- {
- public NoItem(String desc, int slot)
- {
- this(desc, new int[] { slot });
- }
-
- public NoItem(String desc, int[] slots)
- {
- super("null", desc, slots);
- }
- }
-
- public static class InvalidItem
- extends ErrorState.Item
- {
- public InvalidItem(String desc, int slot)
- {
- this("Invalid Item", desc, slot);
- }
-
- public InvalidItem(String name, String desc, int slot)
- {
- super(name, desc, new int[] { slot });
- }
- }
-
- public static class NoSpace
- extends ErrorState.Item
- {
- public NoSpace(String desc, int[] slots)
- {
- super("null", desc, slots);
- }
- }
-
- public static class InsufficientPower
- extends ErrorState
- {
- public InsufficientPower()
- {
- super("Not enough power to operate", ".");
- }
- }
-
- public static class TankSpace
- extends ErrorState.Tank
- {
- public TankSpace(String desc, int tank)
- {
- super("null", desc, new int[] { tank });
- }
- }
-
- public static class InsufficientLiquid
- extends ErrorState.Tank
- {
- public InsufficientLiquid(String desc, int tank)
- {
- super("null", desc, new int[] { tank });
- }
- }
-
- public static class InvalidRecipe
- extends ErrorState.Item
- {
- public InvalidRecipe(String string, int[] slots)
- {
- super("null", string, slots);
- }
- }
-
- public void readFromNBT(NBTTagCompound nbt)
- {
- this.name = nbt.getString("name");
- this.desc = nbt.getString("desc");
- this.data = nbt.getIntArray("data");
- this.itemError = nbt.getBoolean("item");
- this.tankError = nbt.getBoolean("tank");
- this.powerError = nbt.getBoolean("power");
- }
-
- public void writeToNBT(NBTTagCompound nbt)
- {
- nbt.setString("name", toString());
- nbt.setString("desc", getTooltip());
- nbt.setIntArray("data", this.data);
- if (isItemError()) {
- nbt.setBoolean("item", true);
- }
- if (isTankError()) {
- nbt.setBoolean("tank", true);
- }
- if (isPowerError()) {
- nbt.setBoolean("power", true);
- }
- }
-
- private boolean itemError = false;
- private boolean tankError = false;
- private boolean powerError = false;
-
- public boolean isItemError()
- {
- return (this.itemError) || ((this instanceof Item));
- }
-
- public boolean isTankError()
- {
- return (this.tankError) || ((this instanceof Tank));
- }
-
- public boolean isPowerError()
- {
- return (this.powerError) || ((this instanceof InsufficientPower));
- }
-}
diff --git a/src/Java/binnie/core/machines/power/IErrorStateSource.java b/src/Java/binnie/core/machines/power/IErrorStateSource.java
deleted file mode 100644
index bd2cd87d24..0000000000
--- a/src/Java/binnie/core/machines/power/IErrorStateSource.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.core.machines.power;
-
-public abstract interface IErrorStateSource
-{
- public abstract ErrorState canWork();
-
- public abstract ErrorState canProgress();
-}
diff --git a/src/Java/binnie/core/machines/power/IPoweredMachine.java b/src/Java/binnie/core/machines/power/IPoweredMachine.java
deleted file mode 100644
index 61b505e3d3..0000000000
--- a/src/Java/binnie/core/machines/power/IPoweredMachine.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package binnie.core.machines.power;
-
-import ic2.api.energy.tile.IEnergySink;
-import cofh.api.energy.IEnergyHandler;
-
-public abstract interface IPoweredMachine
- extends IEnergySink, IEnergyHandler
-{
- public abstract PowerInfo getPowerInfo();
-
- public abstract PowerInterface getInterface();
-}
diff --git a/src/Java/binnie/core/machines/power/IProcess.java b/src/Java/binnie/core/machines/power/IProcess.java
deleted file mode 100644
index 83337cd980..0000000000
--- a/src/Java/binnie/core/machines/power/IProcess.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package binnie.core.machines.power;
-
-public abstract interface IProcess
- extends IErrorStateSource
-{
- public abstract float getEnergyPerTick();
-
- public abstract String getTooltip();
-
- public abstract boolean isInProgress();
-
- public abstract ProcessInfo getInfo();
-}
diff --git a/src/Java/binnie/core/machines/power/IProcessTimed.java b/src/Java/binnie/core/machines/power/IProcessTimed.java
deleted file mode 100644
index 1489d8837f..0000000000
--- a/src/Java/binnie/core/machines/power/IProcessTimed.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package binnie.core.machines.power;
-
-abstract interface IProcessTimed
- extends IProcess, IErrorStateSource
-{
- public abstract int getProcessLength();
-
- public abstract int getProcessEnergy();
-
- public abstract float getProgress();
-
- public abstract float getProgressPerTick();
-}
diff --git a/src/Java/binnie/core/machines/power/ITankMachine.java b/src/Java/binnie/core/machines/power/ITankMachine.java
deleted file mode 100644
index fa92845cb7..0000000000
--- a/src/Java/binnie/core/machines/power/ITankMachine.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package binnie.core.machines.power;
-
-import binnie.core.machines.inventory.IValidatedTankContainer;
-import binnie.core.machines.inventory.TankSlot;
-import net.minecraftforge.fluids.IFluidHandler;
-import net.minecraftforge.fluids.IFluidTank;
-
-public abstract interface ITankMachine
- extends IFluidHandler, IValidatedTankContainer
-{
- public abstract TankInfo[] getTankInfos();
-
- public abstract IFluidTank[] getTanks();
-
- public abstract TankSlot addTank(int paramInt1, String paramString, int paramInt2);
-
- public abstract IFluidTank getTank(int paramInt);
-
- public abstract TankSlot getTankSlot(int paramInt);
-}
diff --git a/src/Java/binnie/core/machines/power/PowerInfo.java b/src/Java/binnie/core/machines/power/PowerInfo.java
deleted file mode 100644
index 2c57f2c898..0000000000
--- a/src/Java/binnie/core/machines/power/PowerInfo.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package binnie.core.machines.power;
-
-import forestry.api.core.INBTTagable;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class PowerInfo
- implements INBTTagable
-{
- private float currentEnergy = 0.0F;
- private float maxEnergy = 0.0F;
-
- public PowerInfo(IPoweredMachine machine, float currentInput)
- {
- this.currentEnergy = ((float)machine.getInterface().getEnergy(PowerSystem.RF));
- this.maxEnergy = ((float)machine.getInterface().getCapacity(PowerSystem.RF));
- }
-
- public PowerInfo() {}
-
- public int getStoredEnergy()
- {
- return (int)this.currentEnergy;
- }
-
- public int getMaxEnergy()
- {
- return (int)this.maxEnergy;
- }
-
- public void readFromNBT(NBTTagCompound nbttagcompound)
- {
- this.currentEnergy = nbttagcompound.getInteger("current");
- this.maxEnergy = nbttagcompound.getInteger("max");
- }
-
- public void writeToNBT(NBTTagCompound nbttagcompound)
- {
- nbttagcompound.setInteger("current", getStoredEnergy());
- nbttagcompound.setInteger("max", getMaxEnergy());
- }
-}
diff --git a/src/Java/binnie/core/machines/power/PowerInterface.java b/src/Java/binnie/core/machines/power/PowerInterface.java
deleted file mode 100644
index e7e91bc18a..0000000000
--- a/src/Java/binnie/core/machines/power/PowerInterface.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package binnie.core.machines.power;
-
-import forestry.api.core.INBTTagable;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class PowerInterface
- implements INBTTagable
-{
- private int capacity;
- private int energy;
-
- public PowerInterface(int capacity)
- {
- this.capacity = (capacity * 100);
- this.energy = 0;
- }
-
- public int getCapacity()
- {
- return this.capacity;
- }
-
- public int getEnergy()
- {
- return this.energy;
- }
-
- public int addEnergy(int amount, boolean shouldDo)
- {
- int added = Math.min(getEnergySpace(), amount);
- if (shouldDo) {
- this.energy += added;
- }
- return added;
- }
-
- public int useEnergy(int amount, boolean simulate)
- {
- int added = Math.min(getEnergy(), amount);
- if (simulate) {
- this.energy -= added;
- }
- return added;
- }
-
- public int getEnergySpace()
- {
- return getCapacity() - getEnergy();
- }
-
- public double addEnergy(PowerSystem unit, double amount, boolean simulate)
- {
- return unit.convertTo(addEnergy(unit.convertFrom(amount), simulate));
- }
-
- public double useEnergy(PowerSystem unit, double amount, boolean simulate)
- {
- return unit.convertTo(useEnergy(unit.convertFrom(amount), simulate));
- }
-
- public double getEnergy(PowerSystem unit)
- {
- return unit.convertTo(getEnergy());
- }
-
- public double getCapacity(PowerSystem unit)
- {
- return unit.convertTo(getCapacity());
- }
-
- public double getEnergySpace(PowerSystem unit)
- {
- return unit.convertTo(getEnergySpace());
- }
-
- public void readFromNBT(NBTTagCompound nbt)
- {
- this.energy = nbt.getInteger("Energy");
- if (this.energy > this.capacity) {
- this.energy = this.capacity;
- } else if (this.energy < 0) {
- this.energy = 0;
- }
- }
-
- public void writeToNBT(NBTTagCompound nbt)
- {
- nbt.setInteger("Energy", getEnergy());
- }
-}
diff --git a/src/Java/binnie/core/machines/power/PowerSystem.java b/src/Java/binnie/core/machines/power/PowerSystem.java
deleted file mode 100644
index 58c1cf9709..0000000000
--- a/src/Java/binnie/core/machines/power/PowerSystem.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package binnie.core.machines.power;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-public enum PowerSystem
-{
- MJ(100.0D), RF(10.0D), EU(40.0D);
-
- double conversion;
-
- private PowerSystem(double conversion)
- {
- this.conversion = conversion;
- }
-
- public double convertTo(int value)
- {
- return value / this.conversion;
- }
-
- public int convertFrom(double value)
- {
- return (int)(value * this.conversion);
- }
-
- public static PowerSystem get(int i)
- {
- return values()[(i % values().length)];
- }
-
- public String getUnitName()
- {
- return name();
- }
-
- public ItemStack saveTo(ItemStack stack)
- {
- NBTTagCompound tag = stack.hasTagCompound() ? stack.getTagCompound() : new NBTTagCompound();
- tag.setByte("power-system", (byte)ordinal());
- stack.setTagCompound(tag);
- return stack;
- }
-}
diff --git a/src/Java/binnie/core/machines/power/ProcessInfo.java b/src/Java/binnie/core/machines/power/ProcessInfo.java
deleted file mode 100644
index 7b4a9bd8a4..0000000000
--- a/src/Java/binnie/core/machines/power/ProcessInfo.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package binnie.core.machines.power;
-
-import forestry.api.core.INBTTagable;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class ProcessInfo
- implements INBTTagable
-{
- private float currentProgress = 0.0F;
- private int processEnergy = 0;
- private int processTime = 0;
- private float energyPerTick = 0.0F;
-
- public ProcessInfo(IProcess process)
- {
- this.energyPerTick = process.getEnergyPerTick();
- if ((process instanceof IProcessTimed))
- {
- IProcessTimed time = (IProcessTimed)process;
- this.currentProgress = time.getProgress();
- this.processEnergy = time.getProcessEnergy();
- this.processTime = time.getProcessLength();
- }
- else
- {
- this.currentProgress = (process.isInProgress() ? 100.0F : 0.0F);
- }
- }
-
- public ProcessInfo() {}
-
- public float getCurrentProgress()
- {
- return this.currentProgress;
- }
-
- public int getProcessEnergy()
- {
- return this.processEnergy;
- }
-
- public int getProcessTime()
- {
- return this.processTime;
- }
-
- public float getEnergyPerTick()
- {
- return this.energyPerTick;
- }
-
- public void readFromNBT(NBTTagCompound nbttagcompound)
- {
- this.energyPerTick = nbttagcompound.getFloat("ept");
- this.processEnergy = nbttagcompound.getInteger("e");
- this.processTime = nbttagcompound.getInteger("t");
- this.currentProgress = nbttagcompound.getFloat("p");
- }
-
- public void writeToNBT(NBTTagCompound nbttagcompound)
- {
- nbttagcompound.setFloat("ept", this.energyPerTick);
- nbttagcompound.setFloat("p", this.currentProgress);
- nbttagcompound.setInteger("e", this.processEnergy);
- nbttagcompound.setInteger("t", this.processTime);
- }
-}
diff --git a/src/Java/binnie/core/machines/power/TankInfo.java b/src/Java/binnie/core/machines/power/TankInfo.java
deleted file mode 100644
index d9e0b350d7..0000000000
--- a/src/Java/binnie/core/machines/power/TankInfo.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package binnie.core.machines.power;
-
-import forestry.api.core.INBTTagable;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.IIcon;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidTank;
-
-public class TankInfo
- implements INBTTagable
-{
- public FluidStack liquid;
- private float capacity = 0.0F;
-
- public TankInfo(IFluidTank tank)
- {
- this.capacity = tank.getCapacity();
- this.liquid = tank.getFluid();
- }
-
- public TankInfo() {}
-
- public float getAmount()
- {
- return this.liquid == null ? 0.0F : this.liquid.amount;
- }
-
- public float getCapacity()
- {
- return this.capacity;
- }
-
- public boolean isEmpty()
- {
- return this.liquid == null;
- }
-
- public IIcon getIcon()
- {
- return this.liquid.getFluid().getStillIcon();
- }
-
- public String getName()
- {
- return this.liquid == null ? "" : this.liquid.getFluid().getLocalizedName();
- }
-
- public void readFromNBT(NBTTagCompound nbt)
- {
- this.capacity = nbt.getInteger("capacity");
- if (nbt.hasKey("liquid")) {
- this.liquid = FluidStack.loadFluidStackFromNBT(nbt.getCompoundTag("liquid"));
- }
- }
-
- public void writeToNBT(NBTTagCompound nbt)
- {
- nbt.setInteger("capacity", (int)getCapacity());
- if (this.liquid == null) {
- return;
- }
- NBTTagCompound tag = new NBTTagCompound();
- this.liquid.writeToNBT(tag);
- nbt.setTag("liquid", tag);
- }
-
- public static TankInfo[] get(ITankMachine machine)
- {
- TankInfo[] info = new TankInfo[machine.getTanks().length];
- for (int i = 0; i < info.length; i++) {
- info[i] = new TankInfo(machine.getTanks()[i]);
- }
- return info;
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/Compartment.java b/src/Java/binnie/core/machines/storage/Compartment.java
deleted file mode 100644
index 4ed8406346..0000000000
--- a/src/Java/binnie/core/machines/storage/Compartment.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package binnie.core.machines.storage;
-
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import binnie.core.BinnieCore;
-import binnie.core.machines.IMachineType;
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachinePackage;
-import binnie.core.machines.TileEntityMachine;
-import binnie.core.resource.BinnieResource;
-import binnie.core.resource.IBinnieTexture;
-
- enum Compartment
- implements IMachineType
-{
- Compartment(StandardCompartment.PackageCompartment.class), CompartmentCopper(StandardCompartment.PackageCompartmentCopper.class), CompartmentBronze(StandardCompartment.PackageCompartmentBronze.class), CompartmentIron(StandardCompartment.PackageCompartmentIron.class), CompartmentGold(StandardCompartment.PackageCompartmentGold.class), CompartmentDiamond(StandardCompartment.PackageCompartmentDiamond.class);
-
- Class<? extends MachinePackage> clss;
-
- private Compartment(Class<? extends MachinePackage> clss)
- {
- this.clss = clss;
- }
-
- public Class<? extends MachinePackage> getPackageClass()
- {
- return this.clss;
- }
-
- public static abstract class PackageCompartment
- extends MachinePackage
- {
- private BinnieResource renderTexture;
-
- protected PackageCompartment(String uid, IBinnieTexture renderTexture)
- {
- super(uid, false);
- this.renderTexture = renderTexture.getTexture();
- }
-
- public TileEntity createTileEntity()
- {
- return new TileEntityMachine(this);
- }
-
- public void register() {}
-
- public void renderMachine(Machine machine, double x, double y, double z, float var8, RenderBlocks renderer)
- {
- MachineRendererCompartment.instance.renderMachine(machine, 16777215, this.renderTexture, x, y, z, var8);
- }
- }
-
- public boolean isActive()
- {
- return true;
- }
-
- public ItemStack get(int i)
- {
- return new ItemStack(BinnieCore.packageCompartment.getBlock(), i, ordinal());
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/CompartmentTab.java b/src/Java/binnie/core/machines/storage/CompartmentTab.java
deleted file mode 100644
index 025f73db31..0000000000
--- a/src/Java/binnie/core/machines/storage/CompartmentTab.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package binnie.core.machines.storage;
-
-import binnie.craftgui.minecraft.EnumColor;
-import forestry.api.core.INBTTagable;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-class CompartmentTab
- implements INBTTagable
-{
- private String name;
- private ItemStack icon;
- private EnumColor color;
- private int id;
-
- public CompartmentTab(int id)
- {
- this.name = "";
- this.icon = new ItemStack(Items.paper);
- this.color = EnumColor.White;
- this.id = id;
- }
-
- public void readFromNBT(NBTTagCompound nbt)
- {
- this.name = nbt.getString("name");
- this.icon = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("icon"));
- this.color = EnumColor.values()[nbt.getByte("color")];
- this.id = nbt.getByte("id");
- }
-
- public void writeToNBT(NBTTagCompound nbt)
- {
- nbt.setString("name", this.name);
- NBTTagCompound n = new NBTTagCompound();
- this.icon.writeToNBT(n);
- nbt.setTag("icon", n);
- nbt.setByte("color", (byte)this.color.ordinal());
- nbt.setByte("id", (byte)this.id);
- }
-
- public String getName()
- {
- return this.name;
- }
-
- public ItemStack getIcon()
- {
- return this.icon;
- }
-
- public EnumColor getColor()
- {
- return this.color;
- }
-
- public int getId()
- {
- return this.id;
- }
-
- public void setName(String name)
- {
- this.name = (name == null ? "" : name);
- }
-
- public void setIcon(ItemStack icon)
- {
- this.icon = icon;
- }
-
- public void setColor(EnumColor color)
- {
- this.color = color;
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/ComponentBinnieCoreGUI.java b/src/Java/binnie/core/machines/storage/ComponentBinnieCoreGUI.java
deleted file mode 100644
index abb2307687..0000000000
--- a/src/Java/binnie/core/machines/storage/ComponentBinnieCoreGUI.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package binnie.core.machines.storage;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.world.World;
-import binnie.core.BinnieCore;
-import binnie.core.gui.BinnieCoreGUI;
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachineComponent;
-import binnie.core.machines.component.IInteraction;
-
-class ComponentBinnieCoreGUI
- extends MachineComponent
- implements IInteraction.RightClick
-{
- private BinnieCoreGUI id;
-
- public ComponentBinnieCoreGUI(Machine machine, BinnieCoreGUI id)
- {
- super(machine);
- this.id = id;
- }
-
- public void onRightClick(World world, EntityPlayer player, int x, int y, int z)
- {
- BinnieCore.proxy.openGui(this.id, player, x, y, z);
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/ComponentCompartmentInventory.java b/src/Java/binnie/core/machines/storage/ComponentCompartmentInventory.java
deleted file mode 100644
index efe77be7e7..0000000000
--- a/src/Java/binnie/core/machines/storage/ComponentCompartmentInventory.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package binnie.core.machines.storage;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import binnie.core.machines.IMachine;
-import binnie.core.machines.inventory.ComponentInventorySlots;
-import binnie.core.machines.network.INetwork;
-import cpw.mods.fml.relauncher.Side;
-
-class ComponentCompartmentInventory
- extends ComponentInventorySlots
- implements INetwork.GuiNBT
-{
- private int numberOfTabs;
- private int slotsPerPage;
-
- public ComponentCompartmentInventory(IMachine machine, int sections)
- {
- this(machine, sections, 4);
- }
-
- public ComponentCompartmentInventory(IMachine machine, int tabs, int pageSize)
- {
- super(machine);
-
- this.numberOfTabs = tabs;
- this.slotsPerPage = pageSize;
- for (int i = 0; i < this.numberOfTabs * this.slotsPerPage; i++) {
- addSlot(i, "compartment");
- }
- }
-
- public int getPageSize()
- {
- return this.slotsPerPage;
- }
-
- public int getTabNumber()
- {
- return this.numberOfTabs;
- }
-
- public int[] getSlotsForTab(int currentTab)
- {
- int[] slots = new int[this.slotsPerPage];
- for (int i = 0; i < this.slotsPerPage; i++) {
- slots[i] = (i + currentTab * this.slotsPerPage);
- }
- return slots;
- }
-
- private Map<Integer, CompartmentTab> tabs = new HashMap();
-
- public CompartmentTab getTab(int i)
- {
- if (!this.tabs.containsKey(Integer.valueOf(i))) {
- this.tabs.put(Integer.valueOf(i), new CompartmentTab(i));
- }
- return (CompartmentTab)this.tabs.get(Integer.valueOf(i));
- }
-
- public void sendGuiNBT(Map<String, NBTTagCompound> nbt)
- {
- NBTTagList list = new NBTTagList();
- for (int i = 0; i < this.numberOfTabs; i++)
- {
- NBTTagCompound nbt2 = new NBTTagCompound();
- getTab(i).writeToNBT(nbt2);
- list.appendTag(nbt2);
- }
- NBTTagCompound tag = new NBTTagCompound();
- tag.setTag("tabs", list);
- nbt.put("comp-tabs", tag);
- }
-
- public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound nbt)
- {
- if (name.equals("comp-tabs"))
- {
- NBTTagList tags = nbt.getTagList("tabs", 10);
- for (int i = 0; i < tags.tagCount(); i++)
- {
- NBTTagCompound tag = tags.getCompoundTagAt(i);
- CompartmentTab tab = new CompartmentTab(0);
- tab.readFromNBT(tag);
- this.tabs.put(Integer.valueOf(tab.getId()), tab);
- }
- }
- if (name.equals("comp-change-tab"))
- {
- NBTTagCompound tag = nbt;
- CompartmentTab tab = new CompartmentTab(0);
- tab.readFromNBT(tag);
- this.tabs.put(Integer.valueOf(tab.getId()), tab);
- getMachine().getTileEntity().markDirty();
- }
- }
-
- public void readFromNBT(NBTTagCompound nbt)
- {
- super.readFromNBT(nbt);
- NBTTagList tags = nbt.getTagList("tabs", 10);
- for (int i = 0; i < tags.tagCount(); i++)
- {
- NBTTagCompound tag = tags.getCompoundTagAt(i);
- CompartmentTab tab = new CompartmentTab(0);
- tab.readFromNBT(tag);
- this.tabs.put(Integer.valueOf(tab.getId()), tab);
- }
- }
-
- public void writeToNBT(NBTTagCompound nbt)
- {
- super.writeToNBT(nbt);
- NBTTagList list = new NBTTagList();
- for (int i = 0; i < this.numberOfTabs; i++)
- {
- NBTTagCompound nbt2 = new NBTTagCompound();
- getTab(i).writeToNBT(nbt2);
- list.appendTag(nbt2);
- }
- nbt.setTag("tabs", list);
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/ControlColourSelector.java b/src/Java/binnie/core/machines/storage/ControlColourSelector.java
deleted file mode 100644
index c5320a2629..0000000000
--- a/src/Java/binnie/core/machines/storage/ControlColourSelector.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package binnie.core.machines.storage;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.minecraft.EnumColor;
-
-class ControlColourSelector
- extends Control
- implements ITooltip, IControlValue<EnumColor>
-{
- private EnumColor value;
-
- public ControlColourSelector(IWidget parent, float x, float y, float w, float h, EnumColor value)
- {
- super(parent, x, y, w, h);
- setValue(value);
- addAttribute(Attribute.MouseOver);
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- tooltip.add(this.value.toString());
- }
-
- public EnumColor getValue()
- {
- return this.value;
- }
-
- public void setValue(EnumColor value)
- {
- this.value = value;
- setColour(getValue().getColour());
- }
-
- public void onRenderBackground()
- {
- super.onRenderBackground();
- CraftGUI.Render.gradientRect(getArea(), -16777216 + this.value.getColour(), -16777216 + this.value.getColour());
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/MachineRendererCompartment.java b/src/Java/binnie/core/machines/storage/MachineRendererCompartment.java
deleted file mode 100644
index 133b5293ff..0000000000
--- a/src/Java/binnie/core/machines/storage/MachineRendererCompartment.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package binnie.core.machines.storage;
-
-import binnie.core.BinnieCore;
-import binnie.core.machines.Machine;
-import binnie.core.proxy.BinnieProxy;
-import binnie.core.resource.BinnieResource;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.tileentity.TileEntity;
-import org.lwjgl.opengl.GL11;
-
-@SideOnly(Side.CLIENT)
-class MachineRendererCompartment
-{
- public static MachineRendererCompartment instance = new MachineRendererCompartment();
- private ModelCompartment model;
-
- public MachineRendererCompartment()
- {
- this.model = new ModelCompartment();
- }
-
- public void renderMachine(Machine machine, int colour, BinnieResource texture, double x, double y, double z, float var8)
- {
- GL11.glPushMatrix();
-
- int i1 = 0;
-
- int ix = machine.getTileEntity().xCoord;
- int iy = machine.getTileEntity().yCoord;
- int iz = machine.getTileEntity().zCoord;
- if (machine.getTileEntity() != null) {
- i1 = ix * iy * iz + ix * iy - ix * iz + iy * iz - ix + iy - iz;
- }
- float phase = (float)Math.max(0.0D, Math.sin((System.currentTimeMillis() + i1) * 0.003D));
-
- GL11.glTranslated(x + 0.5D, y + 1.5D, z + 0.5D);
- GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
-
- BinnieCore.proxy.bindTexture(texture);
-
- GL11.glPushMatrix();
-
- this.model.render(null, (float)x, (float)y, (float)z, 0.0625F, 0.0625F, 0.0625F);
-
- GL11.glPopMatrix();
-
- GL11.glPopMatrix();
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/ModelCompartment.java b/src/Java/binnie/core/machines/storage/ModelCompartment.java
deleted file mode 100644
index 9e5aef450a..0000000000
--- a/src/Java/binnie/core/machines/storage/ModelCompartment.java
+++ /dev/null
@@ -1,171 +0,0 @@
-package binnie.core.machines.storage;
-
-import net.minecraft.client.model.ModelBase;
-import net.minecraft.client.model.ModelRenderer;
-import net.minecraft.entity.Entity;
-
-class ModelCompartment
- extends ModelBase
-{
- private ModelRenderer Column1;
- private ModelRenderer Column4;
- private ModelRenderer Column2;
- private ModelRenderer Column3;
- private ModelRenderer Lid_1;
- private ModelRenderer Body_1;
- private ModelRenderer Lock_1;
- private ModelRenderer Lid_2;
- private ModelRenderer Body_2;
- private ModelRenderer Lock_2;
- private ModelRenderer Body;
- private ModelRenderer Lid_3;
- private ModelRenderer Body_3;
- private ModelRenderer Lock_3;
- private ModelRenderer Lid_4;
- private ModelRenderer Body_4;
- private ModelRenderer Lock_4;
-
- public ModelCompartment()
- {
- this.textureWidth = 128;
- this.textureHeight = 128;
-
- this.Column1 = new ModelRenderer(this, 0, 0);
- this.Column1.addBox(-8.0F, 8.0F, -8.0F, 4, 16, 4);
- this.Column1.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Column1.setTextureSize(128, 128);
- this.Column1.mirror = true;
- setRotation(this.Column1, 0.0F, 0.0F, 0.0F);
- this.Column4 = new ModelRenderer(this, 0, 0);
- this.Column4.addBox(4.0F, 8.0F, -8.0F, 4, 16, 4);
- this.Column4.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Column4.setTextureSize(128, 128);
- this.Column4.mirror = true;
- setRotation(this.Column4, 0.0F, 0.0F, 0.0F);
- this.Column2 = new ModelRenderer(this, 0, 0);
- this.Column2.addBox(-8.0F, 8.0F, 4.0F, 4, 16, 4);
- this.Column2.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Column2.setTextureSize(128, 128);
- this.Column2.mirror = true;
- setRotation(this.Column2, 0.0F, 0.0F, 0.0F);
- this.Column3 = new ModelRenderer(this, 0, 0);
- this.Column3.addBox(4.0F, 8.0F, 4.0F, 4, 16, 4);
- this.Column3.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Column3.setTextureSize(128, 128);
- this.Column3.mirror = true;
- setRotation(this.Column3, 0.0F, 0.0F, 0.0F);
- this.Lid_1 = new ModelRenderer(this, 48, 0);
- this.Lid_1.addBox(-4.0F, 9.0F, -7.0F, 8, 5, 3);
- this.Lid_1.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Lid_1.setTextureSize(128, 128);
- this.Lid_1.mirror = true;
- setRotation(this.Lid_1, 0.0F, 0.0F, 0.0F);
- this.Body_1 = new ModelRenderer(this, 0, 24);
- this.Body_1.addBox(-4.0F, 14.0F, -7.0F, 8, 10, 3);
- this.Body_1.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Body_1.setTextureSize(128, 128);
- this.Body_1.mirror = true;
- setRotation(this.Body_1, 0.0F, 0.0F, 0.0F);
- this.Lock_1 = new ModelRenderer(this, 22, 24);
- this.Lock_1.addBox(-1.0F, 12.0F, -8.0F, 2, 4, 1);
- this.Lock_1.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Lock_1.setTextureSize(128, 128);
- this.Lock_1.mirror = true;
- setRotation(this.Lock_1, 0.0F, 0.0F, 0.0F);
- this.Lid_2 = new ModelRenderer(this, 48, 0);
- this.Lid_2.addBox(-4.0F, 9.0F, -7.0F, 8, 5, 3);
- this.Lid_2.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Lid_2.setTextureSize(128, 128);
- this.Lid_2.mirror = true;
- setRotation(this.Lid_2, 0.0F, 1.570796F, 0.0F);
- this.Body_2 = new ModelRenderer(this, 0, 24);
- this.Body_2.addBox(-4.0F, 14.0F, -7.0F, 8, 10, 3);
- this.Body_2.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Body_2.setTextureSize(128, 128);
- this.Body_2.mirror = true;
- setRotation(this.Body_2, 0.0F, 1.570796F, 0.0F);
- this.Lock_2 = new ModelRenderer(this, 22, 24);
- this.Lock_2.addBox(-1.0F, 12.0F, -8.0F, 2, 4, 1);
- this.Lock_2.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Lock_2.setTextureSize(128, 128);
- this.Lock_2.mirror = true;
- setRotation(this.Lock_2, 0.0F, 1.570796F, 0.0F);
- this.Body = new ModelRenderer(this, 16, 0);
- this.Body.addBox(-4.0F, 8.0F, -4.0F, 8, 16, 8);
- this.Body.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Body.setTextureSize(128, 128);
- this.Body.mirror = true;
- setRotation(this.Body, 0.0F, 0.0F, 0.0F);
- this.Lid_3 = new ModelRenderer(this, 48, 0);
- this.Lid_3.addBox(-4.0F, 9.0F, -7.0F, 8, 5, 3);
- this.Lid_3.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Lid_3.setTextureSize(128, 128);
- this.Lid_3.mirror = true;
- setRotation(this.Lid_3, 0.0F, 3.141593F, 0.0F);
- this.Body_3 = new ModelRenderer(this, 0, 24);
- this.Body_3.addBox(-4.0F, 14.0F, -7.0F, 8, 10, 3);
- this.Body_3.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Body_3.setTextureSize(128, 128);
- this.Body_3.mirror = true;
- setRotation(this.Body_3, 0.0F, 3.141593F, 0.0F);
- this.Lock_3 = new ModelRenderer(this, 22, 24);
- this.Lock_3.addBox(-1.0F, 12.0F, -8.0F, 2, 4, 1);
- this.Lock_3.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Lock_3.setTextureSize(128, 128);
- this.Lock_3.mirror = true;
- setRotation(this.Lock_3, 0.0F, 3.141593F, 0.0F);
- this.Lid_4 = new ModelRenderer(this, 48, 0);
- this.Lid_4.addBox(-4.0F, 9.0F, -7.0F, 8, 5, 3);
- this.Lid_4.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Lid_4.setTextureSize(128, 128);
- this.Lid_4.mirror = true;
- setRotation(this.Lid_4, 0.0F, -1.570796F, 0.0F);
- this.Body_4 = new ModelRenderer(this, 0, 24);
- this.Body_4.addBox(-4.0F, 14.0F, -7.0F, 8, 10, 3);
- this.Body_4.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Body_4.setTextureSize(128, 128);
- this.Body_4.mirror = true;
- setRotation(this.Body_4, 0.0F, -1.570796F, 0.0F);
- this.Lock_4 = new ModelRenderer(this, 22, 24);
- this.Lock_4.addBox(-1.0F, 12.0F, -8.0F, 2, 4, 1);
- this.Lock_4.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.Lock_4.setTextureSize(128, 128);
- this.Lock_4.mirror = true;
- setRotation(this.Lock_4, 0.0F, -1.570796F, 0.0F);
- }
-
- 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);
- this.Column1.render(f5);
- this.Column4.render(f5);
- this.Column2.render(f5);
- this.Column3.render(f5);
- this.Lid_1.render(f5);
- this.Body_1.render(f5);
- this.Lock_1.render(f5);
- this.Lid_2.render(f5);
- this.Body_2.render(f5);
- this.Lock_2.render(f5);
- this.Body.render(f5);
- this.Lid_3.render(f5);
- this.Body_3.render(f5);
- this.Lock_3.render(f5);
- this.Lid_4.render(f5);
- this.Body_4.render(f5);
- this.Lock_4.render(f5);
- }
-
- private void setRotation(ModelRenderer model, float x, float y, float z)
- {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
-
- public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
- {
- super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/ModuleStorage.java b/src/Java/binnie/core/machines/storage/ModuleStorage.java
deleted file mode 100644
index 7f8bb38ac4..0000000000
--- a/src/Java/binnie/core/machines/storage/ModuleStorage.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package binnie.core.machines.storage;
-
-import binnie.core.BinnieCore;
-import binnie.core.IInitializable;
-import binnie.core.machines.MachineGroup;
-import cpw.mods.fml.common.registry.GameRegistry;
-import java.util.ArrayList;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraftforge.oredict.OreDictionary;
-import net.minecraftforge.oredict.ShapedOreRecipe;
-
-public class ModuleStorage
- implements IInitializable
-{
- public void preInit()
- {
- BinnieCore.packageCompartment = new MachineGroup(BinnieCore.instance, "storage", "storage", Compartment.values());
- BinnieCore.packageCompartment.setCreativeTab(CreativeTabs.tabBlock);
- }
-
- public void init() {}
-
- public void postInit()
- {
- String ironGear = OreDictionary.getOres("gearIron").isEmpty() ? "ingotIron" : "gearIron";
- String goldGear = OreDictionary.getOres("gearGold").isEmpty() ? "ingotGold" : "gearGold";
- String diamondGear = "gemDiamond";
-
- GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.Compartment.get(1), new Object[] { "pcp", "cbc", "pcp", Character.valueOf('b'), Items.book, Character.valueOf('c'), Blocks.chest, Character.valueOf('p'), Blocks.stone_button }));
- GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentCopper.get(1), new Object[] { "pcp", "cbc", "pcp", Character.valueOf('b'), Compartment.Compartment.get(1), Character.valueOf('c'), "gearCopper", Character.valueOf('p'), Blocks.stone_button }));
- GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentBronze.get(1), new Object[] { "pcp", "cbc", "pcp", Character.valueOf('b'), Compartment.CompartmentCopper.get(1), Character.valueOf('c'), "gearBronze", Character.valueOf('p'), Items.gold_nugget }));
-
- GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentIron.get(1), new Object[] { "pcp", "cbc", "pcp", Character.valueOf('b'), Compartment.CompartmentCopper.get(1), Character.valueOf('c'), ironGear, Character.valueOf('p'), Items.gold_nugget }));
- GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentGold.get(1), new Object[] { "pcp", "cbc", "pcp", Character.valueOf('b'), Compartment.CompartmentIron.get(1), Character.valueOf('c'), goldGear, Character.valueOf('p'), Items.emerald }));
- GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentDiamond.get(1), new Object[] { "pcp", "cbc", "pcp", Character.valueOf('b'), Compartment.CompartmentGold.get(1), Character.valueOf('c'), diamondGear, Character.valueOf('p'), Items.emerald }));
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/StandardCompartment.java b/src/Java/binnie/core/machines/storage/StandardCompartment.java
deleted file mode 100644
index 341657cb9e..0000000000
--- a/src/Java/binnie/core/machines/storage/StandardCompartment.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package binnie.core.machines.storage;
-
-import binnie.core.gui.BinnieCoreGUI;
-import binnie.core.machines.Machine;
-import binnie.core.machines.TileEntityMachine;
-import binnie.core.texture.BinnieCoreTexture;
-import net.minecraft.tileentity.TileEntity;
-
-class StandardCompartment
-{
- public static class PackageCompartment
- extends Compartment.PackageCompartment
- {
- public PackageCompartment()
- {
- super(BinnieCoreTexture.Compartment);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
- new ComponentCompartmentInventory(machine, 4, 25);
- }
-
- public TileEntity createTileEntity()
- {
- return new TileEntityMachine(this);
- }
-
- public void register() {}
- }
-
- public static class PackageCompartmentCopper
- extends Compartment.PackageCompartment
- {
- public PackageCompartmentCopper()
- {
- super(BinnieCoreTexture.CompartmentCopper);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
- new ComponentCompartmentInventory(machine, 6, 25);
- }
-
- public TileEntity createTileEntity()
- {
- return new TileEntityMachine(this);
- }
-
- public void register() {}
- }
-
- public static class PackageCompartmentBronze
- extends Compartment.PackageCompartment
- {
- public PackageCompartmentBronze()
- {
- super(BinnieCoreTexture.CompartmentBronze);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
- new ComponentCompartmentInventory(machine, 8, 25);
- }
-
- public TileEntity createTileEntity()
- {
- return new TileEntityMachine(this);
- }
-
- public void register() {}
- }
-
- public static class PackageCompartmentIron
- extends Compartment.PackageCompartment
- {
- public PackageCompartmentIron()
- {
- super(BinnieCoreTexture.CompartmentIron);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
- new ComponentCompartmentInventory(machine, 4, 50);
- }
-
- public TileEntity createTileEntity()
- {
- return new TileEntityMachine(this);
- }
-
- public void register() {}
- }
-
- public static class PackageCompartmentGold
- extends Compartment.PackageCompartment
- {
- public PackageCompartmentGold()
- {
- super(BinnieCoreTexture.CompartmentGold);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
- new ComponentCompartmentInventory(machine, 6, 50);
- }
-
- public TileEntity createTileEntity()
- {
- return new TileEntityMachine(this);
- }
-
- public void register() {}
- }
-
- public static class PackageCompartmentDiamond
- extends Compartment.PackageCompartment
- {
- public PackageCompartmentDiamond()
- {
- super(BinnieCoreTexture.CompartmentDiamond);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
- new ComponentCompartmentInventory(machine, 8, 50);
- }
-
- public TileEntity createTileEntity()
- {
- return new TileEntityMachine(this);
- }
-
- public void register() {}
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/WindowCompartment.java b/src/Java/binnie/core/machines/storage/WindowCompartment.java
deleted file mode 100644
index 6c28ed0714..0000000000
--- a/src/Java/binnie/core/machines/storage/WindowCompartment.java
+++ /dev/null
@@ -1,594 +0,0 @@
-package binnie.core.machines.storage;
-
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.machines.IMachine;
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachinePackage;
-import binnie.core.machines.transfer.TransferRequest;
-import binnie.craftgui.controls.ControlCheckbox;
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.ControlTextEdit;
-import binnie.craftgui.controls.button.ControlButton;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.page.ControlPage;
-import binnie.craftgui.controls.page.ControlPages;
-import binnie.craftgui.controls.scroll.ControlScrollableContent;
-import binnie.craftgui.controls.tab.ControlTab;
-import binnie.craftgui.controls.tab.ControlTabBar;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.CraftGUIUtil;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IBorder;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.events.EventTextEdit;
-import binnie.craftgui.events.EventTextEdit.Handler;
-import binnie.craftgui.events.EventValueChanged;
-import binnie.craftgui.events.EventValueChanged.Handler;
-import binnie.craftgui.genetics.machine.WindowMachine;
-import binnie.craftgui.minecraft.Dialog;
-import binnie.craftgui.minecraft.EnumColor;
-import binnie.craftgui.minecraft.IWindowAffectsShiftClick;
-import binnie.craftgui.minecraft.MinecraftGUI.PanelType;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.control.ControlItemDisplay;
-import binnie.craftgui.minecraft.control.ControlPlayerInventory;
-import binnie.craftgui.minecraft.control.ControlSlide;
-import binnie.craftgui.minecraft.control.ControlSlot;
-import binnie.craftgui.minecraft.control.ControlSlotArray;
-import binnie.craftgui.minecraft.control.ControlTabIcon;
-import binnie.craftgui.resource.Texture;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import binnie.craftgui.window.Panel;
-import binnie.craftgui.window.Panel.IPanelType;
-import cpw.mods.fml.relauncher.Side;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class WindowCompartment
- extends WindowMachine
- implements IWindowAffectsShiftClick
-{
- public static Window create(EntityPlayer player, IInventory inventory, Side side)
- {
- return new WindowCompartment(player, inventory, side);
- }
-
- public WindowCompartment(EntityPlayer player, IInventory inventory, Side side)
- {
- super(320, 226, player, inventory, side);
- }
-
- private final Map<Panel, Integer> panels = new HashMap();
- private ControlTextEdit tabName;
- private ControlItemDisplay tabIcon;
- private ControlColourSelector tabColour;
- boolean dueUpdate;
-
- public void initialiseClient()
- {
- setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
-
- int x = 16;
- int y = 32;
-
- ComponentCompartmentInventory inv = (ComponentCompartmentInventory)Machine.getMachine(getInventory()).getInterface(ComponentCompartmentInventory.class);
-
-
-
- Integer[] tabs1 = new Integer[0];
- Integer[] tabs2 = new Integer[0];
- if (inv.getTabNumber() == 4)
- {
- tabs1 = new Integer[] { Integer.valueOf(0), Integer.valueOf(1) };
- tabs2 = new Integer[] { Integer.valueOf(2), Integer.valueOf(3) };
- }
- if (inv.getTabNumber() == 6)
- {
- tabs1 = new Integer[] { Integer.valueOf(0), Integer.valueOf(1), Integer.valueOf(2) };
- tabs2 = new Integer[] { Integer.valueOf(3), Integer.valueOf(4), Integer.valueOf(5) };
- }
- if (inv.getTabNumber() == 8)
- {
- tabs1 = new Integer[] { Integer.valueOf(0), Integer.valueOf(1), Integer.valueOf(2), Integer.valueOf(3) };
- tabs2 = new Integer[] { Integer.valueOf(4), Integer.valueOf(5), Integer.valueOf(6), Integer.valueOf(7) };
- }
- boolean doubleTabbed = tabs2.length > 0;
-
- int compartmentPageWidth = 16 + 18 * inv.getPageSize() / 5;
- int compartmentPageHeight = 106;
- int compartmentWidth = compartmentPageWidth + (doubleTabbed ? 48 : 24);
- int compartmentHeight = compartmentPageHeight;
-
-
-
- Control controlCompartment = new Control(this, x, y, compartmentWidth, compartmentHeight);
-
- final ControlTabBar<Integer> tab = new ControlTabBar(controlCompartment, 0.0F, 0.0F, 24.0F, compartmentPageHeight, Position.Left)
- {
- public ControlTab<Integer> createTab(float x, float y, float w, float h, Integer value)
- {
- new ControlTabIcon(this, x, y, w, h, value)
- {
- public ItemStack getItemStack()
- {
- return WindowCompartment.this.getTab(((Integer)this.value).intValue()).getIcon();
- }
-
- public String getName()
- {
- return WindowCompartment.this.getTab(((Integer)this.value).intValue()).getName();
- }
-
- public int getOutlineColour()
- {
- return WindowCompartment.this.getTab(((Integer)this.value).intValue()).getColor().getColour();
- }
-
- public boolean hasOutline()
- {
- return true;
- }
- };
- }
- };
- String[] tabHelp = { "Compartment Tab", "Tabs that divide the inventory into sections. Each one can be labelled seperately." };
-
- tab.addHelp(tabHelp);
-
- tab.setValues(Arrays.asList(tabs1));
- tab.setValue(Integer.valueOf(0));
-
- tab.addEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- int i = ((Integer)event.getValue()).intValue();
- nbt.setByte("i", (byte)i);
- Window.get(tab).sendClientAction("tab-change", nbt);
- WindowCompartment.this.currentTab = i;
- }
- }.setOrigin(EventHandler.Origin.DirectChild, tab));
-
-
-
-
- x += 24;
-
- ControlPages<Integer> compartmentPages = new ControlPages(controlCompartment, 24.0F, 0.0F, compartmentPageWidth, compartmentPageHeight);
-
- ControlPage[] page = new ControlPage[inv.getTabNumber()];
- for (int p = 0; p < inv.getTabNumber(); p++) {
- page[p] = new ControlPage(compartmentPages, Integer.valueOf(p));
- }
- CraftGUIUtil.linkWidgets(tab, compartmentPages);
-
- int i = 0;
- for (int p = 0; p < inv.getTabNumber(); p++)
- {
- ControlPage thisPage = page[p];
-
- Panel panel = new Panel(thisPage, 0.0F, 0.0F, thisPage.w(), thisPage.h(), MinecraftGUI.PanelType.Black)
- {
- public void onRenderForeground()
- {
- Texture iTexture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline);
-
- CraftGUI.Render.colour(WindowCompartment.this.getTab(((Integer)WindowCompartment.this.panels.get(this)).intValue()).getColor().getColour());
-
- CraftGUI.Render.texture(iTexture, getArea().inset(3));
- }
- };
- this.panels.put(panel, Integer.valueOf(p));
-
- int[] slotsIDs = new int[inv.getPageSize()];
- for (int k = 0; k < inv.getPageSize(); k++) {
- slotsIDs[k] = (i++);
- }
- new ControlSlotArray(thisPage, 8, 8, inv.getPageSize() / 5, 5).create(slotsIDs);
- }
- x += compartmentPageWidth;
- if (tabs2.length > 0)
- {
- ControlTabBar<Integer> tab2 = new ControlTabBar(controlCompartment, 24 + compartmentPageWidth, 0.0F, 24.0F, compartmentPageHeight, Position.Right)
- {
- public ControlTab<Integer> createTab(float x, float y, float w, float h, Integer value)
- {
- new ControlTabIcon(this, x, y, w, h, value)
- {
- public ItemStack getItemStack()
- {
- return WindowCompartment.this.getTab(((Integer)this.value).intValue()).getIcon();
- }
-
- public String getName()
- {
- return WindowCompartment.this.getTab(((Integer)this.value).intValue()).getName();
- }
-
- public int getOutlineColour()
- {
- return WindowCompartment.this.getTab(((Integer)this.value).intValue()).getColor().getColour();
- }
-
- public boolean hasOutline()
- {
- return true;
- }
- };
- }
- };
- tab2.setValues(Arrays.asList(tabs2));
- tab2.setValue(Integer.valueOf(0));
- tab2.addHelp(tabHelp);
-
- tab2.addEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- int i = ((Integer)event.getValue()).intValue();
- nbt.setByte("i", (byte)i);
- Window.get(tab).sendClientAction("tab-change", nbt);
- WindowCompartment.this.currentTab = i;
- }
- }.setOrigin(EventHandler.Origin.DirectChild, tab2));
-
-
-
-
- CraftGUIUtil.linkWidgets(tab2, compartmentPages);
-
- x += 24;
- }
- x += 16;
-
- setSize(new IPoint(Math.max(32 + compartmentWidth, 252), h()));
-
- controlCompartment.setPosition(new IPoint((w() - controlCompartment.w()) / 2.0F, controlCompartment.y()));
-
-
-
- ControlPlayerInventory invent = new ControlPlayerInventory(this, true);
-
- ControlSlide slide = new ControlSlide(this, 0.0F, 134.0F, 136.0F, 92.0F, Position.Left);
- slide.setLabel("Tab Properties");
- slide.setSlide(false);
-
- slide.addHelp("Tab Properties");
- slide.addHelp("The label, colour and icon of the Tab can be altered here. Clicking on the icon with a held item will change it.");
-
- Panel tabPropertyPanel = new Panel(slide, 16.0F, 8.0F, 112.0F, 76.0F, MinecraftGUI.PanelType.Gray);
-
- int y2 = 4;
-
- new ControlText(tabPropertyPanel, new IPoint(4.0F, y2), "Tab Name:");
- y2 += 12;this.tabName = new ControlTextEdit(tabPropertyPanel, 4.0F, y2, 104.0F, 12.0F);
-
- this.tabName.addSelfEventHandler(new EventTextEdit.Handler()
- {
- public void onEvent(EventTextEdit event)
- {
- CompartmentTab tab = WindowCompartment.this.getCurrentTab();
- tab.setName((String)event.getValue());
- NBTTagCompound nbt = new NBTTagCompound();
- tab.writeToNBT(nbt);
- WindowCompartment.this.sendClientAction("comp-change-tab", nbt);
- }
- }.setOrigin(EventHandler.Origin.Self, this.tabName));
-
-
-
-
- y2 += 20;
-
- new ControlText(tabPropertyPanel, new IPoint(4.0F, y2), "Tab Icon: ");
- this.tabIcon = new ControlItemDisplay(tabPropertyPanel, 58.0F, y2 - 4);
- this.tabIcon.setItemStack(new ItemStack(Items.paper));
- this.tabIcon.addAttribute(Attribute.MouseOver);
- this.tabIcon.addSelfEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- if (WindowCompartment.this.getHeldItemStack() == null) {
- return;
- }
- CompartmentTab tab = WindowCompartment.this.getCurrentTab();
- ItemStack stack = WindowCompartment.this.getHeldItemStack().copy();
- stack.stackSize = 1;
- tab.setIcon(stack);
- NBTTagCompound nbt = new NBTTagCompound();
- tab.writeToNBT(nbt);
- WindowCompartment.this.sendClientAction("comp-change-tab", nbt);
- }
- });
- this.tabColour = new ControlColourSelector(tabPropertyPanel, 82.0F, y2 - 4, 16.0F, 16.0F, EnumColor.White);
-
- this.tabIcon.addHelp("Icon for Current Tab");
- this.tabIcon.addHelp("Click here with an item to change");
-
- y2 += 20;
-
- new ControlText(tabPropertyPanel, new IPoint(4.0F, y2), "Colour: ");
-
- int cw = 8;
-
- Panel panelColour = new Panel(tabPropertyPanel, 40.0F, y2 - 4, cw * 8 + 2, cw * 2 + 1, MinecraftGUI.PanelType.Gray);
- for (int cc = 0; cc < 16; cc++)
- {
- final ControlColourSelector color = new ControlColourSelector(panelColour, 1 + cw * (cc % 8), 1 + cw * (cc / 8), cw, cw, EnumColor.values()[cc]);
- color.addSelfEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- CompartmentTab tab = WindowCompartment.this.getCurrentTab();
- tab.setColor(color.getValue());
- NBTTagCompound nbt = new NBTTagCompound();
- tab.writeToNBT(nbt);
- WindowCompartment.this.sendClientAction("comp-change-tab", nbt);
- }
- });
- color.addHelp("Colour Selector");
- color.addHelp("Select a colour to highlight the current tab");
- }
- y2 += 20;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ControlButton searchButton = new ControlButton(controlCompartment, compartmentWidth - 24 - 64 - 8, compartmentPageHeight, 64.0F, 16.0F, "Search")
- {
- protected void onMouseClick(EventMouse.Down event)
- {
- WindowCompartment.this.createSearchDialog();
- }
-
- public void onRenderBackground()
- {
- Object texture = isMouseOver() ? CraftGUITexture.TabHighlighted : CraftGUITexture.Tab;
- CraftGUI.Render.texture(CraftGUI.Render.getTexture(texture).crop(Position.Bottom, 8.0F), getArea());
- }
- };
- searchButton.addHelp("Search Button");
- searchButton.addHelp("Clicking this will open the Search dialog. This allows you to search the inventory for specific items.");
- }
-
- public void createSearchDialog()
- {
- new Dialog(this, 252.0F, 192.0F)
- {
- Control slotGrid;
- String textSearch = "";
- boolean sortByName = false;
- boolean includeItems = true;
- boolean includeBlocks = true;
-
- public void onClose() {}
-
- public void initialise()
- {
- ControlScrollableContent<IWidget> scroll = new ControlScrollableContent(this, 124.0F, 16.0F, 116.0F, 92.0F, 6.0F)
- {
- public void onRenderBackground()
- {
- CraftGUI.Render.colour(11184810);
- CraftGUI.Render.texture(CraftGUITexture.Outline, getArea().inset(new IBorder(0.0F, 6.0F, 0.0F, 0.0F)));
- }
- };
- this.slotGrid = new Control(scroll, 1.0F, 1.0F, 108.0F, 18.0F);
-
- scroll.setScrollableContent(this.slotGrid);
-
- new ControlPlayerInventory(this, true);
-
- new ControlTextEdit(this, 16.0F, 16.0F, 100.0F, 14.0F).addEventHandler(new EventTextEdit.Handler()
- {
- public void onEvent(EventTextEdit event)
- {
- WindowCompartment.10.this.textSearch = ((String)event.value);
- WindowCompartment.10.this.updateSearch();
- }
- });
- this.includeItems = true;
- this.includeBlocks = true;
-
- new ControlCheckbox(this, 16.0F, 40.0F, 100.0F, "Sort A-Z", this.sortByName)
- {
- protected void onValueChanged(boolean value)
- {
- WindowCompartment.10.this.sortByName = value;
- WindowCompartment.10.this.updateSearch();
- }
- };
- new ControlCheckbox(this, 16.0F, 64.0F, 100.0F, "Include Items", this.includeItems)
- {
- protected void onValueChanged(boolean value)
- {
- WindowCompartment.10.this.includeItems = value;
- WindowCompartment.10.this.updateSearch();
- }
- };
- new ControlCheckbox(this, 16.0F, 88.0F, 100.0F, "Include Blocks", this.includeBlocks)
- {
- protected void onValueChanged(boolean value)
- {
- WindowCompartment.10.this.includeBlocks = value;
- WindowCompartment.10.this.updateSearch();
- }
- };
- updateSearch();
- }
-
- private void updateSearch()
- {
- Map<Integer, String> slotIds = new HashMap();
- IInventory inv = WindowCompartment.this.getInventory();
- for (int i = 0; i < inv.getSizeInventory(); i++)
- {
- ItemStack stack = inv.getStackInSlot(i);
- if (stack != null)
- {
- String name = stack.getDisplayName().toLowerCase();
- if ((this.textSearch == null) || (name.contains(this.textSearch))) {
- if ((this.includeBlocks) || (Block.getBlockFromItem(stack.getItem()) == Blocks.air)) {
- if ((this.includeItems) || (Block.getBlockFromItem(stack.getItem()) != Blocks.air)) {
- slotIds.put(Integer.valueOf(i), name);
- }
- }
- }
- }
- }
- if (this.sortByName)
- {
- List list = new LinkedList(slotIds.entrySet());
- Collections.sort(list, new Comparator()
- {
- public int compare(Object o1, Object o2)
- {
- return -((Comparable)((Map.Entry)o2).getValue()).compareTo(((Map.Entry)o1).getValue());
- }
- });
- Map result = new LinkedHashMap();
- for (Iterator it = list.iterator(); it.hasNext();)
- {
- Map.Entry entry = (Map.Entry)it.next();
- result.put(entry.getKey(), entry.getValue());
- }
- slotIds = result;
- }
- int y = 0;
- int x = 0;
- int width = 108;
- int height = 2 + 18 * (1 + (slotIds.size() - 1) / 6);
- this.slotGrid.deleteAllChildren();
- this.slotGrid.setSize(new IPoint(width, height));
- for (Iterator i$ = slotIds.keySet().iterator(); i$.hasNext();)
- {
- int k = ((Integer)i$.next()).intValue();
- new ControlSlot(this.slotGrid, x, y).assign(k);
- x += 18;
- if (x >= 108)
- {
- x = 0;
- y += 18;
- }
- }
- while ((y < 108) || (x != 0))
- {
- new ControlSlot(this.slotGrid, x, y);
- x += 18;
- if (x >= 108)
- {
- x = 0;
- y += 18;
- }
- }
- }
- };
- }
-
- public void onUpdateClient()
- {
- super.onUpdateClient();
- updateTabs();
- }
-
- public void updateTabs()
- {
- this.tabName.setValue(getCurrentTab().getName());
- this.tabIcon.setItemStack(getCurrentTab().getIcon());
- this.tabColour.setValue(getCurrentTab().getColor());
- }
-
- private int currentTab = 0;
-
- public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound action)
- {
- super.recieveGuiNBT(side, player, name, action);
- if (name.equals("tab-change")) {
- this.currentTab = action.getByte("i");
- }
- }
-
- public String getTitle()
- {
- return "Compartment";
- }
-
- protected AbstractMod getMod()
- {
- return BinnieCore.instance;
- }
-
- protected String getName()
- {
- return "compartment";
- }
-
- public void alterRequest(TransferRequest request)
- {
- if (request.getDestination() == getInventory())
- {
- ComponentCompartmentInventory inv = (ComponentCompartmentInventory)Machine.getMachine(getInventory()).getInterface(ComponentCompartmentInventory.class);
- request.setTargetSlots(inv.getSlotsForTab(this.currentTab));
- }
- }
-
- public CompartmentTab getTab(int i)
- {
- return ((ComponentCompartmentInventory)Machine.getInterface(ComponentCompartmentInventory.class, getInventory())).getTab(i);
- }
-
- public CompartmentTab getCurrentTab()
- {
- return getTab(this.currentTab);
- }
-}
diff --git a/src/Java/binnie/core/machines/storage/WindowTest.java b/src/Java/binnie/core/machines/storage/WindowTest.java
deleted file mode 100644
index 55c2a0b9db..0000000000
--- a/src/Java/binnie/core/machines/storage/WindowTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package binnie.core.machines.storage;
-
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.craftgui.genetics.machine.WindowMachine;
-import binnie.craftgui.minecraft.Window;
-import cpw.mods.fml.relauncher.Side;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-
-public class WindowTest
- extends WindowMachine
-{
- public static Window create(EntityPlayer player, IInventory inventory, Side side)
- {
- return new WindowCompartment(player, inventory, side);
- }
-
- public WindowTest(EntityPlayer player, IInventory inventory, Side side)
- {
- super(320, 240, player, inventory, side);
- }
-
- public void initialiseClient() {}
-
- public String getTitle()
- {
- return "Test";
- }
-
- protected AbstractMod getMod()
- {
- return BinnieCore.instance;
- }
-
- protected String getName()
- {
- return "Test";
- }
-}
diff --git a/src/Java/binnie/core/machines/transfer/TransferHandler.java b/src/Java/binnie/core/machines/transfer/TransferHandler.java
deleted file mode 100644
index 8d8c2bdb57..0000000000
--- a/src/Java/binnie/core/machines/transfer/TransferHandler.java
+++ /dev/null
@@ -1,3 +0,0 @@
-package binnie.core.machines.transfer;
-
-public class TransferHandler {}
diff --git a/src/Java/binnie/core/machines/transfer/TransferRequest.java b/src/Java/binnie/core/machines/transfer/TransferRequest.java
deleted file mode 100644
index 8059a6b512..0000000000
--- a/src/Java/binnie/core/machines/transfer/TransferRequest.java
+++ /dev/null
@@ -1,419 +0,0 @@
-package binnie.core.machines.transfer;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.inventory.IInventorySlots;
-import binnie.core.machines.inventory.IValidatedTankContainer;
-import binnie.core.machines.inventory.InventorySlot;
-import binnie.core.machines.power.ITankMachine;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidContainerRegistry;
-import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidContainerItem;
-import net.minecraftforge.fluids.IFluidTank;
-
-public class TransferRequest
-{
- private ItemStack itemToTransfer = null;
- private ItemStack returnItem = null;
- private IInventory origin;
- private IInventory destination;
- private int[] targetSlots = new int[0];
- private int[] targetTanks = new int[0];
- private boolean transferLiquids = true;
- private boolean ignoreReadOnly = false;
-
- public TransferRequest(ItemStack toTransfer, IInventory destination)
- {
- int[] target = new int[destination.getSizeInventory()];
- for (int i = 0; i < target.length; i++) {
- target[i] = i;
- }
- int[] targetTanks = new int[0];
- if ((destination instanceof ITankMachine))
- {
- targetTanks = new int[((ITankMachine)destination).getTanks().length];
- for (int i = 0; i < targetTanks.length; i++) {
- targetTanks[i] = i;
- }
- }
- if (toTransfer != null)
- {
- setItemToTransfer(toTransfer.copy());
- setReturnItem(toTransfer.copy());
- }
- setOrigin(null);
- setDestination(destination);
- setTargetSlots(target);
- setTargetTanks(targetTanks);
- this.transferLiquids = true;
- }
-
- private void setItemToTransfer(ItemStack itemToTransfer)
- {
- this.itemToTransfer = itemToTransfer;
- }
-
- private void setReturnItem(ItemStack returnItem)
- {
- this.returnItem = returnItem;
- }
-
- public TransferRequest setOrigin(IInventory origin)
- {
- this.origin = origin;
- return this;
- }
-
- private void setDestination(IInventory destination)
- {
- this.destination = destination;
- }
-
- public TransferRequest setTargetSlots(int[] targetSlots)
- {
- this.targetSlots = targetSlots;
- return this;
- }
-
- public TransferRequest setTargetTanks(int[] targetTanks)
- {
- this.targetTanks = targetTanks;
- return this;
- }
-
- public TransferRequest ignoreValidation()
- {
- this.ignoreReadOnly = true;
- return this;
- }
-
- public ItemStack getReturnItem()
- {
- return this.returnItem;
- }
-
- public ItemStack transfer(boolean doAdd)
- {
- ItemStack item = this.returnItem;
- if ((item == null) || (this.destination == null)) {
- return null;
- }
- if ((this.transferLiquids) && ((this.destination instanceof ITankMachine))) {
- for (int tankID : this.targetTanks)
- {
- item = transferToTank(item, this.origin, (ITankMachine)this.destination, tankID, doAdd);
- if (item != null) {
- item = transferFromTank(item, this.origin, (ITankMachine)this.destination, tankID, doAdd);
- }
- }
- }
- if (item != null) {
- for (int slot : this.targetSlots) {
- if ((this.destination.isItemValidForSlot(slot, item)) || (this.ignoreReadOnly)) {
- if ((!(this.destination instanceof IInventorySlots)) || (((IInventorySlots)this.destination).getSlot(slot) == null) || (!((IInventorySlots)this.destination).getSlot(slot).isRecipe())) {
- if (this.destination.getStackInSlot(slot) != null) {
- if (item.isStackable())
- {
- ItemStack merged = this.destination.getStackInSlot(slot).copy();
- ItemStack[] newStacks = mergeStacks(item.copy(), merged.copy());
- item = newStacks[0];
- if (!areItemsEqual(merged, newStacks[1])) {
- this.insertedSlots.add(new TransferSlot(slot, this.destination));
- }
- if (doAdd) {
- this.destination.setInventorySlotContents(slot, newStacks[1]);
- }
- if (item == null) {
- return null;
- }
- }
- }
- }
- }
- }
- }
- if (item != null) {
- for (int slot : this.targetSlots) {
- if ((this.destination.isItemValidForSlot(slot, item)) || (this.ignoreReadOnly)) {
- if ((!(this.destination instanceof IInventorySlots)) || (((IInventorySlots)this.destination).getSlot(slot) == null) || (!((IInventorySlots)this.destination).getSlot(slot).isRecipe())) {
- if ((this.destination.getStackInSlot(slot) == null) && (item != null))
- {
- this.insertedSlots.add(new TransferSlot(slot, this.destination));
- if (doAdd) {
- this.destination.setInventorySlotContents(slot, item.copy());
- }
- return null;
- }
- }
- }
- }
- }
- setReturnItem(item);
- return getReturnItem();
- }
-
- private static boolean areItemsEqual(ItemStack merged, ItemStack itemstack)
- {
- return (ItemStack.areItemStackTagsEqual(itemstack, merged)) && (itemstack.isItemEqual(merged));
- }
-
- public static ItemStack[] mergeStacks(ItemStack itemstack, ItemStack merged)
- {
- if (areItemsEqual(itemstack, merged))
- {
- int space = merged.getMaxStackSize() - merged.stackSize;
- if (space > 0) {
- if (itemstack.stackSize > space)
- {
- itemstack.stackSize -= space;
- merged.stackSize += space;
- }
- else if (itemstack.stackSize <= space)
- {
- merged.stackSize += itemstack.stackSize;
- itemstack = null;
- }
- }
- }
- return new ItemStack[] { itemstack, merged };
- }
-
- private ItemStack transferToTank(ItemStack item, IInventory origin, ITankMachine destination, int tankID, boolean doAdd)
- {
- item = transferToTankUsingContainerData(item, origin, destination, tankID, doAdd);
- item = transferToTankUsingFluidContainer(item, origin, destination, tankID, doAdd);
- return item;
- }
-
- private ItemStack transferToTankUsingFluidContainer(ItemStack item, IInventory origin, ITankMachine destination, int tankID, boolean doAdd)
- {
- if ((item == null) || (!(item.getItem() instanceof IFluidContainerItem))) {
- return item;
- }
- IFluidContainerItem fluidContainer = (IFluidContainerItem)item.getItem();
- FluidStack fluid = fluidContainer.getFluid(item);
- if (fluid == null) {
- return item;
- }
- IFluidTank tank = destination.getTanks()[tankID];
-
- IValidatedTankContainer validated = (IValidatedTankContainer)Machine.getInterface(IValidatedTankContainer.class, destination);
- if ((validated != null) && ((!validated.isLiquidValidForTank(fluid, tankID)) || (validated.isTankReadOnly(tankID)))) {
- return item;
- }
- int maxFill = tank.fill(fluid, false);
-
- FluidStack toTake = fluidContainer.drain(item, maxFill, true);
- if (doAdd) {
- tank.fill(toTake, true);
- }
- return item;
- }
-
- private ItemStack transferToTankUsingContainerData(ItemStack item, IInventory origin, ITankMachine destination, int tankID, boolean doAdd)
- {
- if (item == null) {
- return item;
- }
- FluidStack containerLiquid = null;
- FluidContainerRegistry.FluidContainerData containerLiquidData = null;
- for (FluidContainerRegistry.FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if (data.filledContainer.isItemEqual(item))
- {
- containerLiquidData = data;
- containerLiquid = data.fluid.copy();
- break;
- }
- }
- if (containerLiquid == null) {
- return item;
- }
- IFluidTank tank = destination.getTanks()[tankID];
-
- IValidatedTankContainer validated = (IValidatedTankContainer)Machine.getInterface(IValidatedTankContainer.class, destination);
- if ((validated != null) && (
- (!validated.isLiquidValidForTank(containerLiquid, tankID)) || (validated.isTankReadOnly(tankID)))) {
- return item;
- }
- FluidStack largeAmountOfLiquid = containerLiquid.copy();
- largeAmountOfLiquid.amount = tank.getCapacity();
- int amountAdded = tank.fill(largeAmountOfLiquid, false);
-
- int numberOfContainersToAdd = amountAdded / containerLiquid.amount;
- if (numberOfContainersToAdd > item.stackSize) {
- numberOfContainersToAdd = item.stackSize;
- }
- ItemStack leftOverContainers = item.copy();
- leftOverContainers.stackSize -= numberOfContainersToAdd;
- if (leftOverContainers.stackSize <= 0) {
- leftOverContainers = null;
- }
- ItemStack emptyContainers = containerLiquidData.emptyContainer.copy();
- emptyContainers.stackSize = 0;
- emptyContainers.stackSize += numberOfContainersToAdd;
- if (emptyContainers.stackSize <= 0) {
- emptyContainers = null;
- }
- TransferRequest containersDump = new TransferRequest(emptyContainers, origin);
-
- ItemStack containersThatCantBeDumped = containersDump.transfer(false);
- if (containersThatCantBeDumped != null) {
- return item;
- }
- if (doAdd)
- {
- FluidStack liquidToFillTank = containerLiquid.copy();
- liquidToFillTank.amount *= numberOfContainersToAdd;
- tank.fill(liquidToFillTank, true);
- containersDump.transfer(true);
- }
- return leftOverContainers;
- }
-
- private ItemStack transferFromTank(ItemStack item, IInventory origin, ITankMachine destination, int tankID, boolean doAdd)
- {
- item = transferFromTankUsingContainerData(item, origin, destination, tankID, doAdd);
- item = transferFromTankUsingFluidContainer(item, origin, destination, tankID, doAdd);
- return item;
- }
-
- private ItemStack transferFromTankUsingFluidContainer(ItemStack item, IInventory origin, ITankMachine destination, int tankID, boolean doAdd)
- {
- if ((item == null) || (!(item.getItem() instanceof IFluidContainerItem))) {
- return item;
- }
- IFluidContainerItem fluidContainer = (IFluidContainerItem)item.getItem();
-
- IFluidTank tank = destination.getTanks()[tankID];
-
- FluidStack fluid = tank.getFluid();
- if (fluid == null) {
- return item;
- }
- int amount = fluidContainer.fill(item, fluid, false);
-
- amount = Math.min(amount, tank.drain(amount, false) == null ? 0 : tank.drain(amount, false).amount);
- if (amount <= 0) {
- return item;
- }
- fluidContainer.fill(item, tank.drain(amount, doAdd), doAdd);
-
- return item;
- }
-
- private ItemStack transferFromTankUsingContainerData(ItemStack item, IInventory origin, ITankMachine destination, int tankID, boolean doAdd)
- {
- if (item == null) {
- return item;
- }
- IFluidTank tank = destination.getTanks()[tankID];
- FluidStack liquidInTank = tank.getFluid();
- if (liquidInTank == null) {
- return item;
- }
- FluidContainerRegistry.FluidContainerData containerLiquidData = null;
- for (FluidContainerRegistry.FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
- if ((data.emptyContainer.isItemEqual(item)) && (liquidInTank.isFluidEqual(data.fluid)))
- {
- containerLiquidData = data;
- break;
- }
- }
- FluidStack fluid = null;
- ItemStack filled = null;
- if (containerLiquidData != null)
- {
- fluid = containerLiquidData.fluid;
- filled = containerLiquidData.filledContainer;
- }
- if ((fluid == null) || (filled == null)) {
- return item;
- }
- int maximumExtractedLiquid = item.stackSize * fluid.amount;
-
- FluidStack drainedLiquid = tank.drain(maximumExtractedLiquid, false);
- int amountInTank = drainedLiquid == null ? 0 : drainedLiquid.amount;
-
- int numberOfContainersToFill = amountInTank / fluid.amount;
- if (numberOfContainersToFill > item.stackSize) {
- numberOfContainersToFill = item.stackSize;
- }
- ItemStack leftOverContainers = item.copy();
- leftOverContainers.stackSize -= numberOfContainersToFill;
- if (leftOverContainers.stackSize <= 0) {
- leftOverContainers = null;
- }
- ItemStack filledContainers = filled.copy();
- filledContainers.stackSize = 0;
- filledContainers.stackSize += numberOfContainersToFill;
- if (filledContainers.stackSize <= 0) {
- filledContainers = null;
- }
- TransferRequest containersDump = new TransferRequest(filledContainers, origin);
-
- ItemStack containersThatCantBeDumped = containersDump.transfer(false);
- if (containersThatCantBeDumped != null) {
- return item;
- }
- if (doAdd)
- {
- tank.drain(maximumExtractedLiquid, true);
- containersDump.transfer(true);
- }
- return leftOverContainers;
- }
-
- private List<TransferSlot> insertedSlots = new ArrayList();
- private List<Integer> insertedTanks = new ArrayList();
-
- public List<TransferSlot> getInsertedSlots()
- {
- return this.insertedSlots;
- }
-
- public List<Integer> getInsertedTanks()
- {
- return this.insertedTanks;
- }
-
- public static class TransferSlot
- {
- public int id;
- public IInventory inventory;
-
- public TransferSlot(int id, IInventory inventory)
- {
- this.id = id;
- this.inventory = inventory;
- }
- }
-
- public IInventory getOrigin()
- {
- return this.origin;
- }
-
- public IInventory getDestination()
- {
- return this.destination;
- }
-
- public ItemStack getItemToTransfer()
- {
- return this.itemToTransfer;
- }
-
- public int[] getTargetSlots()
- {
- return this.targetSlots;
- }
-
- public int[] getTargetTanks()
- {
- return this.targetTanks;
- }
-}
diff --git a/src/Java/binnie/core/mod/config/BinnieConfiguration.java b/src/Java/binnie/core/mod/config/BinnieConfiguration.java
deleted file mode 100644
index 09e5a657da..0000000000
--- a/src/Java/binnie/core/mod/config/BinnieConfiguration.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package binnie.core.mod.config;
-
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.proxy.BinnieProxy;
-import java.io.File;
-import net.minecraftforge.common.config.Configuration;
-
-class BinnieConfiguration
- extends Configuration
-{
- public AbstractMod mod;
- private String filename;
-
- public BinnieConfiguration(String filename, AbstractMod mod)
- {
- super(new File(BinnieCore.proxy.getDirectory(), filename));
- this.mod = mod;
- this.filename = filename;
- }
-}
diff --git a/src/Java/binnie/core/mod/config/BinnieItemData.java b/src/Java/binnie/core/mod/config/BinnieItemData.java
deleted file mode 100644
index 435edc122d..0000000000
--- a/src/Java/binnie/core/mod/config/BinnieItemData.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package binnie.core.mod.config;
-
-class BinnieItemData
-{
- private int item;
- private BinnieConfiguration configFile;
- private String configKey;
-
- public BinnieItemData(int item, BinnieConfiguration configFile, String configKey)
- {
- this.item = item;
- this.configFile = configFile;
- this.configKey = configKey;
- }
-}
diff --git a/src/Java/binnie/core/mod/config/ConfigFile.java b/src/Java/binnie/core/mod/config/ConfigFile.java
deleted file mode 100644
index 425ee52e98..0000000000
--- a/src/Java/binnie/core/mod/config/ConfigFile.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package binnie.core.mod.config;
-
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ConfigFile
-{
- String filename();
-}
diff --git a/src/Java/binnie/core/mod/config/ConfigProperty.java b/src/Java/binnie/core/mod/config/ConfigProperty.java
deleted file mode 100644
index d8e5f48339..0000000000
--- a/src/Java/binnie/core/mod/config/ConfigProperty.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package binnie.core.mod.config;
-
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target({java.lang.annotation.ElementType.FIELD})
-public @interface ConfigProperty
-{
- String key();
-
- String category() default "";
-
- String[] comment() default {};
-
- @Retention(RetentionPolicy.RUNTIME)
- @Target({java.lang.annotation.ElementType.ANNOTATION_TYPE})
- public static @interface Type
- {
- Class<? extends PropertyBase> propertyClass();
-
- String category() default "general";
- }
-}
diff --git a/src/Java/binnie/core/mod/config/ConfigurationMain.java b/src/Java/binnie/core/mod/config/ConfigurationMain.java
deleted file mode 100644
index e7924abe47..0000000000
--- a/src/Java/binnie/core/mod/config/ConfigurationMain.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package binnie.core.mod.config;
-
-@ConfigFile(filename="/config/forestry/binniecore/main.conf")
-public class ConfigurationMain {}
diff --git a/src/Java/binnie/core/mod/config/ConfigurationMods.java b/src/Java/binnie/core/mod/config/ConfigurationMods.java
deleted file mode 100644
index 77c2f66930..0000000000
--- a/src/Java/binnie/core/mod/config/ConfigurationMods.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package binnie.core.mod.config;
-
-@ConfigFile(filename="/config/forestry/binnie-mods.conf")
-public class ConfigurationMods
-{
- @ConfigProperty(key="extraBees", comment={"Enables the Extra Bees Mod."})
- @PropBoolean
- public static boolean extraBees = true;
- @ConfigProperty(key="extraTrees", comment={"Enables the Extra Trees Mod."})
- @PropBoolean
- public static boolean extraTrees = true;
- @ConfigProperty(key="botany", comment={"Enables the Botany Mod."})
- @PropBoolean
- public static boolean botany = true;
- @ConfigProperty(key="genetics", comment={"Enables the Genetics Mod."})
- @PropBoolean
- public static boolean genetics = true;
-}
diff --git a/src/Java/binnie/core/mod/config/ManagerConfig.java b/src/Java/binnie/core/mod/config/ManagerConfig.java
deleted file mode 100644
index 16e6df78f4..0000000000
--- a/src/Java/binnie/core/mod/config/ManagerConfig.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package binnie.core.mod.config;
-
-import binnie.core.AbstractMod;
-import binnie.core.ManagerBase;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import net.minecraftforge.common.config.Configuration;
-
-public class ManagerConfig
- extends ManagerBase
-{
- private Map<Class<?>, Configuration> configurations = new LinkedHashMap();
-
- public void registerConfiguration(Class<?> cls, AbstractMod mod)
- {
- if (cls.isAnnotationPresent(ConfigFile.class)) {
- loadConfiguration(cls, mod);
- }
- }
-
- public void loadConfiguration(Class<?> cls, AbstractMod mod)
- {
- try
- {
- String filename = ((ConfigFile)cls.getAnnotation(ConfigFile.class)).filename();
-
-
- BinnieConfiguration config = new BinnieConfiguration(filename, mod);
-
- config.load();
- for (Field field : cls.getFields()) {
- if (field.isAnnotationPresent(ConfigProperty.class))
- {
- ConfigProperty propertyAnnot = (ConfigProperty)field.getAnnotation(ConfigProperty.class);
- PropertyBase property;
- for (Annotation annotation : field.getAnnotations()) {
- if (annotation.annotationType().isAnnotationPresent(ConfigProperty.Type.class))
- {
- Class<?> propertyClass = ((ConfigProperty.Type)annotation.annotationType().getAnnotation(ConfigProperty.Type.class)).propertyClass();
-
- property = (PropertyBase)propertyClass.getConstructor(new Class[] { Field.class, BinnieConfiguration.class, ConfigProperty.class, annotation.annotationType() }).newInstance(new Object[] { field, config, propertyAnnot, annotation.annotationType().cast(annotation) });
- }
- }
- }
- }
- config.save();
-
- this.configurations.put(cls, config);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- private Map<AbstractMod, List<BinnieItemData>> itemIDs = new HashMap();
-
- public void addItemID(Integer configValue, String configKey, BinnieConfiguration configFile)
- {
- if (!this.itemIDs.containsKey(configFile.mod)) {
- this.itemIDs.put(configFile.mod, new ArrayList());
- }
- ((List)this.itemIDs.get(configFile.mod)).add(new BinnieItemData(configValue.intValue() + 256, configFile, configKey));
- }
-}
diff --git a/src/Java/binnie/core/mod/config/PropBoolean.java b/src/Java/binnie/core/mod/config/PropBoolean.java
deleted file mode 100644
index fc9094bdd8..0000000000
--- a/src/Java/binnie/core/mod/config/PropBoolean.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package binnie.core.mod.config;
-
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.reflect.Field;
-import net.minecraftforge.common.config.Configuration;
-import net.minecraftforge.common.config.Property;
-
-@Retention(RetentionPolicy.RUNTIME)
-@ConfigProperty.Type(propertyClass=PropertyBoolean.class)
-public @interface PropBoolean
-{
- public static class PropertyBoolean
- extends PropertyBase<Boolean, PropBoolean>
- {
- public PropertyBoolean(Field field, BinnieConfiguration file, ConfigProperty configProperty, PropBoolean annotedProperty)
- throws IllegalArgumentException, IllegalAccessException
- {
- super(file, configProperty, annotedProperty);
- }
-
- protected Property getProperty()
- {
- return this.file.get(getCategory(), getKey(), ((Boolean)this.defaultValue).booleanValue());
- }
-
- protected Boolean getConfigValue()
- {
- return Boolean.valueOf(this.property.getBoolean(((Boolean)this.defaultValue).booleanValue()));
- }
-
- protected void addComments()
- {
- addComment("Default value is " + this.defaultValue + ".");
- }
- }
-}
diff --git a/src/Java/binnie/core/mod/config/PropDouble.java b/src/Java/binnie/core/mod/config/PropDouble.java
deleted file mode 100644
index 331cd2774c..0000000000
--- a/src/Java/binnie/core/mod/config/PropDouble.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package binnie.core.mod.config;
-
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.reflect.Field;
-import net.minecraftforge.common.config.Configuration;
-import net.minecraftforge.common.config.Property;
-
-@Retention(RetentionPolicy.RUNTIME)
-@ConfigProperty.Type(propertyClass=PropertyDouble.class)
-public @interface PropDouble
-{
- public static class PropertyDouble
- extends PropertyBase<Double, PropDouble>
- {
- public PropertyDouble(Field field, BinnieConfiguration file, ConfigProperty configProperty, PropDouble annotedProperty)
- throws IllegalArgumentException, IllegalAccessException
- {
- super(file, configProperty, annotedProperty);
- }
-
- protected Property getProperty()
- {
- return this.file.get(getCategory(), getKey(), ((Double)this.defaultValue).doubleValue());
- }
-
- protected Double getConfigValue()
- {
- return Double.valueOf(this.property.getDouble(((Double)this.defaultValue).doubleValue()));
- }
-
- protected void addComments()
- {
- addComment("Default value is " + this.defaultValue + ".");
- }
- }
-}
diff --git a/src/Java/binnie/core/mod/config/PropInteger.java b/src/Java/binnie/core/mod/config/PropInteger.java
deleted file mode 100644
index f74c625a8c..0000000000
--- a/src/Java/binnie/core/mod/config/PropInteger.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package binnie.core.mod.config;
-
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.reflect.Field;
-import net.minecraftforge.common.config.Configuration;
-import net.minecraftforge.common.config.Property;
-
-@Retention(RetentionPolicy.RUNTIME)
-@ConfigProperty.Type(propertyClass=PropertyInteger.class)
-public @interface PropInteger
-{
- public static class PropertyInteger
- extends PropertyBase<Integer, PropInteger>
- {
- public PropertyInteger(Field field, BinnieConfiguration file, ConfigProperty configProperty, PropInteger annotedProperty)
- throws IllegalArgumentException, IllegalAccessException
- {
- super(file, configProperty, annotedProperty);
- }
-
- protected Property getProperty()
- {
- return this.file.get(getCategory(), getKey(), ((Integer)this.defaultValue).intValue());
- }
-
- protected Integer getConfigValue()
- {
- return Integer.valueOf(this.property.getInt(((Integer)this.defaultValue).intValue()));
- }
-
- protected void addComments()
- {
- addComment("Default value is " + this.defaultValue + ".");
- }
- }
-}
diff --git a/src/Java/binnie/core/mod/config/PropPercentage.java b/src/Java/binnie/core/mod/config/PropPercentage.java
deleted file mode 100644
index b51d8e3abf..0000000000
--- a/src/Java/binnie/core/mod/config/PropPercentage.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package binnie.core.mod.config;
-
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.reflect.Field;
-import net.minecraftforge.common.config.Configuration;
-import net.minecraftforge.common.config.Property;
-
-@Retention(RetentionPolicy.RUNTIME)
-@ConfigProperty.Type(propertyClass=PropertyPercentage.class)
-public @interface PropPercentage
-{
- int upper() default 100;
-
- int lower() default 0;
-
- public static class PropertyPercentage
- extends PropertyBase<Integer, PropPercentage>
- {
- public PropertyPercentage(Field field, BinnieConfiguration file, ConfigProperty configProperty, PropPercentage annotedProperty)
- throws IllegalArgumentException, IllegalAccessException
- {
- super(file, configProperty, annotedProperty);
- }
-
- protected Integer getConfigValue()
- {
- return Integer.valueOf(this.property.getInt(((Integer)this.defaultValue).intValue()));
- }
-
- protected void addComments()
- {
- addComment("Default value is " + this.defaultValue + "%.");
- addComment("Range is " + ((PropPercentage)this.annotatedProperty).lower() + "-" + ((PropPercentage)this.annotatedProperty).upper() + "%.");
- }
-
- protected Property getProperty()
- {
- return this.file.get(getCategory(), getKey(), ((Integer)this.defaultValue).intValue());
- }
- }
-}
diff --git a/src/Java/binnie/core/mod/config/PropertyBase.java b/src/Java/binnie/core/mod/config/PropertyBase.java
deleted file mode 100644
index 8ad13f833e..0000000000
--- a/src/Java/binnie/core/mod/config/PropertyBase.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package binnie.core.mod.config;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraftforge.common.config.Configuration;
-import net.minecraftforge.common.config.Property;
-
-abstract class PropertyBase<ValueType, AnnotationType extends Annotation>
-{
- Configuration file;
- Property property;
- ValueType defaultValue;
- private ConfigProperty configProperty;
- AnnotationType annotatedProperty;
- private List<String> comments = new ArrayList();
- private Field field;
-
- protected PropertyBase(Field field, BinnieConfiguration file, ConfigProperty configProperty, AnnotationType annotedProperty)
- throws IllegalArgumentException, IllegalAccessException
- {
- this.field = field;
- this.file = file;
- this.configProperty = configProperty;
- this.annotatedProperty = annotedProperty;
- this.defaultValue = getDefaultValue(field);
- this.property = getProperty();
- for (String comment : configProperty.comment()) {
- addComment(comment);
- }
- addComments();
- this.property.comment = getComment();
- field.set(null, getConfigValue());
- }
-
- protected abstract Property getProperty();
-
- protected abstract ValueType getConfigValue();
-
- protected abstract void addComments();
-
- protected String getCategory()
- {
- return this.configProperty.category().equals("") ? ((ConfigProperty.Type)this.annotatedProperty.annotationType().getAnnotation(ConfigProperty.Type.class)).category() : this.configProperty.category();
- }
-
- protected String getKey()
- {
- return this.configProperty.key();
- }
-
- protected ValueType getDefaultValue(Field field)
- throws IllegalArgumentException, IllegalAccessException
- {
- return field.get(null);
- }
-
- protected void addComment(String comment)
- {
- this.comments.add(comment);
- }
-
- protected String getComment()
- {
- String comment = "";
- for (String com : this.comments) {
- comment = comment + com + " ";
- }
- return comment;
- }
-}
diff --git a/src/Java/binnie/core/mod/parser/FieldParser.java b/src/Java/binnie/core/mod/parser/FieldParser.java
deleted file mode 100644
index c063d5aca9..0000000000
--- a/src/Java/binnie/core/mod/parser/FieldParser.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package binnie.core.mod.parser;
-
-import binnie.core.AbstractMod;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Collection;
-
-public abstract class FieldParser
-{
- public static Collection<FieldParser> parsers = new ArrayList();
-
- public abstract boolean isHandled(Field paramField, AbstractMod paramAbstractMod);
-
- public void preInit(Field field, AbstractMod mod)
- throws IllegalArgumentException, IllegalAccessException
- {}
-
- public void init(Field field, AbstractMod mod)
- throws IllegalArgumentException, IllegalAccessException
- {}
-
- public void postInit(Field field, AbstractMod mod)
- throws IllegalArgumentException, IllegalAccessException
- {}
-
- public static void preInitParse(Field field, AbstractMod mod)
- throws IllegalArgumentException, IllegalAccessException
- {
- for (FieldParser parser : parsers) {
- if (parser.isHandled(field, mod)) {
- parser.preInit(field, mod);
- }
- }
- }
-
- public static void initParse(Field field, AbstractMod mod)
- throws IllegalArgumentException, IllegalAccessException
- {
- for (FieldParser parser : parsers) {
- if (parser.isHandled(field, mod)) {
- parser.init(field, mod);
- }
- }
- }
-
- public static void postInitParse(Field field, AbstractMod mod)
- throws IllegalArgumentException, IllegalAccessException
- {
- for (FieldParser parser : parsers) {
- if (parser.isHandled(field, mod)) {
- parser.postInit(field, mod);
- }
- }
- }
-}
diff --git a/src/Java/binnie/core/mod/parser/ItemParser.java b/src/Java/binnie/core/mod/parser/ItemParser.java
deleted file mode 100644
index 8892a20aba..0000000000
--- a/src/Java/binnie/core/mod/parser/ItemParser.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package binnie.core.mod.parser;
-
-import binnie.core.AbstractMod;
-import cpw.mods.fml.common.registry.GameRegistry;
-import java.lang.reflect.Field;
-import net.minecraft.item.Item;
-
-public class ItemParser
- extends FieldParser
-{
- public boolean isHandled(Field field, AbstractMod mod)
- {
- return Item.class.isAssignableFrom(field.getType());
- }
-
- public void preInit(Field field, AbstractMod mod)
- throws IllegalArgumentException, IllegalAccessException
- {
- Item item = (Item)field.get(null);
- if (item != null) {
- GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));
- }
- }
-}
diff --git a/src/Java/binnie/core/multiblock/BlockMultiblockMachine.java b/src/Java/binnie/core/multiblock/BlockMultiblockMachine.java
deleted file mode 100644
index c2c549e1bd..0000000000
--- a/src/Java/binnie/core/multiblock/BlockMultiblockMachine.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package binnie.core.multiblock;
-
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public class BlockMultiblockMachine
- extends BlockContainer
-{
- public BlockMultiblockMachine(String blockName)
- {
- super(Material.iron);
- setHardness(1.5F);
- setBlockName(blockName);
- }
-
- public TileEntity createTileEntity(World world, int metadata)
- {
- return new TileEntityMultiblockMachine();
- }
-
- public TileEntity createNewTileEntity(World var1, int i)
- {
- return new TileEntityMultiblockMachine();
- }
-}
diff --git a/src/Java/binnie/core/multiblock/TileEntityMultiblockMachine.java b/src/Java/binnie/core/multiblock/TileEntityMultiblockMachine.java
deleted file mode 100644
index 0aaefc91c4..0000000000
--- a/src/Java/binnie/core/multiblock/TileEntityMultiblockMachine.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package binnie.core.multiblock;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.TileEntityMachine;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-class TileEntityMultiblockMachine
- extends TileEntity
-{
- private boolean inStructure;
- private int tileX;
- private int tileY;
- private int tileZ;
-
- boolean inStructure()
- {
- return this.inStructure;
- }
-
- public Machine getMachine()
- {
- return getMasterMachine();
- }
-
- private Machine getMasterMachine()
- {
- if (!this.inStructure) {
- return null;
- }
- TileEntity tile = this.worldObj.getTileEntity(this.xCoord + this.tileX, this.yCoord + this.tileY, this.zCoord + this.tileZ);
- if ((tile instanceof TileEntityMachine)) {
- return ((TileEntityMachine)tile).getMachine();
- }
- return null;
- }
-}
diff --git a/src/Java/binnie/core/network/BinnieCorePacketID.java b/src/Java/binnie/core/network/BinnieCorePacketID.java
deleted file mode 100644
index 669065ca45..0000000000
--- a/src/Java/binnie/core/network/BinnieCorePacketID.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package binnie.core.network;
-
-import binnie.core.BinnieCore;
-import binnie.core.block.TileEntityMetadata;
-import binnie.core.machines.IMachine;
-import binnie.core.machines.Machine;
-import binnie.core.machines.network.INetwork.TilePacketSync;
-import binnie.core.network.packet.MessageBinnie;
-import binnie.core.network.packet.MessageCraftGUI;
-import binnie.core.network.packet.MessageMetadata;
-import binnie.core.network.packet.MessageTileNBT;
-import binnie.core.network.packet.MessageUpdate;
-import binnie.core.proxy.BinnieProxy;
-import binnie.craftgui.minecraft.ContainerCraftGUI;
-import cpw.mods.fml.common.network.simpleimpl.MessageContext;
-import cpw.mods.fml.relauncher.Side;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.network.NetHandlerPlayServer;
-import net.minecraft.tileentity.TileEntity;
-
-public enum BinnieCorePacketID
- implements IPacketID
-{
- NetworkEntityUpdate, TileMetadata, CraftGUIAction, TileDescriptionSync;
-
- private BinnieCorePacketID() {}
-
- public void onMessage(MessageBinnie message, MessageContext context)
- {
- if (this == NetworkEntityUpdate)
- {
- MessageUpdate packet = new MessageUpdate(message);
- TileEntity tile = packet.getTileEntity(BinnieCore.proxy.getWorld());
- if ((tile instanceof INetworkedEntity)) {
- ((INetworkedEntity)tile).readFromPacket(packet.payload);
- }
- }
- else if (this == TileMetadata)
- {
- MessageMetadata packet = new MessageMetadata(message);
- TileEntity tile = packet.getTileEntity(BinnieCore.proxy.getWorld());
- if ((tile instanceof TileEntityMetadata)) {
- ((TileEntityMetadata)tile).setTileMetadata(packet.meta, true);
- }
- }
- else if ((this == CraftGUIAction) && (context.side == Side.CLIENT))
- {
- MessageCraftGUI packet = new MessageCraftGUI(message);
-
- EntityPlayer player = BinnieCore.proxy.getPlayer();
- if (((player.openContainer instanceof ContainerCraftGUI)) && (packet.getTagCompound() != null)) {
- ((ContainerCraftGUI)player.openContainer).recieveNBT(Side.CLIENT, player, packet.getTagCompound());
- }
- }
- else if ((this == CraftGUIAction) && (context.side == Side.SERVER) && ((context.netHandler instanceof NetHandlerPlayServer)))
- {
- MessageCraftGUI packet = new MessageCraftGUI(message);
-
- EntityPlayer player = ((NetHandlerPlayServer)context.netHandler).playerEntity;
- if (((player.openContainer instanceof ContainerCraftGUI)) && (packet.getTagCompound() != null)) {
- ((ContainerCraftGUI)player.openContainer).recieveNBT(Side.SERVER, player, packet.getTagCompound());
- }
- }
- else if ((this == TileDescriptionSync) && (context.side == Side.CLIENT))
- {
- MessageTileNBT packet = new MessageTileNBT(message);
- TileEntity tile = packet.getTarget(BinnieCore.proxy.getWorld());
- if ((tile != null) && (packet.getTagCompound() != null))
- {
- IMachine machine = Machine.getMachine(tile);
- if ((machine != null) && ((machine instanceof INetwork.TilePacketSync))) {
- ((INetwork.TilePacketSync)machine).syncFromNBT(packet.getTagCompound());
- }
- }
- }
- }
-}
diff --git a/src/Java/binnie/core/network/BinniePacketHandler.java b/src/Java/binnie/core/network/BinniePacketHandler.java
deleted file mode 100644
index c7ad54c120..0000000000
--- a/src/Java/binnie/core/network/BinniePacketHandler.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package binnie.core.network;
-
-import binnie.core.AbstractMod;
-import binnie.core.network.packet.MessageBinnie;
-import cpw.mods.fml.common.network.simpleimpl.IMessage;
-import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
-import cpw.mods.fml.common.network.simpleimpl.MessageContext;
-
-public abstract class BinniePacketHandler
- implements IMessageHandler<MessageBinnie, IMessage>
-{
- private IPacketProvider provider;
-
- public BinniePacketHandler(AbstractMod mod)
- {
- setProvider(mod);
- }
-
- public void setProvider(IPacketProvider provider)
- {
- this.provider = provider;
- }
-
- public IMessage onMessage(MessageBinnie message, MessageContext ctx)
- {
- try
- {
- int packetId = message.id;
- for (IPacketID id : this.provider.getPacketIDs()) {
- if (id.ordinal() == packetId)
- {
- id.onMessage(message, ctx);
- return null;
- }
- }
- }
- catch (Exception ex)
- {
- throw new RuntimeException(ex);
- }
- return null;
- }
-}
diff --git a/src/Java/binnie/core/network/INetworkedEntity.java b/src/Java/binnie/core/network/INetworkedEntity.java
deleted file mode 100644
index e126a4559b..0000000000
--- a/src/Java/binnie/core/network/INetworkedEntity.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package binnie.core.network;
-
-import binnie.core.network.packet.PacketPayload;
-
-public abstract interface INetworkedEntity
-{
- public abstract void writeToPacket(PacketPayload paramPacketPayload);
-
- public abstract void readFromPacket(PacketPayload paramPacketPayload);
-}
diff --git a/src/Java/binnie/core/network/IOrdinaled.java b/src/Java/binnie/core/network/IOrdinaled.java
deleted file mode 100644
index 2022f04820..0000000000
--- a/src/Java/binnie/core/network/IOrdinaled.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package binnie.core.network;
-
-public abstract interface IOrdinaled
-{
- public abstract int ordinal();
-}
diff --git a/src/Java/binnie/core/network/IPacketID.java b/src/Java/binnie/core/network/IPacketID.java
deleted file mode 100644
index 193fbba617..0000000000
--- a/src/Java/binnie/core/network/IPacketID.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package binnie.core.network;
-
-import binnie.core.network.packet.MessageBinnie;
-import cpw.mods.fml.common.network.simpleimpl.MessageContext;
-
-public abstract interface IPacketID
- extends IOrdinaled
-{
- public abstract void onMessage(MessageBinnie paramMessageBinnie, MessageContext paramMessageContext);
-}
diff --git a/src/Java/binnie/core/network/IPacketProvider.java b/src/Java/binnie/core/network/IPacketProvider.java
deleted file mode 100644
index 98f48f69b3..0000000000
--- a/src/Java/binnie/core/network/IPacketProvider.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.core.network;
-
-public abstract interface IPacketProvider
-{
- public abstract String getChannel();
-
- public abstract IPacketID[] getPacketIDs();
-}
diff --git a/src/Java/binnie/core/network/packet/IPacket.java b/src/Java/binnie/core/network/packet/IPacket.java
deleted file mode 100644
index b86516ea41..0000000000
--- a/src/Java/binnie/core/network/packet/IPacket.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.core.network.packet;
-
-import net.minecraft.network.Packet;
-
-public abstract interface IPacket
-{
- public abstract Packet getPacket();
-}
diff --git a/src/Java/binnie/core/network/packet/IPacketLocation.java b/src/Java/binnie/core/network/packet/IPacketLocation.java
deleted file mode 100644
index d9d46cce70..0000000000
--- a/src/Java/binnie/core/network/packet/IPacketLocation.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package binnie.core.network.packet;
-
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-abstract interface IPacketLocation
-{
- public abstract TileEntity getTarget(World paramWorld);
-
- public abstract int getX();
-
- public abstract int getY();
-
- public abstract int getZ();
-}
diff --git a/src/Java/binnie/core/network/packet/IndexInPayload.java b/src/Java/binnie/core/network/packet/IndexInPayload.java
deleted file mode 100644
index ff59a0783f..0000000000
--- a/src/Java/binnie/core/network/packet/IndexInPayload.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package binnie.core.network.packet;
-
-public class IndexInPayload
-{
- public IndexInPayload(int intIndex, int floatIndex, int stringIndex)
- {
- this.intIndex = intIndex;
- this.floatIndex = floatIndex;
- this.stringIndex = stringIndex;
- }
-
- public int intIndex = 0;
- public int floatIndex = 0;
- public int stringIndex = 0;
-}
diff --git a/src/Java/binnie/core/network/packet/MachinePayload.java b/src/Java/binnie/core/network/packet/MachinePayload.java
deleted file mode 100644
index 11eb8b62b9..0000000000
--- a/src/Java/binnie/core/network/packet/MachinePayload.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package binnie.core.network.packet;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class MachinePayload
-{
- private List<Integer> intPayload = new ArrayList();
- private List<Float> floatPayload = new ArrayList();
- private List<String> stringPayload = new ArrayList();
- private int id = 0;
-
- public MachinePayload(int id)
- {
- this.id = id;
- this.intPayload.clear();
- this.floatPayload.clear();
- this.stringPayload.clear();
- }
-
- public MachinePayload() {}
-
- public void addInteger(int a)
- {
- this.intPayload.add(Integer.valueOf(a));
- }
-
- public void addFloat(float a)
- {
- this.floatPayload.add(Float.valueOf(a));
- }
-
- public void addString(String a)
- {
- this.stringPayload.add(a);
- }
-
- public int getInteger()
- {
- return ((Integer)this.intPayload.remove(0)).intValue();
- }
-
- public float getFloat()
- {
- return ((Float)this.floatPayload.remove(0)).floatValue();
- }
-
- public String getString()
- {
- return (String)this.stringPayload.remove(0);
- }
-
- public void append(MachinePayload other)
- {
- if (other == null) {
- return;
- }
- this.intPayload.addAll(other.intPayload);
- this.floatPayload.addAll(other.floatPayload);
- this.stringPayload.addAll(other.stringPayload);
- }
-
- public boolean isEmpty()
- {
- return (this.intPayload.isEmpty()) && (this.floatPayload.isEmpty()) && (this.stringPayload.isEmpty());
- }
-
- public int getID()
- {
- return this.id;
- }
-
- public void setID(int readInt)
- {
- this.id = readInt;
- }
-}
diff --git a/src/Java/binnie/core/network/packet/MessageBase.java b/src/Java/binnie/core/network/packet/MessageBase.java
deleted file mode 100644
index e18da968ef..0000000000
--- a/src/Java/binnie/core/network/packet/MessageBase.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package binnie.core.network.packet;
-
-import io.netty.buffer.ByteBuf;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import net.minecraft.nbt.CompressedStreamTools;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class MessageBase
-{
- private int id;
-
- public MessageBase(int id)
- {
- this.id = id;
- }
-
- public MessageBase(MessageBinnie message)
- {
- try
- {
- readData(message.data);
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
-
- public MessageBinnie GetMessage()
- {
- return new MessageBinnie(this.id, this);
- }
-
- protected NBTTagCompound readNBTTagCompound(ByteBuf data)
- throws IOException
- {
- short length = data.readShort();
- if (length < 0) {
- return null;
- }
- byte[] compressed = new byte[length];
- data.readBytes(compressed);
- return CompressedStreamTools.readCompressed(new ByteArrayInputStream(compressed));
- }
-
- protected void writeNBTTagCompound(NBTTagCompound nbttagcompound, ByteBuf data)
- throws IOException
- {
- if (nbttagcompound == null)
- {
- data.writeShort(-1);
- }
- else
- {
- byte[] compressed = CompressedStreamTools.compress(nbttagcompound);
- data.writeShort((short)compressed.length);
- data.writeBytes(compressed);
- }
- }
-
- public void writeData(ByteBuf data)
- throws IOException
- {}
-
- public void readData(ByteBuf data)
- throws IOException
- {}
-}
diff --git a/src/Java/binnie/core/network/packet/MessageBinnie.java b/src/Java/binnie/core/network/packet/MessageBinnie.java
deleted file mode 100644
index 0559a07e30..0000000000
--- a/src/Java/binnie/core/network/packet/MessageBinnie.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package binnie.core.network.packet;
-
-import cpw.mods.fml.common.network.simpleimpl.IMessage;
-import io.netty.buffer.ByteBuf;
-import java.io.IOException;
-
-public final class MessageBinnie
- implements IMessage
-{
- public int id;
- private MessageBase message;
- ByteBuf data;
-
- public MessageBinnie() {}
-
- public MessageBinnie(int id, MessageBase base)
- {
- this.id = id;
- this.message = base;
- }
-
- public void toBytes(ByteBuf buf)
- {
- buf.writeByte(this.id);
- try
- {
- this.message.writeData(buf);
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
-
- public void fromBytes(ByteBuf buf)
- {
- this.id = buf.readByte();
- this.data = buf;
- }
-}
diff --git a/src/Java/binnie/core/network/packet/MessageContainerUpdate.java b/src/Java/binnie/core/network/packet/MessageContainerUpdate.java
deleted file mode 100644
index 98e64b0d1f..0000000000
--- a/src/Java/binnie/core/network/packet/MessageContainerUpdate.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package binnie.core.network.packet;
-
-import net.minecraft.nbt.NBTTagCompound;
-
-public class MessageContainerUpdate
- extends MessageCraftGUI
-{
- public MessageContainerUpdate(NBTTagCompound nbt)
- {
- super(nbt);
- }
-
- public MessageContainerUpdate(MessageBinnie message)
- {
- super(message);
- }
-}
diff --git a/src/Java/binnie/core/network/packet/MessageCoordinates.java b/src/Java/binnie/core/network/packet/MessageCoordinates.java
deleted file mode 100644
index 928ed59d05..0000000000
--- a/src/Java/binnie/core/network/packet/MessageCoordinates.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package binnie.core.network.packet;
-
-import io.netty.buffer.ByteBuf;
-import java.io.IOException;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.ChunkCoordinates;
-import net.minecraft.world.World;
-
-public class MessageCoordinates
- extends MessageBase
-{
- public int posX;
- public int posY;
- public int posZ;
-
- public MessageCoordinates(MessageBinnie message)
- {
- super(message);
- }
-
- public MessageCoordinates(int id, ChunkCoordinates coordinates)
- {
- this(id, coordinates.posX, coordinates.posY, coordinates.posZ);
- }
-
- public MessageCoordinates(int id, int posX, int posY, int posZ)
- {
- super(id);
- this.posX = posX;
- this.posY = posY;
- this.posZ = posZ;
- }
-
- public void writeData(ByteBuf data)
- throws IOException
- {
- data.writeInt(this.posX);
- data.writeInt(this.posY);
- data.writeInt(this.posZ);
- }
-
- public void readData(ByteBuf data)
- throws IOException
- {
- this.posX = data.readInt();
- this.posY = data.readInt();
- this.posZ = data.readInt();
- }
-
- public ChunkCoordinates getCoordinates()
- {
- return new ChunkCoordinates(this.posX, this.posY, this.posZ);
- }
-
- public TileEntity getTileEntity(World world)
- {
- return world.getTileEntity(this.posX, this.posY, this.posZ);
- }
-}
diff --git a/src/Java/binnie/core/network/packet/MessageCraftGUI.java b/src/Java/binnie/core/network/packet/MessageCraftGUI.java
deleted file mode 100644
index 805c4a651b..0000000000
--- a/src/Java/binnie/core/network/packet/MessageCraftGUI.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package binnie.core.network.packet;
-
-import binnie.core.network.BinnieCorePacketID;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class MessageCraftGUI
- extends MessageNBT
-{
- public MessageCraftGUI(MessageBinnie message)
- {
- super(message);
- }
-
- public MessageCraftGUI(NBTTagCompound action)
- {
- super(BinnieCorePacketID.CraftGUIAction.ordinal(), action);
- }
-}
diff --git a/src/Java/binnie/core/network/packet/MessageMetadata.java b/src/Java/binnie/core/network/packet/MessageMetadata.java
deleted file mode 100644
index c8ce46dedb..0000000000
--- a/src/Java/binnie/core/network/packet/MessageMetadata.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package binnie.core.network.packet;
-
-import binnie.core.network.BinnieCorePacketID;
-import io.netty.buffer.ByteBuf;
-import java.io.IOException;
-
-public class MessageMetadata
- extends MessageCoordinates
-{
- public int meta;
-
- public MessageMetadata(int posX, int posY, int posZ, int meta)
- {
- super(BinnieCorePacketID.TileMetadata.ordinal(), posX, posY, posZ);
- this.meta = meta;
- }
-
- public MessageMetadata(MessageBinnie message)
- {
- super(message);
- }
-
- public void writeData(ByteBuf data)
- throws IOException
- {
- super.writeData(data);
- data.writeInt(this.meta);
- }
-
- public void readData(ByteBuf data)
- throws IOException
- {
- super.readData(data);
- this.meta = data.readInt();
- }
-}
diff --git a/src/Java/binnie/core/network/packet/MessageNBT.java b/src/Java/binnie/core/network/packet/MessageNBT.java
deleted file mode 100644
index c1c5345987..0000000000
--- a/src/Java/binnie/core/network/packet/MessageNBT.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package binnie.core.network.packet;
-
-import io.netty.buffer.ByteBuf;
-import java.io.IOException;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class MessageNBT
- extends MessageBase
-{
- NBTTagCompound nbt;
-
- public NBTTagCompound getTagCompound()
- {
- return this.nbt;
- }
-
- void setTagCompound(NBTTagCompound nbt)
- {
- this.nbt = nbt;
- }
-
- public MessageNBT(int id)
- {
- super(id);
- }
-
- public MessageNBT(int id, NBTTagCompound nbt)
- {
- this(id);
- setTagCompound(nbt);
- }
-
- public MessageNBT(MessageBinnie message)
- {
- super(message);
- }
-
- public void writeData(ByteBuf data)
- throws IOException
- {
- writeNBTTagCompound(this.nbt, data);
- }
-
- public void readData(ByteBuf data)
- throws IOException
- {
- this.nbt = readNBTTagCompound(data);
- }
-}
diff --git a/src/Java/binnie/core/network/packet/MessageTileNBT.java b/src/Java/binnie/core/network/packet/MessageTileNBT.java
deleted file mode 100644
index 7ba41b8d09..0000000000
--- a/src/Java/binnie/core/network/packet/MessageTileNBT.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package binnie.core.network.packet;
-
-import io.netty.buffer.ByteBuf;
-import java.io.IOException;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public class MessageTileNBT
- extends MessageNBT
- implements IPacketLocation
-{
- private int posX;
- private int posY;
- private int posZ;
-
- public MessageTileNBT(MessageBinnie message)
- {
- super(message);
- }
-
- public MessageTileNBT(int id, TileEntity tile, NBTTagCompound nbt)
- {
- super(id);
-
- this.posX = tile.xCoord;
- this.posY = tile.yCoord;
- this.posZ = tile.zCoord;
-
- this.nbt = nbt;
- }
-
- public void writeData(ByteBuf data)
- throws IOException
- {
- data.writeInt(this.posX);
- data.writeInt(this.posY);
- data.writeInt(this.posZ);
-
- super.writeData(data);
- }
-
- public void readData(ByteBuf data)
- throws IOException
- {
- this.posX = data.readInt();
- this.posY = data.readInt();
- this.posZ = data.readInt();
-
- super.readData(data);
- }
-
- public TileEntity getTarget(World world)
- {
- return world.getTileEntity(this.posX, this.posY, this.posZ);
- }
-
- public int getX()
- {
- return this.posX;
- }
-
- public int getY()
- {
- return this.posY;
- }
-
- public int getZ()
- {
- return this.posZ;
- }
-
- public NBTTagCompound getTagCompound()
- {
- return this.nbt;
- }
-
- void setTagCompound(NBTTagCompound nbt)
- {
- this.nbt = nbt;
- }
-}
diff --git a/src/Java/binnie/core/network/packet/MessageUpdate.java b/src/Java/binnie/core/network/packet/MessageUpdate.java
deleted file mode 100644
index 053246b318..0000000000
--- a/src/Java/binnie/core/network/packet/MessageUpdate.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package binnie.core.network.packet;
-
-import binnie.core.network.INetworkedEntity;
-import io.netty.buffer.ByteBuf;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public class MessageUpdate
- extends MessageCoordinates
-{
- public PacketPayload payload;
-
- public MessageUpdate(MessageBinnie message)
- {
- super(message);
- }
-
- public MessageUpdate(int id, INetworkedEntity tile)
- {
- super(id, ((TileEntity)tile).xCoord, ((TileEntity)tile).yCoord, ((TileEntity)tile).zCoord);
- this.payload = new PacketPayload();
- tile.writeToPacket(this.payload);
- }
-
- public void writeData(ByteBuf data)
- throws IOException
- {
- super.writeData(data);
- if (this.payload == null)
- {
- data.writeInt(0);
- data.writeInt(0);
- data.writeInt(0);
- return;
- }
- data.writeInt(this.payload.intPayload.size());
- data.writeInt(this.payload.floatPayload.size());
- data.writeInt(this.payload.stringPayload.size());
- for (Iterator i$ = this.payload.intPayload.iterator(); i$.hasNext();)
- {
- int intData = ((Integer)i$.next()).intValue();
- data.writeInt(intData);
- }
- for (Iterator i$ = this.payload.floatPayload.iterator(); i$.hasNext();)
- {
- float floatData = ((Float)i$.next()).floatValue();
- data.writeFloat(floatData);
- }
- for (String stringData : this.payload.stringPayload)
- {
- byte[] bytes = stringData.getBytes("UTF-8");
- data.writeShort(bytes.length);
- data.writeBytes(bytes);
- }
- }
-
- public void readData(ByteBuf data)
- throws IOException
- {
- super.readData(data);
-
- this.payload = new PacketPayload();
-
- int intLength = data.readInt();
- int floatLength = data.readInt();
- int stringLength = data.readInt();
-
- this.payload.intPayload.clear();
- this.payload.floatPayload.clear();
- this.payload.stringPayload.clear();
- for (int i = 0; i < intLength; i++) {
- this.payload.addInteger(data.readInt());
- }
- for (int i = 0; i < floatLength; i++) {
- this.payload.addFloat(data.readFloat());
- }
- for (int i = 0; i < stringLength; i++)
- {
- int length = data.readShort();
- byte[] string = data.readBytes(length).array();
- this.payload.addString(new String(string, "UTF-8"));
- }
- }
-
- public TileEntity getTarget(World world)
- {
- return world.getTileEntity(this.posX, this.posY, this.posZ);
- }
-}
diff --git a/src/Java/binnie/core/network/packet/PacketPayload.java b/src/Java/binnie/core/network/packet/PacketPayload.java
deleted file mode 100644
index 57d1a13759..0000000000
--- a/src/Java/binnie/core/network/packet/PacketPayload.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package binnie.core.network.packet;
-
-import binnie.core.network.INetworkedEntity;
-import java.util.ArrayList;
-import java.util.List;
-
-public class PacketPayload
-{
- public List<Integer> intPayload = new ArrayList();
- public List<Float> floatPayload = new ArrayList();
- public List<String> stringPayload = new ArrayList();
-
- public PacketPayload()
- {
- this.intPayload.clear();
- this.floatPayload.clear();
- this.stringPayload.clear();
- }
-
- public PacketPayload(INetworkedEntity tile)
- {
- this();
- tile.writeToPacket(this);
- }
-
- public void addInteger(int a)
- {
- this.intPayload.add(Integer.valueOf(a));
- }
-
- public void addFloat(float a)
- {
- this.floatPayload.add(Float.valueOf(a));
- }
-
- public void addString(String a)
- {
- this.stringPayload.add(a);
- }
-
- public int getInteger()
- {
- return ((Integer)this.intPayload.remove(0)).intValue();
- }
-
- public float getFloat()
- {
- return ((Float)this.floatPayload.remove(0)).floatValue();
- }
-
- public String getString()
- {
- return (String)this.stringPayload.remove(0);
- }
-
- public void append(PacketPayload other)
- {
- if (other == null) {
- return;
- }
- this.intPayload.addAll(other.intPayload);
- this.floatPayload.addAll(other.floatPayload);
- this.stringPayload.addAll(other.stringPayload);
- }
-
- public boolean isEmpty()
- {
- return (this.intPayload.isEmpty()) && (this.floatPayload.isEmpty()) && (this.stringPayload.isEmpty());
- }
-}
diff --git a/src/Java/binnie/core/proxy/BinnieModProxy.java b/src/Java/binnie/core/proxy/BinnieModProxy.java
deleted file mode 100644
index a6697b384f..0000000000
--- a/src/Java/binnie/core/proxy/BinnieModProxy.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package binnie.core.proxy;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.gui.IBinnieGUID;
-import binnie.core.language.ManagerLanguage;
-import binnie.core.network.packet.MessageBase;
-import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.util.IIcon;
-
-public class BinnieModProxy
- implements IBinnieModProxy
-{
- private AbstractMod mod;
-
- public BinnieModProxy(AbstractMod mod)
- {
- this.mod = mod;
- }
-
- public void openGui(IBinnieGUID ID, EntityPlayer player, int x, int y, int z)
- {
- BinnieCore.proxy.openGui(this.mod, ID.ordinal(), player, x, y, z);
- }
-
- public void sendToAll(MessageBase packet)
- {
- this.mod.getNetworkWrapper().sendToAll(packet.GetMessage());
- }
-
- public void sendToPlayer(MessageBase packet, EntityPlayer entityplayer)
- {
- if ((entityplayer instanceof EntityPlayerMP)) {
- this.mod.getNetworkWrapper().sendTo(packet.GetMessage(), (EntityPlayerMP)entityplayer);
- }
- }
-
- public void sendToServer(MessageBase packet)
- {
- this.mod.getNetworkWrapper().sendToServer(packet.GetMessage());
- }
-
- public IIcon getIcon(IIconRegister register, String string)
- {
- return BinnieCore.proxy.getIcon(register, this.mod.getModID(), string);
- }
-
- public void preInit() {}
-
- public void init() {}
-
- public void postInit() {}
-
- public String localise(String string)
- {
- return Binnie.Language.localise(this.mod, string);
- }
-
- public String localiseOrBlank(String string)
- {
- return Binnie.Language.localiseOrBlank(this.mod, string);
- }
-}
diff --git a/src/Java/binnie/core/proxy/BinnieProxy.java b/src/Java/binnie/core/proxy/BinnieProxy.java
deleted file mode 100644
index 04a63b8c67..0000000000
--- a/src/Java/binnie/core/proxy/BinnieProxy.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package binnie.core.proxy;
-
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.network.BinnieCorePacketID;
-import binnie.core.network.INetworkedEntity;
-import binnie.core.network.packet.MessageUpdate;
-import binnie.core.resource.BinnieResource;
-import cpw.mods.fml.client.registry.RenderingRegistry;
-import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.common.registry.GameRegistry;
-import java.io.File;
-import java.util.Map;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.server.MinecraftServer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.world.World;
-import net.minecraftforge.client.IItemRenderer;
-
-public class BinnieProxy
- extends BinnieModProxy
- implements IBinnieProxy
-{
- public BinnieProxy()
- {
- super(BinnieCore.instance);
- }
-
- public void preInit() {}
-
- public void init() {}
-
- public void postInit() {}
-
- public void bindTexture(BinnieResource texture) {}
-
- public boolean checkTexture(BinnieResource location)
- {
- return false;
- }
-
- public int getUniqueRenderID()
- {
- return RenderingRegistry.getNextAvailableRenderId();
- }
-
- public void openGui(AbstractMod mod, int id, EntityPlayer player, int x, int y, int z)
- {
- player.openGui(mod, id, player.worldObj, x, y, z);
- }
-
- public boolean isSimulating(World world)
- {
- return true;
- }
-
- public void registerCustomItemRenderer(Item item, IItemRenderer itemRenderer) {}
-
- public boolean needsTagCompoundSynched(Item item)
- {
- return item.getShareTag();
- }
-
- public World getWorld()
- {
- return null;
- }
-
- public void throwException(String message, Throwable e)
- {
- FMLCommonHandler.instance().raiseException(e, message, true);
- }
-
- public Minecraft getMinecraftInstance()
- {
- return null;
- }
-
- public boolean isClient()
- {
- return false;
- }
-
- public boolean isServer()
- {
- return true;
- }
-
- public File getDirectory()
- {
- return new File("./");
- }
-
- public void registerTileEntity(Class<? extends TileEntity> tile, String id, Object renderer)
- {
- GameRegistry.registerTileEntity(tile, id);
- }
-
- public void createPipe(Item pipe) {}
-
- public boolean isDebug()
- {
- return System.getenv().containsKey("BINNIE_DEBUG");
- }
-
- public void registerBlockRenderer(Object renderer) {}
-
- public Object createObject(String renderer)
- {
- return null;
- }
-
- public void sendNetworkEntityPacket(INetworkedEntity entity)
- {
- MessageUpdate packet = new MessageUpdate(BinnieCorePacketID.NetworkEntityUpdate.ordinal(), entity);
- sendToAll(packet);
- }
-
- public IIcon getIcon(IIconRegister register, String mod, String name)
- {
- return null;
- }
-
- private short uniqueTextureUID = 1200;
-
- public void handleTextureRefresh(IIconRegister register, int type) {}
-
- public void handlePostTextureRefresh(IIconRegister register, int type) {}
-
- public short getUniqueTextureUID()
- {
- return this.uniqueTextureUID++;
- }
-
- public void bindTexture(ResourceLocation location) {}
-
- public boolean isShiftDown()
- {
- return false;
- }
-
- public EntityPlayer getPlayer()
- {
- return null;
- }
-
- public MinecraftServer getServer()
- {
- return MinecraftServer.getServer();
- }
-}
diff --git a/src/Java/binnie/core/proxy/BinnieProxyClient.java b/src/Java/binnie/core/proxy/BinnieProxyClient.java
deleted file mode 100644
index 4eb3db5727..0000000000
--- a/src/Java/binnie/core/proxy/BinnieProxyClient.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package binnie.core.proxy;
-
-import binnie.Binnie;
-import binnie.core.liquid.ManagerLiquid;
-import binnie.core.resource.BinnieResource;
-import binnie.craftgui.resource.minecraft.CraftGUIResourceManager;
-import cpw.mods.fml.client.FMLClientHandler;
-import cpw.mods.fml.client.registry.ClientRegistry;
-import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
-import cpw.mods.fml.client.registry.RenderingRegistry;
-import cpw.mods.fml.common.registry.GameRegistry;
-import java.io.File;
-import java.io.IOException;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.client.renderer.texture.ITextureObject;
-import net.minecraft.client.renderer.texture.SimpleTexture;
-import net.minecraft.client.renderer.texture.TextureManager;
-import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
-import net.minecraft.client.resources.IReloadableResourceManager;
-import net.minecraft.client.resources.IResourceManager;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.world.World;
-import net.minecraftforge.client.IItemRenderer;
-import net.minecraftforge.client.MinecraftForgeClient;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.GL11;
-
-public final class BinnieProxyClient
- extends BinnieProxy
- implements IBinnieProxy
-{
- public void bindTexture(BinnieResource texture)
- {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- bindTexture(texture.getResourceLocation());
- }
-
- public void bindTexture(ResourceLocation location)
- {
- getMinecraftInstance().getTextureManager().bindTexture(location);
- }
-
- public boolean checkTexture(BinnieResource location)
- {
- SimpleTexture texture = new SimpleTexture(location.getResourceLocation());
- try
- {
- texture.loadTexture(getMinecraftInstance().getResourceManager());
- }
- catch (IOException e)
- {
- return false;
- }
- return true;
- }
-
- public boolean isSimulating(World world)
- {
- return !world.isRemote;
- }
-
- public void registerCustomItemRenderer(Item item, IItemRenderer itemRenderer)
- {
- MinecraftForgeClient.registerItemRenderer(item, itemRenderer);
- }
-
- public World getWorld()
- {
- return getMinecraftInstance().theWorld;
- }
-
- public Minecraft getMinecraftInstance()
- {
- return FMLClientHandler.instance().getClient();
- }
-
- public boolean isClient()
- {
- return true;
- }
-
- public boolean isServer()
- {
- return false;
- }
-
- public File getDirectory()
- {
- return new File(".");
- }
-
- public void registerTileEntity(Class<? extends TileEntity> tile, String id, Object renderer)
- {
- if ((renderer != null) && ((renderer instanceof TileEntitySpecialRenderer))) {
- ClientRegistry.registerTileEntity(tile, id, (TileEntitySpecialRenderer)renderer);
- } else {
- GameRegistry.registerTileEntity(tile, id);
- }
- }
-
- public void registerBlockRenderer(Object renderer)
- {
- if ((renderer != null) && ((renderer instanceof ISimpleBlockRenderingHandler))) {
- RenderingRegistry.registerBlockHandler((ISimpleBlockRenderingHandler)renderer);
- }
- }
-
- public void createPipe(Item pipe) {}
-
- public Object createObject(String renderer)
- {
- Object object = null;
- try
- {
- Class<?> rendererClass = Class.forName(renderer);
- if (rendererClass != null) {
- object = rendererClass.newInstance();
- }
- }
- catch (Exception e) {}
- return object;
- }
-
- public IIcon getIcon(IIconRegister register, String mod, String name)
- {
- return register.registerIcon(mod + ":" + name);
- }
-
- public boolean isShiftDown()
- {
- return (Keyboard.isKeyDown(42)) || (Keyboard.isKeyDown(54));
- }
-
- public EntityPlayer getPlayer()
- {
- return Minecraft.getMinecraft().thePlayer;
- }
-
- public void handlePreTextureRefresh(IIconRegister register, int type)
- {
- if (type == 0) {
- Binnie.Liquid.reloadIcons(register);
- }
- }
-
- public void preInit()
- {
- IResourceManager manager = Minecraft.getMinecraft().getResourceManager();
- if ((manager instanceof IReloadableResourceManager)) {
- ((IReloadableResourceManager)manager).registerReloadListener(new CraftGUIResourceManager());
- }
- }
-}
diff --git a/src/Java/binnie/core/proxy/BinnieProxyServer.java b/src/Java/binnie/core/proxy/BinnieProxyServer.java
deleted file mode 100644
index 99e0164974..0000000000
--- a/src/Java/binnie/core/proxy/BinnieProxyServer.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package binnie.core.proxy;
-
-public class BinnieProxyServer
- extends BinnieProxy
- implements IBinnieProxy
-{}
diff --git a/src/Java/binnie/core/proxy/IBinnieModProxy.java b/src/Java/binnie/core/proxy/IBinnieModProxy.java
deleted file mode 100644
index aa9dd11e62..0000000000
--- a/src/Java/binnie/core/proxy/IBinnieModProxy.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package binnie.core.proxy;
-
-import binnie.core.gui.IBinnieGUID;
-import binnie.core.network.packet.MessageBase;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.util.IIcon;
-
-abstract interface IBinnieModProxy
- extends IProxyCore
-{
- public abstract void openGui(IBinnieGUID paramIBinnieGUID, EntityPlayer paramEntityPlayer, int paramInt1, int paramInt2, int paramInt3);
-
- public abstract void sendToAll(MessageBase paramMessageBase);
-
- public abstract void sendToPlayer(MessageBase paramMessageBase, EntityPlayer paramEntityPlayer);
-
- public abstract void sendToServer(MessageBase paramMessageBase);
-
- public abstract IIcon getIcon(IIconRegister paramIIconRegister, String paramString);
-}
diff --git a/src/Java/binnie/core/proxy/IBinnieProxy.java b/src/Java/binnie/core/proxy/IBinnieProxy.java
deleted file mode 100644
index 4ce037aa3d..0000000000
--- a/src/Java/binnie/core/proxy/IBinnieProxy.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package binnie.core.proxy;
-
-import binnie.core.AbstractMod;
-import binnie.core.resource.BinnieResource;
-import java.io.File;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.world.World;
-import net.minecraftforge.client.IItemRenderer;
-
-public abstract interface IBinnieProxy
- extends IProxyCore
-{
- public abstract boolean isClient();
-
- public abstract boolean isServer();
-
- public abstract File getDirectory();
-
- public abstract void bindTexture(BinnieResource paramBinnieResource);
-
- public abstract void bindTexture(ResourceLocation paramResourceLocation);
-
- public abstract int getUniqueRenderID();
-
- public abstract void registerCustomItemRenderer(Item paramItem, IItemRenderer paramIItemRenderer);
-
- public abstract void openGui(AbstractMod paramAbstractMod, int paramInt1, EntityPlayer paramEntityPlayer, int paramInt2, int paramInt3, int paramInt4);
-
- public abstract boolean isSimulating(World paramWorld);
-
- public abstract World getWorld();
-
- public abstract Minecraft getMinecraftInstance();
-
- public abstract boolean needsTagCompoundSynched(Item paramItem);
-
- public abstract Object createObject(String paramString);
-
- public abstract void registerTileEntity(Class<? extends TileEntity> paramClass, String paramString, Object paramObject);
-
- public abstract void createPipe(Item paramItem);
-
- public abstract boolean isDebug();
-
- public abstract void registerBlockRenderer(Object paramObject);
-
- public abstract IIcon getIcon(IIconRegister paramIIconRegister, String paramString1, String paramString2);
-}
diff --git a/src/Java/binnie/core/proxy/IProxyCore.java b/src/Java/binnie/core/proxy/IProxyCore.java
deleted file mode 100644
index 4a0d5c231b..0000000000
--- a/src/Java/binnie/core/proxy/IProxyCore.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package binnie.core.proxy;
-
-import binnie.core.IInitializable;
-
-public abstract interface IProxyCore
- extends IInitializable
-{}
diff --git a/src/Java/binnie/core/resource/BinnieIcon.java b/src/Java/binnie/core/resource/BinnieIcon.java
deleted file mode 100644
index cf7f44a018..0000000000
--- a/src/Java/binnie/core/resource/BinnieIcon.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package binnie.core.resource;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.proxy.BinnieProxy;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.util.IIcon;
-
-public class BinnieIcon
- extends BinnieResource
-{
- public BinnieIcon(AbstractMod mod, ResourceType type, String path)
- {
- super(mod, type, path);
- this.textureSheet = (type == ResourceType.Block ? 0 : 1);
- Binnie.Resource.registerIcon(this);
- }
-
- private int textureSheet = 0;
- private IIcon icon = null;
-
- public IIcon getIcon()
- {
- return this.icon;
- }
-
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(IIconRegister register)
- {
- registerIcon(register);
- return this.icon;
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcon(IIconRegister register)
- {
- this.icon = BinnieCore.proxy.getIcon(register, this.mod, this.path);
- }
-
- public int getTextureSheet()
- {
- return this.textureSheet;
- }
-}
diff --git a/src/Java/binnie/core/resource/BinnieResource.java b/src/Java/binnie/core/resource/BinnieResource.java
deleted file mode 100644
index d9c3d54a0a..0000000000
--- a/src/Java/binnie/core/resource/BinnieResource.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package binnie.core.resource;
-
-import binnie.core.AbstractMod;
-import net.minecraft.util.ResourceLocation;
-
-public class BinnieResource
-{
- String mod;
- private ResourceType type;
- String path;
-
- public BinnieResource(AbstractMod mod, ResourceType type, String path)
- {
- this(mod.getModID(), type, path);
- }
-
- public BinnieResource(String modid, ResourceType type, String path)
- {
- this.mod = modid;
- this.type = type;
- this.path = path;
- }
-
- public String getFullPath()
- {
- return "/assets/" + this.mod + "/textures/" + this.type.toString() + "/" + this.path;
- }
-
- public ResourceLocation getResourceLocation()
- {
- return new ResourceLocation(this.mod, "textures/" + this.type.toString() + "/" + this.path);
- }
-
- public String getShortPath()
- {
- return "textures/" + this.type.toString() + "/" + this.path;
- }
-}
diff --git a/src/Java/binnie/core/resource/IBinnieTexture.java b/src/Java/binnie/core/resource/IBinnieTexture.java
deleted file mode 100644
index 8db06e2c6a..0000000000
--- a/src/Java/binnie/core/resource/IBinnieTexture.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package binnie.core.resource;
-
-public abstract interface IBinnieTexture
-{
- public abstract BinnieResource getTexture();
-}
diff --git a/src/Java/binnie/core/resource/ManagerResource.java b/src/Java/binnie/core/resource/ManagerResource.java
deleted file mode 100644
index 31a5116931..0000000000
--- a/src/Java/binnie/core/resource/ManagerResource.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package binnie.core.resource;
-
-import binnie.core.AbstractMod;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.client.renderer.texture.IIconRegister;
-
-public class ManagerResource
-{
- public BinnieResource getPNG(AbstractMod mod, ResourceType type, String path)
- {
- return getFile(mod, type, path + ".png");
- }
-
- public BinnieResource getFile(AbstractMod mod, ResourceType type, String path)
- {
- return new BinnieResource(mod, type, path);
- }
-
- private List<BinnieIcon> icons = new ArrayList();
-
- public void registerIcon(BinnieIcon binnieIcon)
- {
- this.icons.add(binnieIcon);
- }
-
- public BinnieIcon getItemIcon(AbstractMod mod, String iconFile)
- {
- return new BinnieIcon(mod, ResourceType.Item, iconFile);
- }
-
- public BinnieIcon getBlockIcon(AbstractMod mod, String iconFile)
- {
- return new BinnieIcon(mod, ResourceType.Block, iconFile);
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister register, int type)
- {
- for (BinnieIcon icon : this.icons) {
- if (icon.getTextureSheet() == type) {
- icon.registerIcon(register);
- }
- }
- }
-}
diff --git a/src/Java/binnie/core/resource/ResourceType.java b/src/Java/binnie/core/resource/ResourceType.java
deleted file mode 100644
index e9705ce252..0000000000
--- a/src/Java/binnie/core/resource/ResourceType.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package binnie.core.resource;
-
-public enum ResourceType
-{
- Item("items"), Block("blocks"), Tile("tile"), GUI("gui"), FX("fx"), Entity("entities");
-
- String name;
-
- private ResourceType(String name)
- {
- this.name = name;
- }
-
- public String toString()
- {
- return this.name;
- }
-}
diff --git a/src/Java/binnie/core/texture/BinnieCoreTexture.java b/src/Java/binnie/core/texture/BinnieCoreTexture.java
deleted file mode 100644
index 6e8cd9abee..0000000000
--- a/src/Java/binnie/core/texture/BinnieCoreTexture.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package binnie.core.texture;
-
-import binnie.Binnie;
-import binnie.core.BinnieCore;
-import binnie.core.resource.BinnieResource;
-import binnie.core.resource.IBinnieTexture;
-import binnie.core.resource.ManagerResource;
-import binnie.core.resource.ResourceType;
-
-public enum BinnieCoreTexture
- implements IBinnieTexture
-{
- Compartment(ResourceType.Tile, "Compartment"), CompartmentIron(ResourceType.Tile, "CompartmentIron"), CompartmentDiamond(ResourceType.Tile, "CompartmentDiamond"), CompartmentCopper(ResourceType.Tile, "CompartmentCopper"), CompartmentGold(ResourceType.Tile, "CompartmentGold"), CompartmentBronze(ResourceType.Tile, "CompartmentBronze"), GUIBreeding(ResourceType.GUI, "breeding"), GUIAnalyst(ResourceType.GUI, "guianalyst");
-
- String texture;
- ResourceType type;
-
- private BinnieCoreTexture(ResourceType base, String texture)
- {
- this.texture = texture;
- this.type = base;
- }
-
- public BinnieResource getTexture()
- {
- return Binnie.Resource.getPNG(BinnieCore.instance, this.type, this.texture);
- }
-}
diff --git a/src/Java/binnie/core/texture/TextureManager.java b/src/Java/binnie/core/texture/TextureManager.java
deleted file mode 100644
index fceb0539a2..0000000000
--- a/src/Java/binnie/core/texture/TextureManager.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package binnie.core.texture;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.ArrayList;
-import java.util.List;
-import javax.swing.Icon;
-
-@SideOnly(Side.CLIENT)
-public class TextureManager
-{
- static List<Icon> textures = new ArrayList();
-
- public static void init() {}
-}
diff --git a/src/Java/binnie/core/triggers/ActionProvider.java b/src/Java/binnie/core/triggers/ActionProvider.java
deleted file mode 100644
index 1fa519dc6c..0000000000
--- a/src/Java/binnie/core/triggers/ActionProvider.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package binnie.core.triggers;
-
-import binnie.core.machines.component.IBuildcraft.ActionProvider;
-import buildcraft.api.statements.IActionExternal;
-import buildcraft.api.statements.IActionInternal;
-import buildcraft.api.statements.IActionProvider;
-import buildcraft.api.statements.IStatementContainer;
-import cpw.mods.fml.common.Optional.Method;
-import java.util.Collection;
-import java.util.LinkedList;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.ForgeDirection;
-
-class ActionProvider
- implements IActionProvider
-{
- @Optional.Method(modid="BuildCraft|Silicon")
- public Collection<IActionInternal> getInternalActions(IStatementContainer container)
- {
- return null;
- }
-
- @Optional.Method(modid="BuildCraft|Silicon")
- public Collection<IActionExternal> getExternalActions(ForgeDirection side, TileEntity tile)
- {
- LinkedList<IActionExternal> list = new LinkedList();
- if ((tile instanceof IBuildcraft.ActionProvider)) {
- ((IBuildcraft.ActionProvider)tile).getActions(list);
- }
- LinkedList<IActionExternal> list2 = new LinkedList();
- for (IActionExternal action : list2) {
- if ((action != null) && (action.getUniqueTag() != null)) {
- list.add(action);
- }
- }
- return list2;
- }
-}
diff --git a/src/Java/binnie/core/triggers/BinnieAction.java b/src/Java/binnie/core/triggers/BinnieAction.java
deleted file mode 100644
index f9c0d24e78..0000000000
--- a/src/Java/binnie/core/triggers/BinnieAction.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package binnie.core.triggers;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.resource.BinnieIcon;
-import binnie.core.resource.ManagerResource;
-import buildcraft.api.statements.IActionExternal;
-import buildcraft.api.statements.IStatement;
-import buildcraft.api.statements.IStatementContainer;
-import buildcraft.api.statements.IStatementParameter;
-import buildcraft.api.statements.StatementManager;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraftforge.common.util.ForgeDirection;
-
-class BinnieAction
- implements IActionExternal
-{
- private static int incrementalID = 800;
- public static BinnieAction actionPauseProcess;
- public static BinnieAction actionCancelTask;
- private String desc;
- private BinnieIcon icon;
- private String tag;
- private int id = 0;
-
- BinnieAction(String desc, String tag, String iconFile)
- {
- this(desc, tag, BinnieCore.instance, iconFile);
- }
-
- private BinnieAction(String desc, String tag, AbstractMod mod, String iconFile)
- {
- this.id = (incrementalID++);
- this.tag = tag;
- StatementManager.registerStatement(this);
- this.icon = Binnie.Resource.getItemIcon(mod, iconFile);
- this.desc = desc;
- }
-
- public String getDescription()
- {
- return this.desc;
- }
-
- public String getUniqueTag()
- {
- return this.tag;
- }
-
- @SideOnly(Side.CLIENT)
- public IIcon getIcon()
- {
- return this.icon.getIcon();
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister iconRegister)
- {
- this.icon.registerIcon(iconRegister);
- }
-
- public int maxParameters()
- {
- return 0;
- }
-
- public int minParameters()
- {
- return 0;
- }
-
- public IStatementParameter createParameter(int index)
- {
- return null;
- }
-
- public IStatement rotateLeft()
- {
- return this;
- }
-
- public void actionActivate(TileEntity target, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) {}
-}
diff --git a/src/Java/binnie/core/triggers/BinnieTrigger.java b/src/Java/binnie/core/triggers/BinnieTrigger.java
deleted file mode 100644
index e5cac34dea..0000000000
--- a/src/Java/binnie/core/triggers/BinnieTrigger.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package binnie.core.triggers;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.resource.BinnieIcon;
-import binnie.core.resource.ManagerResource;
-import buildcraft.api.statements.IStatement;
-import buildcraft.api.statements.IStatementContainer;
-import buildcraft.api.statements.IStatementParameter;
-import buildcraft.api.statements.ITriggerExternal;
-import buildcraft.api.statements.StatementManager;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.List;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraftforge.common.util.ForgeDirection;
-
-final class BinnieTrigger
- implements ITriggerExternal
-{
- private static int incrementalID = 800;
- protected static BinnieTrigger triggerNoBlankTemplate;
- protected static BinnieTrigger triggerNoTemplate;
- protected static BinnieTrigger triggerIsWorking;
- protected static BinnieTrigger triggerIsNotWorking;
- protected static BinnieTrigger triggerCanWork;
- protected static BinnieTrigger triggerCannotWork;
- protected static BinnieTrigger triggerPowerNone;
- protected static BinnieTrigger triggerPowerLow;
- protected static BinnieTrigger triggerPowerMedium;
- protected static BinnieTrigger triggerPowerHigh;
- protected static BinnieTrigger triggerPowerFull;
- protected static BinnieTrigger triggerSerumFull;
- protected static BinnieTrigger triggerSerumPure;
- protected static BinnieTrigger triggerSerumEmpty;
- protected static BinnieTrigger triggerAcclimatiserNone;
- protected static BinnieTrigger triggerAcclimatiserHot;
- protected static BinnieTrigger triggerAcclimatiserCold;
- protected static BinnieTrigger triggerAcclimatiserWet;
- protected static BinnieTrigger triggerAcclimatiserDry;
- private String desc;
- private String tag;
- private BinnieIcon icon;
- private int id = 0;
-
- public BinnieTrigger(String desc, String tag, String iconFile)
- {
- this(desc, tag, BinnieCore.instance, iconFile);
- }
-
- public BinnieTrigger(String desc, String tag, AbstractMod mod, String iconFile)
- {
- this.id = (incrementalID++);
- this.tag = tag;
- StatementManager.registerStatement(this);
- TriggerProvider.triggers.add(this);
- this.icon = Binnie.Resource.getItemIcon(mod, iconFile);
- this.desc = desc;
- }
-
- public String getDescription()
- {
- return this.desc;
- }
-
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(IIconRegister register)
- {
- return this.icon.getIcon(register);
- }
-
- public String getUniqueTag()
- {
- return this.tag;
- }
-
- @SideOnly(Side.CLIENT)
- public IIcon getIcon()
- {
- return this.icon.getIcon();
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister iconRegister)
- {
- this.icon.registerIcon(iconRegister);
- }
-
- public int maxParameters()
- {
- return 0;
- }
-
- public int minParameters()
- {
- return 0;
- }
-
- public IStatementParameter createParameter(int index)
- {
- return null;
- }
-
- public IStatement rotateLeft()
- {
- return null;
- }
-
- public boolean isTriggerActive(TileEntity target, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters)
- {
- return false;
- }
-}
diff --git a/src/Java/binnie/core/triggers/ModuleTrigger.java b/src/Java/binnie/core/triggers/ModuleTrigger.java
deleted file mode 100644
index 1d39e816cb..0000000000
--- a/src/Java/binnie/core/triggers/ModuleTrigger.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package binnie.core.triggers;
-
-import binnie.core.IInitializable;
-import binnie.extrabees.ExtraBees;
-import buildcraft.api.statements.StatementManager;
-
-public class ModuleTrigger
- implements IInitializable
-{
- public void preInit() {}
-
- public void init()
- {
- BinnieAction.actionPauseProcess = new BinnieAction("Pause Process", "binnie.action.pauseProcess", "actions/PauseProcess");
- BinnieAction.actionCancelTask = new BinnieAction("Cancel Task", "binnie.action.cancelTask", "actions/CancelTask");
-
- StatementManager.registerActionProvider(new ActionProvider());
-
- BinnieTrigger.triggerNoBlankTemplate = new BinnieTrigger("No Blank Template", "binnie.trigger.noBlankTemplate", ExtraBees.instance, "triggers/NoBlankTemplate");
-
-
- BinnieTrigger.triggerNoTemplate = new BinnieTrigger("No Template", "binnie.trigger.noTemplate", ExtraBees.instance, "triggers/NoTemplate");
-
-
- BinnieTrigger.triggerIsWorking = new BinnieTrigger("Is Working", "binnie.trigger.isWorking", "triggers/IsWorking");
- BinnieTrigger.triggerIsNotWorking = new BinnieTrigger("Is Not Working", "binnie.trigger.isNotWorking", "triggers/IsNotWorking");
- BinnieTrigger.triggerCanWork = new BinnieTrigger("Can Work", "binnie.trigger.canWork", "triggers/CanWork");
- BinnieTrigger.triggerCannotWork = new BinnieTrigger("Cannot Work", "binnie.trigger.cannotWork", "triggers/CannotWork");
-
- BinnieTrigger.triggerPowerNone = new BinnieTrigger("Power None", "binnie.trigger.powerNone", "triggers/PowerNone");
- BinnieTrigger.triggerPowerLow = new BinnieTrigger("Power Low", "binnie.trigger.powerLow", "triggers/PowerLow");
- BinnieTrigger.triggerPowerMedium = new BinnieTrigger("Power Medium", "binnie.trigger.powerMedium", "triggers/PowerMedium");
- BinnieTrigger.triggerPowerHigh = new BinnieTrigger("Power High", "binnie.trigger.powerHigh", "triggers/PowerHigh");
- BinnieTrigger.triggerPowerFull = new BinnieTrigger("Power Full", "binnie.trigger.powerFull", "triggers/PowerFull");
-
-
- BinnieTrigger.triggerSerumFull = new BinnieTrigger("Serum Full", "binnie.trigger.serumFull", ExtraBees.instance, "triggers/SerumFull");
- BinnieTrigger.triggerSerumPure = new BinnieTrigger("Serum Pure", "binnie.trigger.serumPure", ExtraBees.instance, "triggers/SerumPure");
- BinnieTrigger.triggerSerumEmpty = new BinnieTrigger("Serum Pure", "binnie.trigger.serumEmpty", ExtraBees.instance, "triggers/SerumEmpty");
-
- StatementManager.registerTriggerProvider(new TriggerProvider());
- }
-
- public void postInit() {}
-}
diff --git a/src/Java/binnie/core/triggers/TriggerData.java b/src/Java/binnie/core/triggers/TriggerData.java
deleted file mode 100644
index 8784e4278a..0000000000
--- a/src/Java/binnie/core/triggers/TriggerData.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package binnie.core.triggers;
-
-import buildcraft.api.statements.ITriggerExternal;
-import java.util.Map.Entry;
-
-public class TriggerData
- implements Map.Entry<ITriggerExternal, Boolean>
-{
- private final ITriggerExternal key;
- private Boolean value;
-
- public TriggerData(ITriggerExternal key, Boolean value)
- {
- if (key == null) {
- throw new NullPointerException();
- }
- this.key = key;
- this.value = value;
- }
-
- public ITriggerExternal getKey()
- {
- return this.key;
- }
-
- public Boolean getValue()
- {
- return this.value;
- }
-
- public Boolean setValue(Boolean value)
- {
- Boolean old = this.value;
- this.value = value;
- return old;
- }
-}
diff --git a/src/Java/binnie/core/triggers/TriggerInventory.java b/src/Java/binnie/core/triggers/TriggerInventory.java
deleted file mode 100644
index 2892f12c7e..0000000000
--- a/src/Java/binnie/core/triggers/TriggerInventory.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package binnie.core.triggers;
-
-import net.minecraft.inventory.IInventory;
-
-public class TriggerInventory
-{
- private static Boolean isSlotEmpty(IInventory inventory, int slot)
- {
- return Boolean.valueOf(inventory.getStackInSlot(slot) != null);
- }
-}
diff --git a/src/Java/binnie/core/triggers/TriggerPower.java b/src/Java/binnie/core/triggers/TriggerPower.java
deleted file mode 100644
index 69c02decd9..0000000000
--- a/src/Java/binnie/core/triggers/TriggerPower.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package binnie.core.triggers;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.power.IPoweredMachine;
-import binnie.core.machines.power.PowerInterface;
-
-public class TriggerPower
-{
- public static TriggerData powerNone(Object tile)
- {
- return new TriggerData(BinnieTrigger.triggerPowerNone, Boolean.valueOf(getPercentage(tile) < 0.0500000007450581D));
- }
-
- public static TriggerData powerLow(Object tile)
- {
- return new TriggerData(BinnieTrigger.triggerPowerLow, Boolean.valueOf(getPercentage(tile) < 0.3499999940395355D));
- }
-
- public static TriggerData powerMedium(Object tile)
- {
- double p = getPercentage(tile);
- return new TriggerData(BinnieTrigger.triggerPowerMedium, Boolean.valueOf((p >= 0.3499999940395355D) && (p <= 0.6499999761581421D)));
- }
-
- public static TriggerData powerHigh(Object tile)
- {
- double p = getPercentage(tile);
- return new TriggerData(BinnieTrigger.triggerPowerHigh, Boolean.valueOf(getPercentage(tile) > 0.6499999761581421D));
- }
-
- public static TriggerData powerFull(Object tile)
- {
- double p = getPercentage(tile);
- return new TriggerData(BinnieTrigger.triggerPowerFull, Boolean.valueOf(getPercentage(tile) > 0.949999988079071D));
- }
-
- private static double getPercentage(Object tile)
- {
- IPoweredMachine process = (IPoweredMachine)Machine.getInterface(IPoweredMachine.class, tile);
- if (process != null)
- {
- double percentage = process.getInterface().getEnergy() / process.getInterface().getCapacity();
-
- return percentage;
- }
- return 0.0D;
- }
-}
diff --git a/src/Java/binnie/core/triggers/TriggerProvider.java b/src/Java/binnie/core/triggers/TriggerProvider.java
deleted file mode 100644
index fc6da191e8..0000000000
--- a/src/Java/binnie/core/triggers/TriggerProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package binnie.core.triggers;
-
-import binnie.core.machines.component.IBuildcraft.TriggerProvider;
-import buildcraft.api.statements.IStatementContainer;
-import buildcraft.api.statements.ITriggerExternal;
-import buildcraft.api.statements.ITriggerInternal;
-import buildcraft.api.statements.ITriggerProvider;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.ForgeDirection;
-
-class TriggerProvider
- implements ITriggerProvider
-{
- static TriggerProvider instance = new TriggerProvider();
- public static List<BinnieTrigger> triggers = new ArrayList();
-
- public Collection<ITriggerExternal> getExternalTriggers(ForgeDirection side, TileEntity tile)
- {
- LinkedList<TriggerData> list = new LinkedList();
-
- LinkedList<ITriggerExternal> triggerData = new LinkedList();
- if ((tile instanceof IBuildcraft.TriggerProvider)) {
- ((IBuildcraft.TriggerProvider)tile).getTriggers(list);
- }
- for (TriggerData data : list) {
- if ((data.getKey() != null) && (data.getKey().getUniqueTag() != null)) {
- triggerData.add(data.getKey());
- }
- }
- return triggerData;
- }
-
- public static boolean isTriggerActive(ITriggerExternal trigger, TileEntity tile)
- {
- LinkedList<TriggerData> list = new LinkedList();
-
- LinkedList<ITriggerExternal> triggerData = new LinkedList();
- if ((tile instanceof IBuildcraft.TriggerProvider)) {
- ((IBuildcraft.TriggerProvider)tile).getTriggers(list);
- }
- for (TriggerData data : list) {
- if (data.getKey() == trigger) {
- return data.getValue().booleanValue();
- }
- }
- return false;
- }
-
- public Collection<ITriggerInternal> getInternalTriggers(IStatementContainer container)
- {
- return new ArrayList();
- }
-}
diff --git a/src/Java/binnie/core/triggers/TriggerWorking.java b/src/Java/binnie/core/triggers/TriggerWorking.java
deleted file mode 100644
index 06feee0f86..0000000000
--- a/src/Java/binnie/core/triggers/TriggerWorking.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package binnie.core.triggers;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.power.IProcess;
-
-public class TriggerWorking
-{
- public static TriggerData isNotWorking(Object inventory)
- {
- IProcess process = (IProcess)Machine.getInterface(IProcess.class, inventory);
- boolean b = false;
- if (process != null) {
- b = (process.canWork() != null) && (process.canProgress() != null);
- }
- return new TriggerData(BinnieTrigger.triggerIsNotWorking, Boolean.valueOf(b));
- }
-
- public static TriggerData isWorking(Object inventory)
- {
- IProcess process = (IProcess)Machine.getInterface(IProcess.class, inventory);
- boolean b = false;
- if (process != null) {
- b = (process.canWork() == null) && (process.canProgress() == null);
- }
- return new TriggerData(BinnieTrigger.triggerIsWorking, Boolean.valueOf(b));
- }
-
- public static TriggerData canWork(Object inventory)
- {
- IProcess process = (IProcess)Machine.getInterface(IProcess.class, inventory);
- boolean b = false;
- if (process != null) {
- b = process.canWork() == null;
- }
- return new TriggerData(BinnieTrigger.triggerCanWork, Boolean.valueOf(b));
- }
-
- public static TriggerData cannotWork(Object inventory)
- {
- IProcess process = (IProcess)Machine.getInterface(IProcess.class, inventory);
- boolean b = false;
- if (process != null) {
- b = process.canWork() != null;
- }
- return new TriggerData(BinnieTrigger.triggerCannotWork, Boolean.valueOf(b));
- }
-}
diff --git a/src/Java/binnie/core/util/FluidStackSet.java b/src/Java/binnie/core/util/FluidStackSet.java
deleted file mode 100644
index 1283435293..0000000000
--- a/src/Java/binnie/core/util/FluidStackSet.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package binnie.core.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import net.minecraftforge.fluids.FluidStack;
-
-class FluidStackSet
- implements Set<FluidStack>
-{
- public String toString()
- {
- return this.itemStacks.toString();
- }
-
- List<FluidStack> itemStacks = new ArrayList();
-
- protected FluidStack getExisting(FluidStack stack)
- {
- for (FluidStack stack2 : this.itemStacks) {
- if (stack2.isFluidEqual(stack)) {
- return stack2;
- }
- }
- return null;
- }
-
- public boolean add(FluidStack e)
- {
- if (e != null)
- {
- if (getExisting(e) == null) {
- return this.itemStacks.add(e.copy());
- }
- getExisting(e).amount += e.amount;
- }
- return false;
- }
-
- public boolean addAll(Collection<? extends FluidStack> c)
- {
- boolean addedAll = true;
- for (FluidStack stack : c) {
- addedAll = (add(stack)) && (addedAll);
- }
- return addedAll;
- }
-
- public void clear()
- {
- this.itemStacks.clear();
- }
-
- public boolean contains(Object o)
- {
- if (!(o instanceof FluidStack)) {
- return false;
- }
- return getExisting((FluidStack)o) != null;
- }
-
- public boolean containsAll(Collection<?> c)
- {
- boolean addedAll = true;
- for (Object o : c) {
- addedAll = (addedAll) && (contains(o));
- }
- return false;
- }
-
- public boolean isEmpty()
- {
- return this.itemStacks.isEmpty();
- }
-
- public Iterator<FluidStack> iterator()
- {
- return this.itemStacks.iterator();
- }
-
- public boolean remove(Object o)
- {
- if (contains(o))
- {
- FluidStack r = (FluidStack)o;
- FluidStack existing = getExisting(r);
- if (existing.amount > r.amount) {
- existing.amount -= r.amount;
- } else {
- this.itemStacks.remove(existing);
- }
- }
- return false;
- }
-
- public boolean removeAll(Collection<?> c)
- {
- boolean addedAll = true;
- for (Object o : c)
- {
- boolean removed = remove(o);
- addedAll = (removed) && (addedAll);
- }
- return false;
- }
-
- public boolean retainAll(Collection<?> c)
- {
- return this.itemStacks.retainAll(c);
- }
-
- public int size()
- {
- return this.itemStacks.size();
- }
-
- public Object[] toArray()
- {
- return this.itemStacks.toArray();
- }
-
- public <T> T[] toArray(T[] a)
- {
- return this.itemStacks.toArray(a);
- }
-}
diff --git a/src/Java/binnie/core/util/IValidator.java b/src/Java/binnie/core/util/IValidator.java
deleted file mode 100644
index c6b39dc153..0000000000
--- a/src/Java/binnie/core/util/IValidator.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package binnie.core.util;
-
-public abstract interface IValidator<T>
-{
- public abstract boolean isValid(T paramT);
-}
diff --git a/src/Java/binnie/core/util/ItemStackSet.java b/src/Java/binnie/core/util/ItemStackSet.java
deleted file mode 100644
index a154f7edfc..0000000000
--- a/src/Java/binnie/core/util/ItemStackSet.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package binnie.core.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import net.minecraft.item.ItemStack;
-
-public class ItemStackSet
- implements Set<ItemStack>
-{
- public String toString()
- {
- return this.itemStacks.toString();
- }
-
- List<ItemStack> itemStacks = new ArrayList();
-
- protected ItemStack getExisting(ItemStack stack)
- {
- for (ItemStack stack2 : this.itemStacks) {
- if (stack2.isItemEqual(stack)) {
- return stack2;
- }
- }
- return null;
- }
-
- public boolean add(ItemStack e)
- {
- if (e != null)
- {
- if (getExisting(e) == null) {
- return this.itemStacks.add(e.copy());
- }
- getExisting(e).stackSize += e.stackSize;
- }
- return false;
- }
-
- public boolean addAll(Collection<? extends ItemStack> c)
- {
- boolean addedAll = true;
- for (ItemStack stack : c) {
- addedAll = (add(stack)) && (addedAll);
- }
- return addedAll;
- }
-
- public void clear()
- {
- this.itemStacks.clear();
- }
-
- public boolean contains(Object o)
- {
- if (!(o instanceof ItemStack)) {
- return false;
- }
- return getExisting((ItemStack)o) != null;
- }
-
- public boolean containsAll(Collection<?> c)
- {
- boolean addedAll = true;
- for (Object o : c) {
- addedAll = (addedAll) && (contains(o));
- }
- return false;
- }
-
- public boolean isEmpty()
- {
- return this.itemStacks.isEmpty();
- }
-
- public Iterator<ItemStack> iterator()
- {
- return this.itemStacks.iterator();
- }
-
- public boolean remove(Object o)
- {
- if (contains(o))
- {
- ItemStack r = (ItemStack)o;
- ItemStack existing = getExisting(r);
- if (existing.stackSize > r.stackSize) {
- existing.stackSize -= r.stackSize;
- } else {
- this.itemStacks.remove(existing);
- }
- }
- return false;
- }
-
- public boolean removeAll(Collection<?> c)
- {
- boolean addedAll = true;
- for (Object o : c)
- {
- boolean removed = remove(o);
- addedAll = (removed) && (addedAll);
- }
- return false;
- }
-
- public boolean retainAll(Collection<?> c)
- {
- return this.itemStacks.retainAll(c);
- }
-
- public int size()
- {
- return this.itemStacks.size();
- }
-
- public Object[] toArray()
- {
- return this.itemStacks.toArray();
- }
-
- public <T> T[] toArray(T[] a)
- {
- return this.itemStacks.toArray(a);
- }
-}
diff --git a/src/Java/binnie/core/util/UniqueFluidStackSet.java b/src/Java/binnie/core/util/UniqueFluidStackSet.java
deleted file mode 100644
index 49a7dbab35..0000000000
--- a/src/Java/binnie/core/util/UniqueFluidStackSet.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package binnie.core.util;
-
-import java.util.List;
-import net.minecraftforge.fluids.FluidStack;
-
-public class UniqueFluidStackSet
- extends FluidStackSet
-{
- public boolean add(FluidStack e)
- {
- if ((e != null) &&
- (getExisting(e) == null)) {
- return this.itemStacks.add(e.copy());
- }
- return false;
- }
-
- public boolean remove(Object o)
- {
- if (contains(o))
- {
- FluidStack r = (FluidStack)o;
- FluidStack existing = getExisting(r);
- this.itemStacks.remove(existing);
- }
- return false;
- }
-}
diff --git a/src/Java/binnie/core/util/UniqueItemStackSet.java b/src/Java/binnie/core/util/UniqueItemStackSet.java
deleted file mode 100644
index f9571e8fee..0000000000
--- a/src/Java/binnie/core/util/UniqueItemStackSet.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package binnie.core.util;
-
-import java.util.List;
-import net.minecraft.item.ItemStack;
-
-public class UniqueItemStackSet
- extends ItemStackSet
-{
- public boolean add(ItemStack e)
- {
- if ((e != null) &&
- (getExisting(e) == null)) {
- return this.itemStacks.add(e.copy());
- }
- return false;
- }
-
- public boolean remove(Object o)
- {
- if (contains(o))
- {
- ItemStack r = (ItemStack)o;
- ItemStack existing = getExisting(r);
- this.itemStacks.remove(existing);
- }
- return false;
- }
-}
diff --git a/src/Java/binnie/craftgui/binniecore/WindowFieldKit.java b/src/Java/binnie/craftgui/binniecore/WindowFieldKit.java
deleted file mode 100644
index d52a6cde31..0000000000
--- a/src/Java/binnie/craftgui/binniecore/WindowFieldKit.java
+++ /dev/null
@@ -1,334 +0,0 @@
-package binnie.craftgui.binniecore;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.genetics.BreedingSystem;
-import binnie.core.genetics.ManagerGenetics;
-import binnie.core.language.ManagerLanguage;
-import binnie.core.machines.inventory.SlotValidator;
-import binnie.core.machines.inventory.ValidatorIcon;
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.TextJustification;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventValueChanged;
-import binnie.craftgui.events.EventValueChanged.Handler;
-import binnie.craftgui.minecraft.InventoryType;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.WindowInventory;
-import binnie.craftgui.minecraft.control.ControlImage;
-import binnie.craftgui.minecraft.control.ControlPlayerInventory;
-import binnie.craftgui.minecraft.control.ControlSlot;
-import binnie.craftgui.resource.StyleSheet;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import binnie.craftgui.resource.minecraft.PaddedTexture;
-import binnie.craftgui.resource.minecraft.StandardTexture;
-import binnie.extrabees.core.ExtraBeeTexture;
-import binnie.extrabees.gui.punnett.ExtraBeeGUITexture;
-import binnie.genetics.gui.ControlChromosome;
-import binnie.genetics.machine.Analyser;
-import cpw.mods.fml.relauncher.Side;
-import forestry.api.genetics.AlleleManager;
-import forestry.api.genetics.IAllele;
-import forestry.api.genetics.IAlleleRegistry;
-import forestry.api.genetics.IChromosomeType;
-import forestry.api.genetics.IGenome;
-import forestry.api.genetics.IIndividual;
-import forestry.api.genetics.ISpeciesRoot;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.init.Items;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class WindowFieldKit
- extends Window
-{
- public WindowFieldKit(EntityPlayer player, IInventory inventory, Side side)
- {
- super(280.0F, 230.0F, player, inventory, side);
- }
-
- protected AbstractMod getMod()
- {
- return BinnieCore.instance;
- }
-
- protected String getName()
- {
- return "Field Kit";
- }
-
- private void setupValidators()
- {
- getWindowInventory().setValidator(0, new SlotValidator(null)
- {
- public boolean isValid(ItemStack object)
- {
- return (AlleleManager.alleleRegistry.isIndividual(object)) || (Binnie.Genetics.getConversion(object) != null);
- }
-
- public String getTooltip()
- {
- return "Individual";
- }
- });
- getWindowInventory().setValidator(1, new SlotValidator(null)
- {
- public boolean isValid(ItemStack object)
- {
- return object.getItem() == Items.paper;
- }
-
- public String getTooltip()
- {
- return "Paper";
- }
- });
- getWindowInventory().disableAutoDispense(1);
- }
-
- public void initialiseClient()
- {
- setTitle("Field Kit");
-
- CraftGUI.Render.stylesheet(new StyleSheetPunnett());
-
- getWindowInventory().createSlot(0);
- getWindowInventory().createSlot(1);
-
- setupValidators();
-
- new ControlPlayerInventory(this);
-
- IPoint handGlass = new IPoint(16.0F, 32.0F);
- this.GlassControl = new ControlImage(this, handGlass.x(), handGlass.y(), new StandardTexture(0, 160, 96, 96, ExtraBeeTexture.GUIPunnett));
- new ControlSlot(this, handGlass.x() + 54.0F, handGlass.y() + 26.0F).assign(InventoryType.Window, 0);
-
- new ControlSlot(this, 208.0F, 8.0F).assign(InventoryType.Window, 1);
-
- this.text = new ControlText(this, new IPoint(232.0F, 13.0F), "Paper");
- this.text.setColour(2236962);
-
- this.text = new ControlText(this, new IArea(0.0F, 120.0F, w(), 24.0F), "", TextJustification.MiddleCenter);
- this.text.setColour(2236962);
-
- this.chromo = new ControlChromosome(this, 150.0F, 24.0F);
-
- addEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- IChromosomeType type = (IChromosomeType)event.getValue();
- if ((type != null) && (WindowFieldKit.this.info.containsKey(type)))
- {
- String t = (String)WindowFieldKit.this.info.get(type);
- WindowFieldKit.this.text.setValue(t);
- }
- else
- {
- WindowFieldKit.this.text.setValue("");
- }
- }
- }.setOrigin(EventHandler.Origin.DirectChild, this.chromo));
- }
-
- public void initialiseServer()
- {
- ItemStack kit = getPlayer().getHeldItem();
- int sheets = 64 - kit.getItemDamage();
- if (sheets != 0) {
- getWindowInventory().setInventorySlotContents(1, new ItemStack(Items.paper, sheets));
- }
- setupValidators();
- }
-
- private float glassOffsetX = 0.0F;
- private float glassOffsetY = 0.0F;
- private float glassVX = 0.0F;
- private float glassVY = 0.0F;
- private Random glassRand = new Random();
- private Control GlassControl;
- private ControlChromosome chromo;
- private ControlText text;
- private float analyseProgress = 1.0F;
- private boolean isAnalysing = false;
-
- public void onUpdateClient()
- {
- super.onUpdateClient();
- if (this.isAnalysing)
- {
- this.analyseProgress += 0.01F;
- if (this.analyseProgress >= 1.0F)
- {
- this.isAnalysing = false;
- this.analyseProgress = 1.0F;
- ItemStack stack = getWindowInventory().getStackInSlot(0);
- if (stack != null) {
- sendClientAction("analyse", new NBTTagCompound());
- }
- refreshSpecies();
- }
- }
- this.glassVX += this.glassRand.nextFloat() - 0.5F - this.glassOffsetX * 0.2F;
- this.glassVY += this.glassRand.nextFloat() - 0.5F - this.glassOffsetY * 0.2F;
-
- this.glassOffsetX += this.glassVX;
- this.glassOffsetX *= (1.0F - this.analyseProgress);
- this.glassOffsetY += this.glassVY;
- this.glassOffsetY *= (1.0F - this.analyseProgress);
-
- this.GlassControl.setOffset(new IPoint(this.glassOffsetX, this.glassOffsetY));
- }
-
- private Map<IChromosomeType, String> info = new HashMap();
-
- private void refreshSpecies()
- {
- ItemStack item = getWindowInventory().getStackInSlot(0);
- if ((item == null) || (!AlleleManager.alleleRegistry.isIndividual(item))) {
- return;
- }
- IIndividual ind = AlleleManager.alleleRegistry.getIndividual(item);
- if (ind == null) {
- return;
- }
- ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(item);
- this.chromo.setRoot(root);
- Random rand = new Random();
- this.info.clear();
- for (IChromosomeType type : root.getKaryotype()) {
- if (!Binnie.Genetics.isInvalidChromosome(type))
- {
- IAllele allele = ind.getGenome().getActiveAllele(type);
- List<String> infos = new ArrayList();
- int i = 0;
- String pref = root.getUID() + ".fieldkit." + type.getName().toLowerCase() + ".";
- while (Binnie.Language.canLocalise(pref + i))
- {
- infos.add(Binnie.Language.localise(pref + i));
- i++;
- }
- String text = Binnie.Genetics.getSystem(root).getAlleleName(type, allele);
- if (!infos.isEmpty()) {
- text = (String)infos.get(rand.nextInt(infos.size()));
- }
- this.info.put(type, text);
- this.chromo.setRoot(root);
- }
- }
- }
-
- private ItemStack prev = null;
-
- public void onWindowInventoryChanged()
- {
- super.onWindowInventoryChanged();
- if (isServer())
- {
- ItemStack kit = getPlayer().getHeldItem();
- int sheets = 64 - kit.getItemDamage();
- int size = getWindowInventory().getStackInSlot(1) == null ? 0 : getWindowInventory().getStackInSlot(1).stackSize;
- if (sheets != size) {
- kit.setItemDamage(64 - size);
- }
- ((EntityPlayerMP)getPlayer()).updateHeldItem();
- }
- if (isClient())
- {
- ItemStack item = getWindowInventory().getStackInSlot(0);
- this.prev = item;
- this.text.setValue("");
- if ((item != null) && (!Analyser.isAnalysed(item)))
- {
- if (getWindowInventory().getStackInSlot(1) == null)
- {
- this.text.setValue("No Paper!");
- this.isAnalysing = false;
- this.analyseProgress = 1.0F;
- }
- else
- {
- startAnalysing();
- this.chromo.setRoot(null);
- if (!damageKit()) {}
- }
- }
- else if (item != null)
- {
- this.isAnalysing = false;
- this.analyseProgress = 1.0F;
- refreshSpecies();
- if (!damageKit()) {}
- }
- else
- {
- this.isAnalysing = false;
- this.analyseProgress = 1.0F;
-
- this.chromo.setRoot(null);
- }
- }
- }
-
- private boolean damageKit()
- {
- return false;
- }
-
- private void startAnalysing()
- {
- this.glassVX = 0.0F;
- this.glassVY = 0.0F;
- this.glassOffsetX = 0.0F;
- this.glassOffsetY = 0.0F;
- this.isAnalysing = true;
- this.analyseProgress = 0.0F;
- }
-
- public boolean showHelpButton()
- {
- return true;
- }
-
- public String showInfoButton()
- {
- return "The Field Kit analyses bees, trees, flowers and butterflies. All that is required is a piece of paper to jot notes";
- }
-
- public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound action)
- {
- super.recieveGuiNBT(side, player, name, action);
- if ((side == Side.SERVER) && (name.equals("analyse")))
- {
- getWindowInventory().setInventorySlotContents(0, Analyser.analyse(getWindowInventory().getStackInSlot(0)));
- getWindowInventory().decrStackSize(1, 1);
- }
- }
-
- static class StyleSheetPunnett
- extends StyleSheet
- {
- public StyleSheetPunnett()
- {
- this.textures.put(CraftGUITexture.Window, new PaddedTexture(0, 0, 160, 160, 0, ExtraBeeTexture.GUIPunnett, 32, 32, 32, 32));
- this.textures.put(CraftGUITexture.Slot, new StandardTexture(160, 0, 18, 18, 0, ExtraBeeTexture.GUIPunnett));
- this.textures.put(ExtraBeeGUITexture.Chromosome, new StandardTexture(160, 36, 16, 16, 0, ExtraBeeTexture.GUIPunnett));
- this.textures.put(ExtraBeeGUITexture.Chromosome2, new StandardTexture(160, 52, 16, 16, 0, ExtraBeeTexture.GUIPunnett));
- this.textures.put(CraftGUITexture.HelpButton, new StandardTexture(178, 0, 16, 16, 0, ExtraBeeTexture.GUIPunnett));
- this.textures.put(CraftGUITexture.InfoButton, new StandardTexture(178, 16, 16, 16, 0, ExtraBeeTexture.GUIPunnett));
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/binniecore/WindowGenesis.java b/src/Java/binnie/craftgui/binniecore/WindowGenesis.java
deleted file mode 100644
index 8295645f5a..0000000000
--- a/src/Java/binnie/craftgui/binniecore/WindowGenesis.java
+++ /dev/null
@@ -1,264 +0,0 @@
-package binnie.craftgui.binniecore;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.genetics.BreedingSystem;
-import binnie.core.genetics.Gene;
-import binnie.core.genetics.ManagerGenetics;
-import binnie.craftgui.controls.listbox.ControlList;
-import binnie.craftgui.controls.listbox.ControlListBox;
-import binnie.craftgui.controls.listbox.ControlTextOption;
-import binnie.craftgui.controls.tab.ControlTab;
-import binnie.craftgui.controls.tab.ControlTabBar;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.events.EventValueChanged;
-import binnie.craftgui.events.EventValueChanged.Handler;
-import binnie.craftgui.minecraft.MinecraftGUI.PanelType;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.control.ControlItemDisplay;
-import binnie.craftgui.minecraft.control.ControlPlayerInventory;
-import binnie.craftgui.minecraft.control.ControlTabIcon;
-import binnie.craftgui.window.Panel;
-import binnie.genetics.gui.ControlGenesisOption;
-import cpw.mods.fml.relauncher.Side;
-import forestry.api.genetics.IAllele;
-import forestry.api.genetics.IChromosomeType;
-import forestry.api.genetics.IIndividual;
-import forestry.api.genetics.ISpeciesRoot;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class WindowGenesis
- extends Window
-{
- private ISpeciesRoot root;
- private IAllele[] template;
- private ControlListBox<Gene> geneList;
- private ControlListBox<Gene> geneOptions;
- private Panel panelPickup;
-
- public WindowGenesis(EntityPlayer player, IInventory inventory, Side side)
- {
- super(342.0F, 228.0F, player, inventory, side);
- }
-
- protected AbstractMod getMod()
- {
- return BinnieCore.instance;
- }
-
- protected String getName()
- {
- return "Genesis";
- }
-
- public void initialiseClient()
- {
- new ControlPlayerInventory(this);
- setTitle("Genesis");
-
- ControlTabBar<BreedingSystem> tabSystems = new ControlTabBar(this, 8.0F, 28.0F, 23.0F, 100.0F, Position.Left)
- {
- public ControlTab<BreedingSystem> createTab(float x, float y, float w, float h, BreedingSystem value)
- {
- new ControlTabIcon(this, x, y, w, h, value)
- {
- public ItemStack getItemStack()
- {
- int type = ((BreedingSystem)this.value).getDefaultType();
- IIndividual ind = ((BreedingSystem)this.value).getDefaultIndividual();
- return ((BreedingSystem)this.value).getSpeciesRoot().getMemberStack(ind, type);
- }
-
- public String getName()
- {
- return ((BreedingSystem)this.value).getName();
- }
-
- public int getOutlineColour()
- {
- return ((BreedingSystem)this.value).getColour();
- }
-
- public boolean hasOutline()
- {
- return true;
- }
- };
- }
- };
- tabSystems.setValues(Binnie.Genetics.getActiveSystems());
-
- this.root = ((BreedingSystem)Binnie.Genetics.getActiveSystems().iterator().next()).getSpeciesRoot();
- this.template = this.root.getDefaultTemplate();
-
- IArea one = new IArea(32.0F, 28.0F, 170.0F, 100.0F);
- IArea two = new IArea(214.0F, 28.0F, 100.0F, 100.0F);
-
- new Panel(this, one.outset(1), MinecraftGUI.PanelType.Black);
- new Panel(this, two.outset(1), MinecraftGUI.PanelType.Black);
-
- this.geneList = new ControlListBox(this, one.x(), one.y(), one.w(), one.h(), 10.0F)
- {
- public IWidget createOption(Gene value, int y)
- {
- return new ControlGenesisOption((ControlList)getContent(), value, y);
- }
- };
- this.geneOptions = new ControlListBox(this, two.x(), two.y(), two.w(), two.h(), 10.0F)
- {
- public IWidget createOption(Gene value, int y)
- {
- return new ControlTextOption((ControlList)getContent(), value, y);
- }
- };
- tabSystems.addEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- WindowGenesis.this.root = ((BreedingSystem)event.getValue()).getSpeciesRoot();
- WindowGenesis.this.template = WindowGenesis.this.root.getDefaultTemplate();
- WindowGenesis.this.refreshTemplate(null);
- }
- }.setOrigin(EventHandler.Origin.Self, tabSystems));
-
-
-
- this.geneList.addEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- Map<IChromosomeType, List<IAllele>> map = Binnie.Genetics.getChromosomeMap(WindowGenesis.this.root);
- List<Gene> opts = new ArrayList();
- IChromosomeType chromo = ((Gene)event.value).getChromosome();
- for (IAllele allele : (List)map.get(chromo)) {
- opts.add(new Gene(allele, chromo, WindowGenesis.this.root));
- }
- WindowGenesis.this.geneOptions.setOptions(opts);
- }
- }.setOrigin(EventHandler.Origin.Self, this.geneList));
-
-
-
- this.geneOptions.addEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- if (event.value == null) {
- return;
- }
- IChromosomeType chromo = ((Gene)event.value).getChromosome();
- WindowGenesis.this.template[chromo.ordinal()] = ((Gene)event.value).getAllele();
- if (chromo == ((Gene)event.value).getSpeciesRoot().getKaryotypeKey()) {
- WindowGenesis.this.template = ((Gene)event.value).getSpeciesRoot().getTemplate(((Gene)event.value).getAllele().getUID());
- }
- WindowGenesis.this.refreshTemplate(chromo);
- }
- }.setOrigin(EventHandler.Origin.Self, this.geneOptions));
-
-
-
-
- this.panelPickup = new Panel(this, 16.0F, 140.0F, 60.0F, 42.0F, MinecraftGUI.PanelType.Black);
-
- refreshTemplate(null);
- }
-
- private void refreshTemplate(IChromosomeType selection)
- {
- List<Gene> genes = new ArrayList();
- IChromosomeType[] chromos = (IChromosomeType[])Binnie.Genetics.getChromosomeMap(this.root).keySet().toArray(new IChromosomeType[0]);
- for (IChromosomeType type : chromos)
- {
- IAllele allele = this.template[type.ordinal()];
- if (allele == null) {
- throw new NullPointerException("Allele missing for Chromosome " + type.getName());
- }
- genes.add(new Gene(allele, type, this.root));
- }
- Map<IChromosomeType, List<IAllele>> map = Binnie.Genetics.getChromosomeMap(this.root);
- this.geneList.setOptions(genes);
- if (selection != null) {
- this.geneList.setValue(new Gene(this.template[selection.ordinal()], selection, this.root));
- } else {
- this.geneOptions.setOptions(new ArrayList());
- }
- refreshPickup();
- }
-
- private void refreshPickup()
- {
- this.panelPickup.deleteAllChildren();
- int i = 0;
- for (int type : Binnie.Genetics.getSystem(this.root).getActiveTypes())
- {
- IIndividual ind = this.root.templateAsIndividual(this.template);
- ind.analyze();
- final ItemStack stack = this.root.getMemberStack(ind, type);
- ControlItemDisplay display = new ControlItemDisplay(this.panelPickup, 4 + i % 3 * 18, 4 + i / 3 * 18);
- display.setItemStack(stack);
- display.setTooltip();
- display.addEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- stack.writeToNBT(nbt);
- Window.get(event.getOrigin()).sendClientAction("genesis", nbt);
- }
- }.setOrigin(EventHandler.Origin.Self, display));
-
-
-
- i++;
- }
- }
-
- public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound action)
- {
- super.recieveGuiNBT(side, player, name, action);
- if ((side == Side.SERVER) && (name.equals("genesis")))
- {
- ItemStack stack = ItemStack.loadItemStackFromNBT(action);
- InventoryPlayer playerInv = player.inventory;
- if (stack == null) {
- return;
- }
- if (playerInv.getItemStack() == null)
- {
- playerInv.setItemStack(stack);
- }
- else if ((playerInv.getItemStack().isItemEqual(stack)) && (ItemStack.areItemStackTagsEqual(playerInv.getItemStack(), stack)))
- {
- int fit = stack.getMaxStackSize() - (stack.stackSize + playerInv.getItemStack().stackSize);
- if (fit >= 0)
- {
- ItemStack rec = stack;
- rec.stackSize += playerInv.getItemStack().stackSize;
- playerInv.setItemStack(rec);
- }
- }
- player.openContainer.detectAndSendChanges();
- if ((player instanceof EntityPlayerMP)) {
- ((EntityPlayerMP)player).updateHeldItem();
- }
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/ControlCheckbox.java b/src/Java/binnie/craftgui/controls/ControlCheckbox.java
deleted file mode 100644
index edfeab631c..0000000000
--- a/src/Java/binnie/craftgui/controls/ControlCheckbox.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package binnie.craftgui.controls;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.TextJustification;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.events.EventValueChanged;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public class ControlCheckbox
- extends Control
- implements IControlValue<Boolean>
-{
- boolean value;
- String text;
-
- public ControlCheckbox(IWidget parent, float x, float y, boolean bool)
- {
- this(parent, x, y, 0.0F, "", bool);
- }
-
- public ControlCheckbox(IWidget parent, float x, float y, float w, String text, boolean bool)
- {
- super(parent, x, y, w > 16.0F ? w : 16.0F, 16.0F);
- this.text = text;
- this.value = bool;
- if (w > 16.0F) {
- new ControlText(this, new IArea(16.0F, 1.0F, w - 16.0F, 16.0F), text, TextJustification.MiddleCenter).setColour(4473924);
- }
- addAttribute(Attribute.MouseOver);
- addEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- ControlCheckbox.this.toggleValue();
- }
- }.setOrigin(EventHandler.Origin.Self, this));
- }
-
- protected void onValueChanged(boolean value) {}
-
- public Boolean getValue()
- {
- return Boolean.valueOf(this.value);
- }
-
- public void setValue(Boolean value)
- {
- this.value = value.booleanValue();
- onValueChanged(value.booleanValue());
- callEvent(new EventValueChanged(this, value));
- }
-
- public void toggleValue()
- {
- setValue(Boolean.valueOf(!getValue().booleanValue()));
- }
-
- public void onRenderBackground()
- {
- Object texture = getValue().booleanValue() ? CraftGUITexture.CheckboxChecked : CraftGUITexture.Checkbox;
- if (isMouseOver()) {
- texture = getValue().booleanValue() ? CraftGUITexture.CheckboxCheckedHighlighted : CraftGUITexture.CheckboxHighlighted;
- }
- CraftGUI.Render.texture(texture, IPoint.ZERO);
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/ControlText.java b/src/Java/binnie/craftgui/controls/ControlText.java
deleted file mode 100644
index 4df9c04db1..0000000000
--- a/src/Java/binnie/craftgui/controls/ControlText.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package binnie.craftgui.controls;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.TextJustification;
-import binnie.craftgui.core.renderer.Renderer;
-
-public class ControlText
- extends Control
- implements IControlValue<String>
-{
- private String text;
- private TextJustification align;
-
- public ControlText(IWidget parent, IPoint pos, String text)
- {
- this(parent, new IArea(pos, new IPoint(500.0F, 0.0F)), text, TextJustification.TopLeft);
- }
-
- public ControlText(IWidget parent, String text, TextJustification align)
- {
- this(parent, parent.getArea(), text, align);
- }
-
- public ControlText(IWidget parent, IArea area, String text, TextJustification align)
- {
- super(parent, area.pos().x(), area.pos().y(), area.size().x(), area.size().y());
- setValue(text);
- this.align = align;
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.text(getArea(), this.align, this.text, getColour());
- }
-
- public void setValue(String text)
- {
- this.text = text;
- }
-
- public String getValue()
- {
- return this.text;
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/ControlTextCentered.java b/src/Java/binnie/craftgui/controls/ControlTextCentered.java
deleted file mode 100644
index 12434528db..0000000000
--- a/src/Java/binnie/craftgui/controls/ControlTextCentered.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package binnie.craftgui.controls;
-
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.TextJustification;
-
-public class ControlTextCentered
- extends ControlText
-{
- public ControlTextCentered(IWidget parent, float y, String text)
- {
- super(parent, new IArea(new IPoint(0.0F, y), new IPoint(parent.size().x(), 0.0F)), text, TextJustification.TopCenter);
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/ControlTextEdit.java b/src/Java/binnie/craftgui/controls/ControlTextEdit.java
deleted file mode 100644
index 8c07a12d7c..0000000000
--- a/src/Java/binnie/craftgui/controls/ControlTextEdit.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package binnie.craftgui.controls;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventKey.Down;
-import binnie.craftgui.events.EventKey.Down.Handler;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.events.EventTextEdit;
-import binnie.craftgui.events.EventWidget.GainFocus;
-import binnie.craftgui.events.EventWidget.GainFocus.Handler;
-import binnie.craftgui.events.EventWidget.LoseFocus;
-import binnie.craftgui.events.EventWidget.LoseFocus.Handler;
-import binnie.craftgui.minecraft.GuiCraftGUI;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import net.minecraft.client.gui.GuiTextField;
-
-public class ControlTextEdit
- extends Control
- implements IControlValue<String>
-{
- GuiTextField field;
-
- public ControlTextEdit(IWidget parent, float x, float y, float width, float height)
- {
- super(parent, x, y, width, height);
-
- this.field = new GuiTextField(getWindow().getGui().getFontRenderer(), 0, 0, 10, 10);
- addAttribute(Attribute.CanFocus);
- addAttribute(Attribute.MouseOver);
- this.field.setEnableBackgroundDrawing(false);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- addEventHandler(new EventKey.Down.Handler()
- {
- public void onEvent(EventKey.Down event)
- {
- ControlTextEdit.this.field.textboxKeyTyped(event.getCharacter(), event.getKey());
- String text = ControlTextEdit.this.getValue();
- if (!text.equals(ControlTextEdit.this.cachedValue))
- {
- ControlTextEdit.this.cachedValue = text;
- ControlTextEdit.this.callEvent(new EventTextEdit(ControlTextEdit.this, ControlTextEdit.this.cachedValue));
- ControlTextEdit.this.onTextEdit(ControlTextEdit.this.cachedValue);
- }
- }
- }.setOrigin(EventHandler.Origin.Self, this));
-
-
-
-
- addEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- ControlTextEdit.this.field.mouseClicked((int)ControlTextEdit.this.getRelativeMousePosition().x(), (int)ControlTextEdit.this.getRelativeMousePosition().y(), event.getButton());
- }
- }.setOrigin(EventHandler.Origin.Self, this));
-
-
-
- addEventHandler(new EventWidget.GainFocus.Handler()
- {
- public void onEvent(EventWidget.GainFocus event)
- {
- ControlTextEdit.this.field.setFocused(true);
- }
- }.setOrigin(EventHandler.Origin.Self, this));
-
-
-
- addEventHandler(new EventWidget.LoseFocus.Handler()
- {
- public void onEvent(EventWidget.LoseFocus event)
- {
- ControlTextEdit.this.field.setFocused(false);
- }
- }.setOrigin(EventHandler.Origin.Self, this));
- }
-
- public String getValue()
- {
- return this.field.getText() == null ? "" : this.field.getText();
- }
-
- public void setValue(String value)
- {
- if (!getValue().equals(value))
- {
- this.field.setText(value);
- this.field.setCursorPosition(0);
- }
- }
-
- private String cachedValue = "";
-
- public void onUpdateClient() {}
-
- protected void onTextEdit(String value) {}
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(CraftGUITexture.Slot, getArea());
- renderTextField();
- }
-
- protected void renderTextField()
- {
- this.field.width = ((int)w());
- this.field.height = ((int)h());
- this.field.xPosition = ((int)((h() - 8.0F) / 2.0F));
- this.field.yPosition = ((int)((h() - 8.0F) / 2.0F));
- this.field.drawTextBox();
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/IControlSelection.java b/src/Java/binnie/craftgui/controls/IControlSelection.java
deleted file mode 100644
index 4648f49290..0000000000
--- a/src/Java/binnie/craftgui/controls/IControlSelection.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package binnie.craftgui.controls;
-
-public abstract interface IControlSelection<T>
-{
- public abstract T getSelectedValue();
-
- public abstract void setSelectedValue(T paramT);
-
- public abstract boolean isSelected(IControlSelectionOption<T> paramIControlSelectionOption);
-}
diff --git a/src/Java/binnie/craftgui/controls/IControlSelectionOption.java b/src/Java/binnie/craftgui/controls/IControlSelectionOption.java
deleted file mode 100644
index 9074a55541..0000000000
--- a/src/Java/binnie/craftgui/controls/IControlSelectionOption.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package binnie.craftgui.controls;
-
-public abstract interface IControlSelectionOption<T>
-{
- public abstract T getValue();
-}
diff --git a/src/Java/binnie/craftgui/controls/button/ControlButton.java b/src/Java/binnie/craftgui/controls/button/ControlButton.java
deleted file mode 100644
index b41cb65116..0000000000
--- a/src/Java/binnie/craftgui/controls/button/ControlButton.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package binnie.craftgui.controls.button;
-
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.TextJustification;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventButtonClicked;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public class ControlButton
- extends Control
-{
- private ControlText textWidget;
- private String text;
-
- public ControlButton(IWidget parent, float x, float y, float width, float height)
- {
- super(parent, x, y, width, height);
-
- addAttribute(Attribute.MouseOver);
-
- addEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- ControlButton.this.callEvent(new EventButtonClicked(ControlButton.this.getWidget()));
- ControlButton.this.onMouseClick(event);
- }
- }.setOrigin(EventHandler.Origin.Self, this));
- }
-
- protected void onMouseClick(EventMouse.Down event) {}
-
- public ControlButton(IWidget parent, float x, float y, float width, float height, String text)
- {
- this(parent, x, y, width, height);
-
- this.text = text;
- this.textWidget = new ControlText(this, getArea(), text, TextJustification.MiddleCenter);
- }
-
- public void onUpdateClient()
- {
- if (this.textWidget != null) {
- this.textWidget.setValue(getText());
- }
- }
-
- public String getText()
- {
- return this.text;
- }
-
- public void onRenderBackground()
- {
- Object texture = CraftGUITexture.ButtonDisabled;
- if (isMouseOver()) {
- texture = CraftGUITexture.ButtonHighlighted;
- } else if (isEnabled()) {
- texture = CraftGUITexture.Button;
- }
- CraftGUI.Render.texture(texture, getArea());
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/button/ControlEnumButton.java b/src/Java/binnie/craftgui/controls/button/ControlEnumButton.java
deleted file mode 100644
index 924bd8c110..0000000000
--- a/src/Java/binnie/craftgui/controls/button/ControlEnumButton.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package binnie.craftgui.controls.button;
-
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventValueChanged;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ControlEnumButton<T>
- extends ControlButton
- implements IControlValue<T>
-{
- public static final String eventEnumChanged = "eventEnumButtonChanged";
- private T currentSelection;
-
- public String getText()
- {
- return this.currentSelection.toString();
- }
-
- public void onMouseClick(EventMouse.Down event)
- {
- int index = this.enumConstants.indexOf(this.currentSelection);
- if (index < this.enumConstants.size() - 1) {
- index++;
- } else {
- index = 0;
- }
- T newEnum = this.enumConstants.get(index);
-
- setValue(newEnum);
- }
-
- public void setValue(T selection)
- {
- if (this.currentSelection != selection)
- {
- this.currentSelection = selection;
- callEvent(new EventValueChanged(this, getValue()));
- }
- }
-
- private List<T> enumConstants = new ArrayList();
-
- public ControlEnumButton(IWidget parent, float x, float y, float width, float height, T[] values)
- {
- super(parent, x, y, width, height, "");
- for (T value : values) {
- this.enumConstants.add(value);
- }
- if (values.length > 0) {
- this.currentSelection = values[0];
- }
- }
-
- public T getValue()
- {
- return this.currentSelection;
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/button/ControlToggleButton.java b/src/Java/binnie/craftgui/controls/button/ControlToggleButton.java
deleted file mode 100644
index 1a06801fbd..0000000000
--- a/src/Java/binnie/craftgui/controls/button/ControlToggleButton.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package binnie.craftgui.controls.button;
-
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventToggleButtonClicked;
-
-public class ControlToggleButton
- extends ControlButton
-{
- boolean toggled;
-
- public void onMouseClick(EventMouse.Down event)
- {
- callEvent(new EventToggleButtonClicked(this, this.toggled));
- }
-
- public ControlToggleButton(IWidget parent, int x, int y, int width, int height)
- {
- super(parent, x, y, width, height);
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/core/Control.java b/src/Java/binnie/craftgui/controls/core/Control.java
deleted file mode 100644
index f5f7bddabb..0000000000
--- a/src/Java/binnie/craftgui/controls/core/Control.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package binnie.craftgui.controls.core;
-
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.ITooltipHelp;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.Widget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.minecraft.Window;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Control
- extends Widget
- implements ITooltipHelp, ITooltip
-{
- public Control(IWidget parent, float x, float y, float w, float h)
- {
- super(parent);
- setPosition(new IPoint(x, y));
- setSize(new IPoint(w, h));
- initialise();
- }
-
- public Control(IWidget parent, IArea area)
- {
- this(parent, area.x(), area.y(), area.w(), area.h());
- }
-
- List<String> helpStrings = new ArrayList();
- List<String> tooltipStrings = new ArrayList();
-
- protected void initialise() {}
-
- public void onUpdateClient() {}
-
- public void addHelp(String string)
- {
- this.helpStrings.add(string);
- }
-
- public void addHelp(String[] strings)
- {
- for (String string : strings) {
- addHelp(string);
- }
- }
-
- public void addTooltip(String string)
- {
- addAttribute(Attribute.MouseOver);
- this.tooltipStrings.add(string);
- }
-
- public void addTooltip(String[] strings)
- {
- for (String string : strings) {
- addTooltip(string);
- }
- }
-
- public int extraLevel = 0;
-
- public int getLevel()
- {
- return this.extraLevel + super.getLevel();
- }
-
- public void getHelpTooltip(Tooltip tooltip)
- {
- tooltip.add(this.helpStrings);
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- tooltip.add(this.tooltipStrings);
- }
-
- public Window getWindow()
- {
- return (Window)getSuperParent();
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/core/IControlIndexed.java b/src/Java/binnie/craftgui/controls/core/IControlIndexed.java
deleted file mode 100644
index a30bceb76c..0000000000
--- a/src/Java/binnie/craftgui/controls/core/IControlIndexed.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.craftgui.controls.core;
-
-public abstract interface IControlIndexed
-{
- public abstract int getIndex();
-
- public abstract void setIndex(int paramInt);
-}
diff --git a/src/Java/binnie/craftgui/controls/core/IControlValue.java b/src/Java/binnie/craftgui/controls/core/IControlValue.java
deleted file mode 100644
index 9d44b8ad17..0000000000
--- a/src/Java/binnie/craftgui/controls/core/IControlValue.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package binnie.craftgui.controls.core;
-
-import binnie.craftgui.core.IWidget;
-
-public abstract interface IControlValue<T>
- extends IWidget
-{
- public abstract T getValue();
-
- public abstract void setValue(T paramT);
-}
diff --git a/src/Java/binnie/craftgui/controls/core/IControlValues.java b/src/Java/binnie/craftgui/controls/core/IControlValues.java
deleted file mode 100644
index 92bb5d1f13..0000000000
--- a/src/Java/binnie/craftgui/controls/core/IControlValues.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package binnie.craftgui.controls.core;
-
-import java.util.Collection;
-
-public abstract interface IControlValues<T>
- extends IControlValue<T>
-{
- public abstract Collection<T> getValues();
-
- public abstract void setValues(Collection<T> paramCollection);
-}
diff --git a/src/Java/binnie/craftgui/controls/listbox/ControlList.java b/src/Java/binnie/craftgui/controls/listbox/ControlList.java
deleted file mode 100644
index d1b6be8821..0000000000
--- a/src/Java/binnie/craftgui/controls/listbox/ControlList.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package binnie.craftgui.controls.listbox;
-
-import binnie.core.util.IValidator;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.events.EventValueChanged;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-public class ControlList<T>
- extends Control
- implements IControlValue<T>
-{
- ControlListBox<T> parent;
-
- protected ControlList(ControlListBox<T> parent, float x, float y, float w, float h)
- {
- super(parent, x, y, w, h);
- this.parent = parent;
- }
-
- T value = null;
- Map<T, IWidget> allOptions = new LinkedHashMap();
- Map<T, IWidget> optionWidgets = new LinkedHashMap();
-
- public T getValue()
- {
- return this.value;
- }
-
- public void setValue(T value)
- {
- if (value == this.value) {
- return;
- }
- this.value = value;
- if ((value != null) && (this.optionWidgets.containsKey(value)))
- {
- IWidget child = (IWidget)this.optionWidgets.get(value);
- this.parent.ensureVisible(child.y(), child.y() + child.h(), h());
- }
- getParent().callEvent(new EventValueChanged(getParent(), value));
- }
-
- boolean creating = false;
- IValidator<IWidget> validator;
-
- public void setOptions(Collection<T> options)
- {
- deleteAllChildren();
- this.allOptions.clear();
- int i = 0;
- for (T option : options)
- {
- IWidget optionWidget = ((ControlListBox)getParent()).createOption(option, 0);
- if (optionWidget != null) {
- this.allOptions.put(option, optionWidget);
- }
- i++;
- }
- filterOptions();
- }
-
- public void filterOptions()
- {
- int height = 0;
- this.optionWidgets.clear();
- for (Map.Entry<T, IWidget> entry : this.allOptions.entrySet()) {
- if (isValidOption((IWidget)entry.getValue()))
- {
- ((IWidget)entry.getValue()).show();
- this.optionWidgets.put(entry.getKey(), entry.getValue());
- ((IWidget)entry.getValue()).setPosition(new IPoint(0.0F, height));
- height = (int)(height + ((IWidget)entry.getValue()).getSize().y());
- }
- else
- {
- ((IWidget)entry.getValue()).hide();
- }
- }
- this.creating = true;
- setValue(getValue());
- setSize(new IPoint(getSize().x(), height));
- }
-
- public Collection<T> getOptions()
- {
- return this.optionWidgets.keySet();
- }
-
- public Collection<T> getAllOptions()
- {
- return this.allOptions.keySet();
- }
-
- public int getIndexOf(T value)
- {
- int index = 0;
- for (T option : getOptions())
- {
- if (option.equals(value)) {
- return index;
- }
- index++;
- }
- return -1;
- }
-
- public int getCurrentIndex()
- {
- return getIndexOf(getValue());
- }
-
- public void setIndex(int currentIndex)
- {
- int index = 0;
- for (T option : getOptions())
- {
- if (index == currentIndex)
- {
- setValue(option);
- return;
- }
- index++;
- }
- setValue(null);
- }
-
- private boolean isValidOption(IWidget widget)
- {
- return this.validator == null ? true : this.validator.isValid(widget);
- }
-
- public void setValidator(IValidator<IWidget> validator)
- {
- if (this.validator != validator)
- {
- this.validator = validator;
- filterOptions();
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/listbox/ControlListBox.java b/src/Java/binnie/craftgui/controls/listbox/ControlListBox.java
deleted file mode 100644
index e9370daa3d..0000000000
--- a/src/Java/binnie/craftgui/controls/listbox/ControlListBox.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package binnie.craftgui.controls.listbox;
-
-import binnie.core.util.IValidator;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.controls.scroll.ControlScrollableContent;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.events.EventKey.Down;
-import binnie.craftgui.events.EventKey.Down.Handler;
-import java.util.Collection;
-
-public class ControlListBox<T>
- extends ControlScrollableContent<ControlList<T>>
- implements IControlValue<T>
-{
- public ControlListBox(IWidget parent, float x, float y, float w, float h, float scrollBarSize)
- {
- super(parent, x, y, w, h, scrollBarSize);
- }
-
- public void initialise()
- {
- setScrollableContent(new ControlList(this, 1.0F, 1.0F, w() - 2.0F - this.scrollBarSize, h() - 2.0F));
-
- addEventHandler(new EventKey.Down.Handler()
- {
- public void onEvent(EventKey.Down event)
- {
- EventKey.Down eventKey = event;
- if (ControlListBox.this.calculateIsMouseOver())
- {
- int currentIndex = ((ControlList)ControlListBox.this.getContent()).getCurrentIndex();
- if (eventKey.getKey() == 208)
- {
- currentIndex++;
- if (currentIndex >= ((ControlList)ControlListBox.this.getContent()).getOptions().size()) {
- currentIndex = 0;
- }
- }
- else if (eventKey.getKey() == 200)
- {
- currentIndex--;
- if (currentIndex < 0) {
- currentIndex = ((ControlList)ControlListBox.this.getContent()).getOptions().size() - 1;
- }
- }
- ((ControlList)ControlListBox.this.getContent()).setIndex(currentIndex);
- }
- }
- });
- }
-
- public final T getValue()
- {
- return ((ControlList)getContent()).getValue();
- }
-
- public final void setValue(T value)
- {
- ((ControlList)getContent()).setValue(value);
- }
-
- public void setOptions(Collection<T> options)
- {
- ((ControlList)getContent()).setOptions(options);
- }
-
- public IWidget createOption(T value, int y)
- {
- return new ControlOption((ControlList)getContent(), value, y);
- }
-
- public void setValidator(IValidator<IWidget> validator)
- {
- ((ControlList)getContent()).setValidator(validator);
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/listbox/ControlOption.java b/src/Java/binnie/craftgui/controls/listbox/ControlOption.java
deleted file mode 100644
index 7a643101cf..0000000000
--- a/src/Java/binnie/craftgui/controls/listbox/ControlOption.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package binnie.craftgui.controls.listbox;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public class ControlOption<T>
- extends Control
- implements IControlValue<T>
-{
- T value;
-
- public void onUpdateClient()
- {
- if (getValue() == null) {
- return;
- }
- int colour = 10526880;
- if (isCurrentSelection()) {
- colour = 16777215;
- }
- setColour(colour);
- }
-
- public ControlOption(ControlList<T> controlList, T option)
- {
- this(controlList, option, 16);
- }
-
- public ControlOption(ControlList<T> controlList, T option, int height)
- {
- super(controlList, 0.0F, height, controlList.getSize().x(), 20.0F);
- this.value = option;
- if (this.value != null) {
- addAttribute(Attribute.MouseOver);
- }
- addSelfEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- ((IControlValue)ControlOption.this.getParent()).setValue(ControlOption.this.getValue());
- }
- });
- }
-
- public T getValue()
- {
- return this.value;
- }
-
- public void setValue(T value)
- {
- this.value = value;
- }
-
- public boolean isCurrentSelection()
- {
- return (getValue() != null) && (getValue().equals(((IControlValue)getParent()).getValue()));
- }
-
- public void onRenderForeground()
- {
- if (isCurrentSelection()) {
- CraftGUI.Render.texture(CraftGUITexture.Outline, getArea());
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/listbox/ControlTextOption.java b/src/Java/binnie/craftgui/controls/listbox/ControlTextOption.java
deleted file mode 100644
index 6a47ec5d41..0000000000
--- a/src/Java/binnie/craftgui/controls/listbox/ControlTextOption.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package binnie.craftgui.controls.listbox;
-
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.core.geometry.TextJustification;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventWidget.ChangeColour;
-import binnie.craftgui.events.EventWidget.ChangeColour.Handler;
-
-public class ControlTextOption<T>
- extends ControlOption<T>
-{
- public ControlTextOption(ControlList<T> controlList, T option, String optionName, int y)
- {
- super(controlList, option, y);
- this.textWidget = new ControlText(this, getArea(), optionName, TextJustification.MiddleCenter);
-
- addEventHandler(new EventWidget.ChangeColour.Handler()
- {
- public void onEvent(EventWidget.ChangeColour event)
- {
- ControlTextOption.this.textWidget.setColour(ControlTextOption.this.getColour());
- }
- }.setOrigin(EventHandler.Origin.Self, this));
- }
-
- public ControlTextOption(ControlList<T> controlList, T option, int y)
- {
- this(controlList, option, option.toString(), y);
- }
-
- protected ControlText textWidget = null;
-
- public String getText()
- {
- return this.textWidget.getValue();
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/page/ControlPage.java b/src/Java/binnie/craftgui/controls/page/ControlPage.java
deleted file mode 100644
index 0e5c89492e..0000000000
--- a/src/Java/binnie/craftgui/controls/page/ControlPage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package binnie.craftgui.controls.page;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.IWidget;
-
-public class ControlPage<T>
- extends Control
- implements IControlValue<T>
-{
- T value;
-
- public ControlPage(IWidget parent, T value)
- {
- this(parent, 0.0F, 0.0F, parent.w(), parent.h(), value);
- }
-
- public ControlPage(IWidget parent, float x, float y, float w, float h, T value)
- {
- super(parent, x, y, w, h);
- setValue(value);
- if (((parent instanceof IControlValue)) && (((IControlValue)parent).getValue() == null)) {
- ((IControlValue)parent).setValue(value);
- }
- }
-
- public T getValue()
- {
- return this.value;
- }
-
- public void setValue(T value)
- {
- this.value = value;
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/page/ControlPages.java b/src/Java/binnie/craftgui/controls/page/ControlPages.java
deleted file mode 100644
index 43a205e874..0000000000
--- a/src/Java/binnie/craftgui/controls/page/ControlPages.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package binnie.craftgui.controls.page;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.controls.core.IControlValues;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.events.EventValueChanged;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class ControlPages<T>
- extends Control
- implements IControlValues<T>, IControlValue<T>
-{
- public boolean isChildVisible(IWidget child)
- {
- if (child == null) {
- return false;
- }
- return this.value == ((IControlValue)child).getValue();
- }
-
- public ControlPages(IWidget parent, float x, float y, float w, float h)
- {
- super(parent, x, y, w, h);
- }
-
- T value = null;
-
- public void onAddChild(IWidget widget) {}
-
- public T getValue()
- {
- return this.value;
- }
-
- public void setValue(T value)
- {
- if (this.value != value)
- {
- this.value = value;
- callEvent(new EventValueChanged(this, value));
- }
- }
-
- public Collection<T> getValues()
- {
- List<T> list = new ArrayList();
- for (IWidget child : getWidgets()) {
- list.add(((IControlValue)child).getValue());
- }
- return list;
- }
-
- public void setValues(Collection<T> values) {}
-}
diff --git a/src/Java/binnie/craftgui/controls/scroll/ControlScroll.java b/src/Java/binnie/craftgui/controls/scroll/ControlScroll.java
deleted file mode 100644
index 1d03f5fbc7..0000000000
--- a/src/Java/binnie/craftgui/controls/scroll/ControlScroll.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package binnie.craftgui.controls.scroll;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.IWidget;
-
-public class ControlScroll
- extends Control
-{
- private IControlScrollable scrollWidget;
-
- public ControlScroll(IWidget parent, float x, float y, float width, float height, IControlScrollable scrollWidget)
- {
- super(parent, x, y, width, height);
- this.scrollWidget = scrollWidget;
- new ControlScrollBar(this);
- }
-
- public IControlScrollable getScrollableWidget()
- {
- return this.scrollWidget;
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/scroll/ControlScrollBar.java b/src/Java/binnie/craftgui/controls/scroll/ControlScrollBar.java
deleted file mode 100644
index a94705767d..0000000000
--- a/src/Java/binnie/craftgui/controls/scroll/ControlScrollBar.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package binnie.craftgui.controls.scroll;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.events.EventMouse.Drag;
-import binnie.craftgui.events.EventMouse.Drag.Handler;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public class ControlScrollBar
- extends Control
-{
- protected final IControlScrollable scrollable;
-
- public ControlScrollBar(ControlScroll parent)
- {
- this(parent, 0.0F, 0.0F, parent.getSize().x(), parent.getSize().y(), parent.getScrollableWidget());
- }
-
- public ControlScrollBar(IWidget parent, float x, float y, float w, float h, IControlScrollable scrollable2)
- {
- super(parent, x, y, w, h);
- this.scrollable = scrollable2;
- addAttribute(Attribute.MouseOver);
-
- addSelfEventHandler(new EventMouse.Drag.Handler()
- {
- public void onEvent(EventMouse.Drag event)
- {
- ControlScrollBar.this.scrollable.movePercentage(event.getDy() / (ControlScrollBar.this.h() - ControlScrollBar.this.getBarHeight()));
- }
- });
- addSelfEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- float shownPercentage = ControlScrollBar.this.scrollable.getPercentageShown();
- float percentageIndex = ControlScrollBar.this.scrollable.getPercentageIndex();
- float minPercent = (1.0F - shownPercentage) * percentageIndex;
- float maxPercent = minPercent + shownPercentage;
- float clickedPercentage = ControlScrollBar.this.getRelativeMousePosition().y() / (ControlScrollBar.this.h() - 2.0F);
- clickedPercentage = Math.max(Math.min(clickedPercentage, 1.0F), 0.0F);
- if (clickedPercentage > maxPercent) {
- ControlScrollBar.this.scrollable.setPercentageIndex((clickedPercentage - shownPercentage) / (1.0F - shownPercentage));
- }
- if (clickedPercentage < minPercent) {
- ControlScrollBar.this.scrollable.setPercentageIndex(clickedPercentage / (1.0F - shownPercentage));
- }
- }
- });
- }
-
- public void onUpdateClient() {}
-
- public boolean isEnabled()
- {
- return this.scrollable.getPercentageShown() < 0.99F;
- }
-
- public float getBarHeight()
- {
- return h() * this.scrollable.getPercentageShown();
- }
-
- protected IArea getRenderArea()
- {
- float height = getBarHeight();
- if (height < 6.0F) {
- height = 6.0F;
- }
- float yOffset = ((int)h() - (int)getBarHeight()) * this.scrollable.getPercentageIndex();
-
- return new IArea(0.0F, yOffset, getSize().x(), height);
- }
-
- public void onRenderBackground()
- {
- IArea renderArea = getRenderArea();
-
- Object texture = CraftGUITexture.ScrollDisabled;
- if (isMouseOver()) {
- texture = CraftGUITexture.ScrollHighlighted;
- } else if (isEnabled()) {
- texture = CraftGUITexture.Scroll;
- }
- CraftGUI.Render.texture(texture, renderArea);
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/scroll/ControlScrollableContent.java b/src/Java/binnie/craftgui/controls/scroll/ControlScrollableContent.java
deleted file mode 100644
index 442c9d3226..0000000000
--- a/src/Java/binnie/craftgui/controls/scroll/ControlScrollableContent.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package binnie.craftgui.controls.scroll;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.events.EventMouse.Wheel;
-import binnie.craftgui.events.EventMouse.Wheel.Handler;
-import binnie.craftgui.events.EventWidget.ChangeSize;
-import binnie.craftgui.events.EventWidget.ChangeSize.Handler;
-
-public class ControlScrollableContent<T extends IWidget>
- extends Control
- implements IControlScrollable
-{
- protected T controlChild;
- protected float scrollBarSize;
-
- public ControlScrollableContent(IWidget parent, float x, float y, float w, float h, float scrollBarSize)
- {
- super(parent, x, y, w, h);
- if (scrollBarSize != 0.0F) {
- new ControlScroll(this, getSize().x() - scrollBarSize, 0.0F, scrollBarSize, getSize().y(), this);
- }
- addEventHandler(new EventMouse.Wheel.Handler()
- {
- public void onEvent(EventMouse.Wheel event)
- {
- if ((ControlScrollableContent.this.getRelativeMousePosition().x() > 0.0F) && (ControlScrollableContent.this.getRelativeMousePosition().y() > 0.0F) && (ControlScrollableContent.this.getRelativeMousePosition().x() < ControlScrollableContent.this.getSize().x()) && (ControlScrollableContent.this.getRelativeMousePosition().y() < ControlScrollableContent.this.getSize().y()))
- {
- if (ControlScrollableContent.this.getMovementRange() == 0.0F) {
- return;
- }
- float percentageMove = 0.8F / ControlScrollableContent.this.getMovementRange();
- ControlScrollableContent.this.movePercentage(percentageMove * -event.getDWheel());
- }
- }
- });
- this.scrollBarSize = scrollBarSize;
- }
-
- public void setScrollableContent(T child)
- {
- this.controlChild = child;
- if (child == null) {
- return;
- }
- child.setCroppedZone(this, new IArea(1.0F, 1.0F, getSize().x() - 2.0F - this.scrollBarSize, getSize().y() - 2.0F));
- child.addSelfEventHandler(new EventWidget.ChangeSize.Handler()
- {
- public void onEvent(EventWidget.ChangeSize event)
- {
- ControlScrollableContent.this.controlChild.setOffset(new IPoint(0.0F, -ControlScrollableContent.this.percentageIndex * ControlScrollableContent.this.getMovementRange()));
- if (ControlScrollableContent.this.getMovementRange() == 0.0F) {
- ControlScrollableContent.this.percentageIndex = 0.0F;
- }
- }
- });
- }
-
- public T getContent()
- {
- return this.controlChild;
- }
-
- public float getPercentageShown()
- {
- if ((this.controlChild == null) || (this.controlChild.getSize().y() == 0.0F)) {
- return 1.0F;
- }
- float shown = getSize().y() / this.controlChild.getSize().y();
- return Math.min(shown, 1.0F);
- }
-
- float percentageIndex = 0.0F;
-
- public float getPercentageIndex()
- {
- return this.percentageIndex;
- }
-
- public void movePercentage(float percentage)
- {
- if (this.controlChild == null) {
- return;
- }
- this.percentageIndex += percentage;
- if (this.percentageIndex > 1.0F) {
- this.percentageIndex = 1.0F;
- } else if (this.percentageIndex < 0.0F) {
- this.percentageIndex = 0.0F;
- }
- if (getMovementRange() == 0.0F) {
- this.percentageIndex = 0.0F;
- }
- this.controlChild.setOffset(new IPoint(0.0F, -this.percentageIndex * getMovementRange()));
- }
-
- public void setPercentageIndex(float index)
- {
- movePercentage(index - this.percentageIndex);
- }
-
- public float getMovementRange()
- {
- if (this.controlChild == null) {
- return 0.0F;
- }
- float range = this.controlChild.getSize().y() - getSize().y();
- return Math.max(range, 0.0F);
- }
-
- public void onUpdateClient()
- {
- setPercentageIndex(getPercentageIndex());
- }
-
- public void ensureVisible(float minY, float maxY, float totalY)
- {
- minY /= totalY;
- maxY /= totalY;
-
- float shownPercentage = getPercentageShown();
- float percentageIndex = getPercentageIndex();
- float minPercent = (1.0F - shownPercentage) * percentageIndex;
- float maxPercent = minPercent + shownPercentage;
- if (maxY > maxPercent) {
- setPercentageIndex((maxY - shownPercentage) / (1.0F - shownPercentage));
- }
- if (minY < minPercent) {
- setPercentageIndex(minY / (1.0F - shownPercentage));
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/scroll/IControlScrollable.java b/src/Java/binnie/craftgui/controls/scroll/IControlScrollable.java
deleted file mode 100644
index 39154815e5..0000000000
--- a/src/Java/binnie/craftgui/controls/scroll/IControlScrollable.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package binnie.craftgui.controls.scroll;
-
-import binnie.craftgui.core.IWidget;
-
-public abstract interface IControlScrollable
- extends IWidget
-{
- public abstract float getPercentageShown();
-
- public abstract float getPercentageIndex();
-
- public abstract void movePercentage(float paramFloat);
-
- public abstract void setPercentageIndex(float paramFloat);
-
- public abstract float getMovementRange();
-}
diff --git a/src/Java/binnie/craftgui/controls/tab/ControlTab.java b/src/Java/binnie/craftgui/controls/tab/ControlTab.java
deleted file mode 100644
index e05b7ed01a..0000000000
--- a/src/Java/binnie/craftgui/controls/tab/ControlTab.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package binnie.craftgui.controls.tab;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.events.EventValueChanged;
-import binnie.craftgui.minecraft.control.ControlItemDisplay;
-import binnie.craftgui.minecraft.control.ControlTabIcon;
-import binnie.craftgui.resource.Texture;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import java.util.List;
-
-public class ControlTab<T>
- extends Control
- implements ITooltip, IControlValue<T>
-{
- private ControlTabBar<T> tabBar;
- protected T value;
-
- public ControlTab(ControlTabBar<T> parent, float x, float y, float w, float h, T value)
- {
- super(parent, x, y, w, h);
- setValue(value);
- this.tabBar = parent;
- addAttribute(Attribute.MouseOver);
-
- addSelfEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- ControlTab.this.callEvent(new EventValueChanged(ControlTab.this.getWidget(), ControlTab.this.getValue()));
- }
- });
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- String name = getName();
- if ((name != null) && (!name.isEmpty())) {
- tooltip.add(getName());
- }
- if ((this.value instanceof ITooltip)) {
- ((ITooltip)this.value).getTooltip(tooltip);
- }
- }
-
- public T getValue()
- {
- return this.value;
- }
-
- public void setValue(T value)
- {
- this.value = value;
- }
-
- public boolean isCurrentSelection()
- {
- return (getValue() != null) && (getValue().equals(this.tabBar.getValue()));
- }
-
- public Position getTabPosition()
- {
- return this.tabBar.position;
- }
-
- public String getName()
- {
- return this.value.toString();
- }
-
- public void onRenderBackground()
- {
- Object texture = CraftGUITexture.TabDisabled;
- if (isMouseOver()) {
- texture = CraftGUITexture.TabHighlighted;
- } else if (isCurrentSelection()) {
- texture = CraftGUITexture.Tab;
- }
- Texture lTexture = CraftGUI.Render.getTexture(texture);
- Position position = getTabPosition();
-
- Texture iTexture = lTexture.crop(position, 8.0F);
-
-
- IArea area = getArea();
- if (texture == CraftGUITexture.TabDisabled) {
- if ((position == Position.Top) || (position == Position.Left))
- {
- area.setPosition(area.getPosition().sub(new IPoint(4 * position.x(), 4 * position.y())));
- area.setSize(area.getSize().add(new IPoint(4 * position.x(), 4 * position.y())));
- }
- else
- {
- area.setSize(area.getSize().sub(new IPoint(4 * position.x(), 4 * position.y())));
- }
- }
- CraftGUI.Render.texture(iTexture, area);
- if ((this instanceof ControlTabIcon))
- {
- ControlTabIcon icon = (ControlTabIcon)this;
- ControlItemDisplay item = (ControlItemDisplay)getWidgets().get(0);
- if (texture == CraftGUITexture.TabDisabled) {
- item.setColour(-1431655766);
- } else {
- item.setColour(-1);
- }
- if (icon.hasOutline())
- {
- iTexture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline);
- iTexture = iTexture.crop(position, 8.0F);
-
- CraftGUI.Render.colour(icon.getOutlineColour());
-
- CraftGUI.Render.texture(iTexture, area.inset(2));
- }
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/controls/tab/ControlTabBar.java b/src/Java/binnie/craftgui/controls/tab/ControlTabBar.java
deleted file mode 100644
index d209887994..0000000000
--- a/src/Java/binnie/craftgui/controls/tab/ControlTabBar.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package binnie.craftgui.controls.tab;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventValueChanged;
-import binnie.craftgui.events.EventValueChanged.Handler;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-public class ControlTabBar<T>
- extends Control
- implements IControlValue<T>
-{
- T value;
- Position position;
-
- public ControlTabBar(IWidget parent, float x, float y, float width, float height, Position position)
- {
- super(parent, x, y, width, height);
- this.position = position;
-
- addEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- ControlTabBar.this.setValue(event.getValue());
- }
- }.setOrigin(EventHandler.Origin.DirectChild, this));
- }
-
- public void setValues(Collection<T> values)
- {
- for (int i = 0; i < getWidgets().size();) {
- deleteChild((IWidget)getWidgets().get(0));
- }
- float length = values.size();
- int tabDimension = (int)(getSize().y() / length);
- if ((this.position == Position.Top) || (this.position == Position.Bottom)) {
- tabDimension = (int)(getSize().x() / length);
- }
- int i = 0;
- for (T value : values)
- {
- IWidget tab;
- IWidget tab;
- if ((this.position == Position.Top) || (this.position == Position.Bottom)) {
- tab = createTab(i * tabDimension, 0.0F, tabDimension, getSize().y(), value);
- } else {
- tab = createTab(0.0F, i * tabDimension, getSize().x(), tabDimension, value);
- }
- i++;
- }
- if ((this.value == null) && (!values.isEmpty())) {
- setValue(values.iterator().next());
- }
- }
-
- public ControlTab<T> createTab(float x, float y, float w, float h, T value)
- {
- return new ControlTab(this, x, y, w, h, value);
- }
-
- public T getValue()
- {
- return this.value;
- }
-
- public void setValue(T value)
- {
- boolean change = this.value != value;
- this.value = value;
- if (change) {
- callEvent(new EventValueChanged(this, value));
- }
- }
-
- public Position getDirection()
- {
- return this.position;
- }
-}
diff --git a/src/Java/binnie/craftgui/core/Attribute.java b/src/Java/binnie/craftgui/core/Attribute.java
deleted file mode 100644
index 5d73f58ae2..0000000000
--- a/src/Java/binnie/craftgui/core/Attribute.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package binnie.craftgui.core;
-
-public enum Attribute
- implements IWidgetAttribute
-{
- MouseOver, CanFocus, NeedsDeletion, AlwaysOnTop, BlockTooltip;
-
- private Attribute() {}
-}
diff --git a/src/Java/binnie/craftgui/core/CraftGUI.java b/src/Java/binnie/craftgui/core/CraftGUI.java
deleted file mode 100644
index 3cce3493cf..0000000000
--- a/src/Java/binnie/craftgui/core/CraftGUI.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package binnie.craftgui.core;
-
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.resource.minecraft.CraftGUIResourceManager;
-
-public class CraftGUI
-{
- public static CraftGUIResourceManager ResourceManager;
- public static Renderer Render;
-}
diff --git a/src/Java/binnie/craftgui/core/ITooltip.java b/src/Java/binnie/craftgui/core/ITooltip.java
deleted file mode 100644
index 634ce476d5..0000000000
--- a/src/Java/binnie/craftgui/core/ITooltip.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package binnie.craftgui.core;
-
-public abstract interface ITooltip
-{
- public abstract void getTooltip(Tooltip paramTooltip);
-}
diff --git a/src/Java/binnie/craftgui/core/ITooltipHelp.java b/src/Java/binnie/craftgui/core/ITooltipHelp.java
deleted file mode 100644
index f01744ab6f..0000000000
--- a/src/Java/binnie/craftgui/core/ITooltipHelp.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package binnie.craftgui.core;
-
-public abstract interface ITooltipHelp
-{
- public abstract void getHelpTooltip(Tooltip paramTooltip);
-}
diff --git a/src/Java/binnie/craftgui/core/ITopLevelWidget.java b/src/Java/binnie/craftgui/core/ITopLevelWidget.java
deleted file mode 100644
index 2e209b3ea6..0000000000
--- a/src/Java/binnie/craftgui/core/ITopLevelWidget.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package binnie.craftgui.core;
-
-import binnie.craftgui.core.geometry.IPoint;
-
-public abstract interface ITopLevelWidget
- extends IWidget
-{
- public abstract void setMousePosition(int paramInt1, int paramInt2);
-
- public abstract IPoint getAbsoluteMousePosition();
-
- public abstract IWidget getFocusedWidget();
-
- public abstract IWidget getMousedOverWidget();
-
- public abstract IWidget getDraggedWidget();
-
- public abstract boolean isFocused(IWidget paramIWidget);
-
- public abstract boolean isMouseOver(IWidget paramIWidget);
-
- public abstract boolean isDragged(IWidget paramIWidget);
-
- public abstract void updateTopLevel();
-
- public abstract void widgetDeleted(IWidget paramIWidget);
-
- public abstract IPoint getDragDistance();
-}
diff --git a/src/Java/binnie/craftgui/core/IWidget.java b/src/Java/binnie/craftgui/core/IWidget.java
deleted file mode 100644
index cd85fa7a40..0000000000
--- a/src/Java/binnie/craftgui/core/IWidget.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package binnie.craftgui.core;
-
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.events.Event;
-import binnie.craftgui.events.EventHandler;
-import java.util.List;
-
-public abstract interface IWidget
-{
- public abstract IWidget getParent();
-
- public abstract void deleteChild(IWidget paramIWidget);
-
- public abstract void deleteAllChildren();
-
- public abstract ITopLevelWidget getSuperParent();
-
- public abstract boolean isTopLevel();
-
- public abstract IPoint getPosition();
-
- public abstract IPoint pos();
-
- public abstract void setPosition(IPoint paramIPoint);
-
- public abstract IPoint getSize();
-
- public abstract IPoint size();
-
- public abstract void setSize(IPoint paramIPoint);
-
- public abstract IPoint getOriginalPosition();
-
- public abstract IPoint getAbsolutePosition();
-
- public abstract IPoint getOriginalAbsolutePosition();
-
- public abstract IPoint getOffset();
-
- public abstract IArea getArea();
-
- public abstract IArea area();
-
- public abstract void setOffset(IPoint paramIPoint);
-
- public abstract IPoint getMousePosition();
-
- public abstract IPoint getRelativeMousePosition();
-
- public abstract void setColour(int paramInt);
-
- public abstract int getColour();
-
- public abstract void render();
-
- public abstract void updateClient();
-
- public abstract void enable();
-
- public abstract void disable();
-
- public abstract void show();
-
- public abstract void hide();
-
- public abstract boolean calculateIsMouseOver();
-
- public abstract boolean isEnabled();
-
- public abstract boolean isVisible();
-
- public abstract boolean isFocused();
-
- public abstract boolean isMouseOver();
-
- public abstract boolean isDragged();
-
- public abstract boolean isChildVisible(IWidget paramIWidget);
-
- public abstract boolean isChildEnabled(IWidget paramIWidget);
-
- public abstract boolean canMouseOver();
-
- public abstract boolean canFocus();
-
- public abstract IWidget addWidget(IWidget paramIWidget);
-
- public abstract List<IWidget> getWidgets();
-
- public abstract void callEvent(Event paramEvent);
-
- public abstract void recieveEvent(Event paramEvent);
-
- public abstract void onUpdateClient();
-
- public abstract void delete();
-
- public abstract void onDelete();
-
- public abstract <T> T getWidget(Class<T> paramClass);
-
- public abstract IArea getCroppedZone();
-
- public abstract void setCroppedZone(IWidget paramIWidget, IArea paramIArea);
-
- public abstract boolean isCroppedWidet();
-
- public abstract IWidget getCropWidget();
-
- public abstract boolean isMouseOverWidget(IPoint paramIPoint);
-
- public abstract int getLevel();
-
- public abstract boolean isDescendant(IWidget paramIWidget);
-
- public abstract List<IWidgetAttribute> getAttributes();
-
- public abstract boolean hasAttribute(IWidgetAttribute paramIWidgetAttribute);
-
- public abstract boolean addAttribute(IWidgetAttribute paramIWidgetAttribute);
-
- public abstract <E extends Event> void addEventHandler(EventHandler<E> paramEventHandler);
-
- public abstract <E extends Event> void addSelfEventHandler(EventHandler<E> paramEventHandler);
-
- public abstract boolean contains(IPoint paramIPoint);
-
- public abstract float x();
-
- public abstract float y();
-
- public abstract float w();
-
- public abstract float h();
-
- public abstract void onRender(RenderStage paramRenderStage);
-}
diff --git a/src/Java/binnie/craftgui/core/IWidgetAttribute.java b/src/Java/binnie/craftgui/core/IWidgetAttribute.java
deleted file mode 100644
index 87d994ca43..0000000000
--- a/src/Java/binnie/craftgui/core/IWidgetAttribute.java
+++ /dev/null
@@ -1,3 +0,0 @@
-package binnie.craftgui.core;
-
-public abstract interface IWidgetAttribute {}
diff --git a/src/Java/binnie/craftgui/core/RenderStage.java b/src/Java/binnie/craftgui/core/RenderStage.java
deleted file mode 100644
index e710c833e6..0000000000
--- a/src/Java/binnie/craftgui/core/RenderStage.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.craftgui.core;
-
-public enum RenderStage
-{
- PreChildren, PostChildren, PostSiblings;
-
- private RenderStage() {}
-}
diff --git a/src/Java/binnie/craftgui/core/Tooltip.java b/src/Java/binnie/craftgui/core/Tooltip.java
deleted file mode 100644
index 4afb7f6bc5..0000000000
--- a/src/Java/binnie/craftgui/core/Tooltip.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package binnie.craftgui.core;
-
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.FluidStack;
-
-public class Tooltip
-{
- public void add(String string)
- {
- this.tooltip.add(string);
- }
-
- public String getLine(int index)
- {
- String string = (String)getList().get(index);
- return string;
- }
-
- public void add(List list)
- {
- for (Object obj : list) {
- this.tooltip.add((String)obj);
- }
- }
-
- List<String> tooltip = new ArrayList();
-
- public List<String> getList()
- {
- return this.tooltip;
- }
-
- public boolean exists()
- {
- return this.tooltip.size() > 0;
- }
-
- public static enum Type
- implements Tooltip.ITooltipType
- {
- Standard, Help, Information, User, Power;
-
- private Type() {}
- }
-
- public void setType(ITooltipType type)
- {
- this.type = type;
- }
-
- ITooltipType type = Type.Standard;
- public int maxWidth = 256;
-
- public void setMaxWidth(int w)
- {
- this.maxWidth = w;
- }
-
- public ITooltipType getType()
- {
- return this.type;
- }
-
- public void add(ItemStack item, String string)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- item.writeToNBT(nbt);
- nbt.setByte("nbt-type", (byte)105);
- add("~~~" + nbt.toString() + "~~~" + string);
- }
-
- public void add(FluidStack item, String string)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- item.writeToNBT(nbt);
- nbt.setByte("nbt-type", (byte)102);
- add("~~~" + nbt.toString() + "~~~" + string);
- }
-
- public static abstract interface ITooltipType {}
-}
diff --git a/src/Java/binnie/craftgui/core/TopLevelWidget.java b/src/Java/binnie/craftgui/core/TopLevelWidget.java
deleted file mode 100644
index 6f2cdd18a6..0000000000
--- a/src/Java/binnie/craftgui/core/TopLevelWidget.java
+++ /dev/null
@@ -1,248 +0,0 @@
-package binnie.craftgui.core;
-
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.events.EventMouse.Drag;
-import binnie.craftgui.events.EventMouse.Move;
-import binnie.craftgui.events.EventMouse.Up;
-import binnie.craftgui.events.EventMouse.Up.Handler;
-import binnie.craftgui.events.EventWidget.EndDrag;
-import binnie.craftgui.events.EventWidget.EndMouseOver;
-import binnie.craftgui.events.EventWidget.GainFocus;
-import binnie.craftgui.events.EventWidget.LoseFocus;
-import binnie.craftgui.events.EventWidget.StartDrag;
-import binnie.craftgui.events.EventWidget.StartDrag.Handler;
-import binnie.craftgui.events.EventWidget.StartMouseOver;
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Deque;
-import java.util.List;
-import java.util.ListIterator;
-import org.lwjgl.input.Mouse;
-
-public abstract class TopLevelWidget
- extends Widget
- implements ITopLevelWidget
-{
- public TopLevelWidget()
- {
- super(null);
-
- addEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- TopLevelWidget.this.setDraggedWidget(TopLevelWidget.this.mousedOverWidget, event.getButton());
- TopLevelWidget.this.setFocusedWidget(TopLevelWidget.this.mousedOverWidget);
- }
- });
- addEventHandler(new EventMouse.Up.Handler()
- {
- public void onEvent(EventMouse.Up event)
- {
- TopLevelWidget.this.setDraggedWidget(null);
- }
- });
- addEventHandler(new EventWidget.StartDrag.Handler()
- {
- public void onEvent(EventWidget.StartDrag event)
- {
- TopLevelWidget.this.dragStart = TopLevelWidget.this.getRelativeMousePosition();
- }
- });
- }
-
- IWidget mousedOverWidget = null;
- IWidget draggedWidget = null;
- IWidget focusedWidget = null;
-
- public void setMousedOverWidget(IWidget widget)
- {
- if (this.mousedOverWidget == widget) {
- return;
- }
- if (this.mousedOverWidget != null) {
- callEvent(new EventWidget.EndMouseOver(this.mousedOverWidget));
- }
- this.mousedOverWidget = widget;
- if (this.mousedOverWidget != null) {
- callEvent(new EventWidget.StartMouseOver(this.mousedOverWidget));
- }
- }
-
- public void setDraggedWidget(IWidget widget)
- {
- setDraggedWidget(widget, -1);
- }
-
- public void setDraggedWidget(IWidget widget, int button)
- {
- if (this.draggedWidget == widget) {
- return;
- }
- if (this.draggedWidget != null) {
- callEvent(new EventWidget.EndDrag(this.draggedWidget));
- }
- this.draggedWidget = widget;
- if (this.draggedWidget != null) {
- callEvent(new EventWidget.StartDrag(this.draggedWidget, button));
- }
- }
-
- public void setFocusedWidget(IWidget widget)
- {
- IWidget newWidget = widget;
- if (this.focusedWidget == newWidget) {
- return;
- }
- if ((newWidget != null) && (!newWidget.canFocus())) {
- newWidget = null;
- }
- if (this.focusedWidget != null) {
- callEvent(new EventWidget.LoseFocus(this.focusedWidget));
- }
- this.focusedWidget = newWidget;
- if (this.focusedWidget != null) {
- callEvent(new EventWidget.GainFocus(this.focusedWidget));
- }
- }
-
- public IWidget getMousedOverWidget()
- {
- return this.mousedOverWidget;
- }
-
- public IWidget getDraggedWidget()
- {
- return this.draggedWidget;
- }
-
- public IWidget getFocusedWidget()
- {
- return this.focusedWidget;
- }
-
- public boolean isMouseOver(IWidget widget)
- {
- return getMousedOverWidget() == widget;
- }
-
- public boolean isDragged(IWidget widget)
- {
- return getDraggedWidget() == widget;
- }
-
- public boolean isFocused(IWidget widget)
- {
- return getFocusedWidget() == widget;
- }
-
- public void updateTopLevel()
- {
- setMousedOverWidget(calculateMousedOverWidget());
- if ((getFocusedWidget() != null) && ((!getFocusedWidget().isVisible()) || (!getFocusedWidget().isEnabled()))) {
- setFocusedWidget(null);
- }
- if (!Mouse.isButtonDown(0)) {
- if (this.draggedWidget != null) {
- setDraggedWidget(null);
- }
- }
- }
-
- private IWidget calculateMousedOverWidget()
- {
- Deque<IWidget> queue = calculateMousedOverWidgets();
- while (!queue.isEmpty())
- {
- IWidget widget = (IWidget)queue.removeFirst();
- if ((widget.isEnabled()) && (widget.isVisible()) && (widget.canMouseOver())) {
- if ((widget.isEnabled()) && (widget.isVisible()) && (widget.canMouseOver()) && (widget.calculateIsMouseOver())) {
- return widget;
- }
- }
- }
- return null;
- }
-
- public Deque<IWidget> calculateMousedOverWidgets()
- {
- Deque<IWidget> list = new ArrayDeque();
- for (IWidget widget : getQueuedWidgets(this)) {
- if (widget.calculateIsMouseOver()) {
- list.addLast(widget);
- }
- }
- return list;
- }
-
- private Collection<IWidget> getQueuedWidgets(IWidget widget)
- {
- List<IWidget> widgets = new ArrayList();
-
- boolean addChildren = true;
- if (widget.isCroppedWidet()) {
- addChildren = widget.getCroppedZone().contains(widget.getCropWidget().getRelativeMousePosition());
- }
- if (addChildren)
- {
- ListIterator<IWidget> li = widget.getWidgets().listIterator(widget.getWidgets().size());
- while (li.hasPrevious())
- {
- IWidget child = (IWidget)li.previous();
- widgets.addAll(getQueuedWidgets(child));
- }
- }
- widgets.add(widget);
-
- return widgets;
- }
-
- protected IPoint mousePosition = new IPoint(0.0F, 0.0F);
-
- public void setMousePosition(int x, int y)
- {
- float dx = x - this.mousePosition.x();
- float dy = y - this.mousePosition.y();
- if ((dx != 0.0F) || (dy != 0.0F)) {
- if (getDraggedWidget() != null) {
- callEvent(new EventMouse.Drag(getDraggedWidget(), dx, dy));
- } else {
- callEvent(new EventMouse.Move(this, dx, dy));
- }
- }
- if ((this.mousePosition.x() != x) || (this.mousePosition.y() != y))
- {
- this.mousePosition = new IPoint(x, y);
- setMousedOverWidget(calculateMousedOverWidget());
- }
- }
-
- public IPoint getAbsoluteMousePosition()
- {
- return this.mousePosition;
- }
-
- public void widgetDeleted(IWidget widget)
- {
- if (isMouseOver(widget)) {
- setMousedOverWidget(null);
- }
- if (isDragged(widget)) {
- setDraggedWidget(null);
- }
- if (isFocused(widget)) {
- setFocusedWidget(null);
- }
- }
-
- IPoint dragStart = IPoint.ZERO;
-
- public IPoint getDragDistance()
- {
- return getRelativeMousePosition().sub(this.dragStart);
- }
-}
diff --git a/src/Java/binnie/craftgui/core/Widget.java b/src/Java/binnie/craftgui/core/Widget.java
deleted file mode 100644
index 448bcbaed6..0000000000
--- a/src/Java/binnie/craftgui/core/Widget.java
+++ /dev/null
@@ -1,499 +0,0 @@
-package binnie.craftgui.core;
-
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.Event;
-import binnie.craftgui.events.EventHandler;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventWidget.ChangeColour;
-import binnie.craftgui.events.EventWidget.ChangeOffset;
-import binnie.craftgui.events.EventWidget.ChangePosition;
-import binnie.craftgui.events.EventWidget.ChangeSize;
-import binnie.craftgui.events.EventWidget.Disable;
-import binnie.craftgui.events.EventWidget.Enable;
-import binnie.craftgui.events.EventWidget.Hide;
-import binnie.craftgui.events.EventWidget.Show;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.List;
-
-public class Widget
- implements IWidget
-{
- public Widget(IWidget parent)
- {
- this.parent = parent;
- if (parent != null) {
- parent.addWidget(this);
- }
- }
-
- private IWidget parent = null;
- private List<IWidget> subWidgets = new ArrayList();
- private List<IWidgetAttribute> attributes = new ArrayList();
-
- public List<IWidgetAttribute> getAttributes()
- {
- return this.attributes;
- }
-
- public boolean hasAttribute(IWidgetAttribute attribute)
- {
- return this.attributes.contains(attribute);
- }
-
- public boolean addAttribute(IWidgetAttribute attribute)
- {
- return this.attributes.add(attribute);
- }
-
- public final void deleteChild(IWidget child)
- {
- if (child == null) {
- return;
- }
- child.delete();
- this.subWidgets.remove(child);
- }
-
- public final void deleteAllChildren()
- {
- while (!this.subWidgets.isEmpty()) {
- deleteChild((IWidget)this.subWidgets.get(0));
- }
- }
-
- public final IWidget getParent()
- {
- return this.parent;
- }
-
- public final ITopLevelWidget getSuperParent()
- {
- return isTopLevel() ? (ITopLevelWidget)this : this.parent.getSuperParent();
- }
-
- public final IWidget addWidget(IWidget widget)
- {
- if ((this.subWidgets.size() != 0) && (((IWidget)this.subWidgets.get(this.subWidgets.size() - 1)).hasAttribute(Attribute.AlwaysOnTop))) {
- this.subWidgets.add(this.subWidgets.size() - 1, widget);
- } else {
- this.subWidgets.add(widget);
- }
- onAddChild(widget);
- return widget;
- }
-
- protected void onAddChild(IWidget widget) {}
-
- public final List<IWidget> getWidgets()
- {
- return this.subWidgets;
- }
-
- public final boolean isTopLevel()
- {
- return this instanceof ITopLevelWidget;
- }
-
- private IPoint position = new IPoint(0.0F, 0.0F);
- private IPoint size = new IPoint(0.0F, 0.0F);
- private IPoint offset = new IPoint(0.0F, 0.0F);
- IArea cropArea;
- IWidget cropWidget;
-
- public final IPoint pos()
- {
- return this.position.add(this.offset);
- }
-
- public final IPoint size()
- {
- return this.size;
- }
-
- public final IArea area()
- {
- return getArea();
- }
-
- public final IPoint getPosition()
- {
- return pos();
- }
-
- public final IArea getArea()
- {
- return new IArea(IPoint.ZERO, size());
- }
-
- public final IPoint getOriginalPosition()
- {
- return this.position;
- }
-
- boolean cropped = false;
-
- public IArea getCroppedZone()
- {
- return this.cropArea;
- }
-
- public void setCroppedZone(IWidget relative, IArea area)
- {
- this.cropArea = area;
- this.cropped = true;
- this.cropWidget = relative;
- }
-
- public final IPoint getAbsolutePosition()
- {
- return isTopLevel() ? getPosition() : getParent().getAbsolutePosition().add(getPosition());
- }
-
- public final IPoint getOriginalAbsolutePosition()
- {
- return isTopLevel() ? getOriginalPosition() : getParent().getOriginalPosition().sub(getOriginalPosition());
- }
-
- public final IPoint getSize()
- {
- return size();
- }
-
- public final IPoint getOffset()
- {
- return this.offset;
- }
-
- public final void setPosition(IPoint vector)
- {
- if (!vector.equals(this.position))
- {
- this.position = new IPoint(vector);
- callEvent(new EventWidget.ChangePosition(this));
- }
- }
-
- public final void setSize(IPoint vector)
- {
- if (!vector.equals(this.size))
- {
- this.size = new IPoint(vector);
- callEvent(new EventWidget.ChangeSize(this));
- }
- }
-
- public final void setOffset(IPoint vector)
- {
- if (vector != this.offset)
- {
- this.offset = new IPoint(vector);
- callEvent(new EventWidget.ChangeOffset(this));
- }
- }
-
- int colour = 16777215;
-
- public final void setColour(int colour)
- {
- if (this.colour != colour)
- {
- this.colour = colour;
- callEvent(new EventWidget.ChangeColour(this));
- }
- }
-
- public final int getColour()
- {
- return this.colour;
- }
-
- public boolean canMouseOver()
- {
- return hasAttribute(Attribute.MouseOver);
- }
-
- public boolean canFocus()
- {
- return hasAttribute(Attribute.CanFocus);
- }
-
- private Collection<EventHandler> globalEventHandlers = new ArrayList();
-
- public void addEventHandler(EventHandler handler)
- {
- this.globalEventHandlers.add(handler);
- }
-
- public void addSelfEventHandler(EventHandler handler)
- {
- addEventHandler(handler.setOrigin(EventHandler.Origin.Self, this));
- }
-
- public final void callEvent(Event event)
- {
- getSuperParent().recieveEvent(event);
- }
-
- public final void recieveEvent(Event event)
- {
- for (EventHandler handler : this.globalEventHandlers) {
- if (handler.handles(event)) {
- handler.onEvent(event);
- }
- }
- try
- {
- for (IWidget child : getWidgets()) {
- child.recieveEvent(event);
- }
- }
- catch (ConcurrentModificationException e) {}
- }
-
- public final IPoint getMousePosition()
- {
- return getSuperParent().getAbsoluteMousePosition();
- }
-
- public final IPoint getRelativeMousePosition()
- {
- return isTopLevel() ? getMousePosition() : getParent().getRelativeMousePosition().sub(getPosition());
- }
-
- public boolean isCroppedWidet()
- {
- return this.cropped;
- }
-
- public final IWidget getCropWidget()
- {
- return this.cropWidget == null ? this : this.cropWidget;
- }
-
- public final void render()
- {
- if (isVisible())
- {
- CraftGUI.Render.preRender(this);
- onRender(RenderStage.PreChildren);
- for (IWidget widget : getWidgets()) {
- widget.render();
- }
- for (IWidget widget : getWidgets())
- {
- CraftGUI.Render.preRender(widget);
- widget.onRender(RenderStage.PostSiblings);
- CraftGUI.Render.postRender(widget);
- }
- onRender(RenderStage.PostChildren);
- CraftGUI.Render.postRender(this);
- }
- }
-
- public final void updateClient()
- {
- if (!isVisible()) {
- return;
- }
- if (getSuperParent() == this) {
- ((ITopLevelWidget)this).updateTopLevel();
- }
- onUpdateClient();
-
- List<IWidget> deletedWidgets = new ArrayList();
- for (IWidget widget : getWidgets()) {
- if (widget.hasAttribute(Attribute.NeedsDeletion)) {
- deletedWidgets.add(widget);
- } else {
- widget.updateClient();
- }
- }
- for (IWidget widget : deletedWidgets) {
- deleteChild(widget);
- }
- }
-
- public final boolean calculateIsMouseOver()
- {
- IPoint mouse = getRelativeMousePosition();
- if (!this.cropped) {
- return isMouseOverWidget(mouse);
- }
- IWidget cropRelative = this.cropWidget != null ? this.cropWidget : this;
- IPoint pos = IPoint.sub(cropRelative.getAbsolutePosition(), getAbsolutePosition());
- IPoint size = new IPoint(this.cropArea.size().x(), this.cropArea.size().y());
- boolean inCrop = (mouse.x() > pos.x()) && (mouse.y() > pos.y()) && (mouse.x() < pos.x() + size.x()) && (mouse.y() < pos.y() + size.y());
-
- return (inCrop) && (isMouseOverWidget(mouse));
- }
-
- public boolean isMouseOverWidget(IPoint relativeMouse)
- {
- return getArea().contains(relativeMouse);
- }
-
- private boolean enabled = true;
- private boolean visible = true;
-
- public final void enable()
- {
- this.enabled = true;
- callEvent(new EventWidget.Enable(this));
- }
-
- public final void disable()
- {
- this.enabled = false;
- callEvent(new EventWidget.Disable(this));
- }
-
- public final void show()
- {
- this.visible = true;
- callEvent(new EventWidget.Show(this));
- }
-
- public final void hide()
- {
- this.visible = false;
- callEvent(new EventWidget.Hide(this));
- }
-
- public boolean isEnabled()
- {
- return (this.enabled) && ((isTopLevel()) || ((getParent().isEnabled()) && (getParent().isChildEnabled(this))));
- }
-
- public final boolean isVisible()
- {
- return (this.visible) && ((isTopLevel()) || ((getParent().isVisible()) && (getParent().isChildVisible(this))));
- }
-
- public final boolean isFocused()
- {
- return getSuperParent().isFocused(this);
- }
-
- public final boolean isDragged()
- {
- return getSuperParent().isDragged(this);
- }
-
- public final boolean isMouseOver()
- {
- return getSuperParent().isMouseOver(this);
- }
-
- public boolean isChildVisible(IWidget child)
- {
- return true;
- }
-
- public boolean isChildEnabled(IWidget child)
- {
- return true;
- }
-
- public void onRender(RenderStage stage)
- {
- if (stage == RenderStage.PreChildren) {
- onRenderBackground();
- }
- if (stage == RenderStage.PostChildren) {
- onRenderForeground();
- }
- if (stage == RenderStage.PostSiblings) {
- onRenderOverlay();
- }
- }
-
- public void onRenderBackground() {}
-
- public void onRenderForeground() {}
-
- public void onRenderOverlay() {}
-
- public void onUpdateClient() {}
-
- public final void delete()
- {
- getSuperParent().widgetDeleted(this);
- onDelete();
- }
-
- public void onDelete() {}
-
- public <T> T getWidget(Class<T> x)
- {
- for (IWidget child : getWidgets())
- {
- if (x.isInstance(child)) {
- return child;
- }
- T found = child.getWidget(x);
- if (found != null) {
- return found;
- }
- }
- return null;
- }
-
- public final boolean contains(IPoint position)
- {
- return getArea().contains(position);
- }
-
- public void scheduleDeletion()
- {
- addAttribute(Attribute.NeedsDeletion);
- }
-
- public int getLevel()
- {
- int level = getParent() == null ? 0 : getParent().getLevel();
- int index = getParent() == null ? 0 : getParent().getWidgets().indexOf(this);
- return level + index;
- }
-
- public boolean isDescendant(IWidget widget)
- {
- IWidget clss = this;
- do
- {
- if (clss == widget) {
- return true;
- }
- clss = clss.getParent();
- } while (clss != null);
- return false;
- }
-
- public float x()
- {
- return pos().x();
- }
-
- public float y()
- {
- return pos().y();
- }
-
- public float w()
- {
- return size().x();
- }
-
- public float h()
- {
- return size().y();
- }
-
- public IWidget getWidget()
- {
- return this;
- }
-}
diff --git a/src/Java/binnie/craftgui/core/geometry/CraftGUIUtil.java b/src/Java/binnie/craftgui/core/geometry/CraftGUIUtil.java
deleted file mode 100644
index 5a21e313d4..0000000000
--- a/src/Java/binnie/craftgui/core/geometry/CraftGUIUtil.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package binnie.craftgui.core.geometry;
-
-import binnie.craftgui.controls.core.IControlValue;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.events.EventValueChanged;
-import binnie.craftgui.events.EventValueChanged.Handler;
-
-public class CraftGUIUtil
-{
- public static void alignToWidget(IWidget target, IWidget relativeTo)
- {
- IPoint startPos = target.getAbsolutePosition();
- IPoint endPos = relativeTo.getAbsolutePosition();
- moveWidget(target, endPos.sub(startPos));
- }
-
- public static void moveWidget(IWidget target, IPoint movement)
- {
- target.setPosition(target.getPosition().add(movement));
- }
-
- public static void horizontalGrid(float px, float py, IWidget... widgets)
- {
- horizontalGrid(px, py, TextJustification.MiddleCenter, 0.0F, widgets);
- }
-
- public static void horizontalGrid(float px, float py, TextJustification just, float spacing, IWidget... widgets)
- {
- float x = 0.0F;
- float h = 0.0F;
- for (IWidget widget : widgets) {
- h = Math.max(h, widget.getSize().y());
- }
- for (IWidget widget : widgets)
- {
- widget.setPosition(new IPoint(px + x, py + (h - widget.getSize().y()) * just.yOffset));
- x += widget.getSize().x() + spacing;
- }
- }
-
- public static void verticalGrid(float px, float py, IWidget... widgets)
- {
- horizontalGrid(px, py, TextJustification.MiddleCenter, 0.0F, widgets);
- }
-
- public static void verticalGrid(float px, float py, TextJustification just, float spacing, IWidget... widgets)
- {
- float y = 0.0F;
- float w = 0.0F;
- for (IWidget widget : widgets) {
- w = Math.max(w, widget.getSize().x());
- }
- for (IWidget widget : widgets)
- {
- widget.setPosition(new IPoint(px + (w - widget.getSize().x()) * just.xOffset, py + y));
- y += widget.getSize().y() + spacing;
- }
- }
-
- public static <T> void linkWidgets(IControlValue<T> tab, IControlValue<T> target)
- {
- tab.addSelfEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- this.val$target.setValue(event.getValue());
- }
- });
- target.addSelfEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- this.val$tab.setValue(event.getValue());
- }
- });
- }
-}
diff --git a/src/Java/binnie/craftgui/core/geometry/IArea.java b/src/Java/binnie/craftgui/core/geometry/IArea.java
deleted file mode 100644
index c6b5511773..0000000000
--- a/src/Java/binnie/craftgui/core/geometry/IArea.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package binnie.craftgui.core.geometry;
-
-public class IArea
-{
- private IPoint pos;
- private IPoint size;
-
- public IArea(IArea area)
- {
- this(area.pos().x(), area.pos().y(), area.size().x(), area.size().y());
- }
-
- public IArea(IPoint pos, IPoint size)
- {
- this(pos.x(), pos.y(), size.x(), size.y());
- }
-
- public IArea(float xywh)
- {
- this(xywh, xywh, xywh, xywh);
- }
-
- public IArea(float xy, float wh)
- {
- this(xy, xy, wh, wh);
- }
-
- public IArea(float x, float y, float wh)
- {
- this(x, y, wh, wh);
- }
-
- public IArea(float x, float y, float w, float h)
- {
- setPosition(new IPoint(x, y));
- setSize(new IPoint(w, h));
- }
-
- public IPoint pos()
- {
- return this.pos;
- }
-
- public IPoint getPosition()
- {
- return this.pos;
- }
-
- public void setPosition(IPoint position)
- {
- this.pos = position.copy();
- }
-
- public IPoint size()
- {
- return this.size;
- }
-
- public IPoint getSize()
- {
- return this.size;
- }
-
- public void setSize(IPoint size)
- {
- this.size = size.copy();
- }
-
- public boolean contains(IPoint position)
- {
- return (position.x() >= pos().x()) && (position.y() >= this.pos.y()) && (position.x() <= pos().x() + size().x()) && (position.y() <= pos().y() + size().y());
- }
-
- public float x()
- {
- return pos().x();
- }
-
- public float y()
- {
- return pos().y();
- }
-
- public float w()
- {
- return size().x();
- }
-
- public float h()
- {
- return size().y();
- }
-
- public float x(float n)
- {
- return this.pos.x(n);
- }
-
- public float y(float n)
- {
- return this.pos.y(n);
- }
-
- public float w(float n)
- {
- return this.size.x(n);
- }
-
- public float h(float n)
- {
- return this.size.y(n);
- }
-
- public IArea inset(IBorder border)
- {
- return new IArea(x() + border.l(), y() + border.t(), w() - border.l() - border.r(), h() - border.t() - border.b());
- }
-
- public IArea outset(int outset)
- {
- return outset(new IBorder(outset));
- }
-
- public IArea outset(IBorder border)
- {
- return new IArea(x() - border.l(), y() - border.t(), w() + border.l() + border.r(), h() + border.t() + border.b());
- }
-
- public IArea inset(int inset)
- {
- return inset(new IBorder(inset));
- }
-
- public String toString()
- {
- return w() + "x" + h() + "@" + x() + "," + y();
- }
-
- public IArea shift(float dx, float f)
- {
- return new IArea(x() + dx, y() + f, w(), h());
- }
-}
diff --git a/src/Java/binnie/craftgui/core/geometry/IBorder.java b/src/Java/binnie/craftgui/core/geometry/IBorder.java
deleted file mode 100644
index e16b6d97f1..0000000000
--- a/src/Java/binnie/craftgui/core/geometry/IBorder.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package binnie.craftgui.core.geometry;
-
-public class IBorder
-{
- public static final IBorder ZERO = new IBorder(0.0F);
- float t;
- float b;
- float l;
- float r;
-
- public IBorder(float pad)
- {
- this(pad, pad, pad, pad);
- }
-
- public IBorder(float tb, float rl)
- {
- this(tb, rl, tb, rl);
- }
-
- public IBorder(float t, float rl, float b)
- {
- this(t, rl, b, rl);
- }
-
- public IBorder(float t, float r, float b, float l)
- {
- this.t = t;
- this.b = b;
- this.l = l;
- this.r = r;
- }
-
- public IBorder(Position edge, float n)
- {
- this(edge == Position.Top ? n : 0.0F, edge == Position.Right ? n : 0.0F, edge == Position.Bottom ? n : 0.0F, edge == Position.Left ? n : 0.0F);
- }
-
- public IBorder(IBorder padding)
- {
- this(padding.t(), padding.r(), padding.b(), padding.l());
- }
-
- public float t()
- {
- return this.t;
- }
-
- public float b()
- {
- return this.b;
- }
-
- public float l()
- {
- return this.l;
- }
-
- public float r()
- {
- return this.r;
- }
-
- public float t(float n)
- {
- this.t = n;
- return this.t;
- }
-
- public float b(float n)
- {
- this.b = n;
- return this.b;
- }
-
- public float l(float n)
- {
- this.l = n;
- return this.l;
- }
-
- public float r(float n)
- {
- this.r = n;
- return this.r;
- }
-
- public boolean isNonZero()
- {
- return (this.t != 0.0F) || (this.r != 0.0F) || (this.l != 0.0F) || (this.r != 0.0F);
- }
-
- @Deprecated
- public IPoint tl()
- {
- return new IPoint(l(), t());
- }
-
- @Deprecated
- public IPoint tr()
- {
- return new IPoint(r(), t());
- }
-
- @Deprecated
- public IPoint bl()
- {
- return new IPoint(l(), b());
- }
-
- @Deprecated
- public IPoint br()
- {
- return new IPoint(r(), b());
- }
-
- public IBorder add(IBorder o)
- {
- return new IBorder(t() + o.t(), r() + o.r(), b() + o.b(), l() + o.l());
- }
-
- public String toString()
- {
- return t() + "-" + r() + "-" + b() + "-" + l();
- }
-}
diff --git a/src/Java/binnie/craftgui/core/geometry/IPoint.java b/src/Java/binnie/craftgui/core/geometry/IPoint.java
deleted file mode 100644
index 53be8972fd..0000000000
--- a/src/Java/binnie/craftgui/core/geometry/IPoint.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package binnie.craftgui.core.geometry;
-
-public class IPoint
-{
- public static final IPoint ZERO = new IPoint(0.0F, 0.0F);
- float x = 0.0F;
- float y = 0.0F;
-
- public IPoint(float x, float y)
- {
- this.x = x;
- this.y = y;
- }
-
- public IPoint(IPoint o)
- {
- this.x = o.x();
- this.y = o.y();
- }
-
- public static IPoint add(IPoint a, IPoint b)
- {
- return new IPoint(a.x() + b.x(), a.y() + b.y());
- }
-
- public static IPoint sub(IPoint a, IPoint b)
- {
- return new IPoint(a.x() - b.x(), a.y() - b.y());
- }
-
- public IPoint sub(IPoint a)
- {
- return sub(this, a);
- }
-
- public IPoint add(IPoint other)
- {
- return add(this, other);
- }
-
- public IPoint add(float dx, float dy)
- {
- return add(this, new IPoint(dx, dy));
- }
-
- public IPoint copy()
- {
- return new IPoint(this);
- }
-
- public float x()
- {
- return this.x;
- }
-
- public float y()
- {
- return this.y;
- }
-
- public void xy(float x, float y)
- {
- x(x);
- y(y);
- }
-
- public float x(float x)
- {
- this.x = x;
- return x;
- }
-
- public float y(float y)
- {
- this.y = y;
- return y;
- }
-
- public boolean equals(IPoint other)
- {
- return (x() == other.x()) && (y() == other.y());
- }
-}
diff --git a/src/Java/binnie/craftgui/core/geometry/Position.java b/src/Java/binnie/craftgui/core/geometry/Position.java
deleted file mode 100644
index 51b856f120..0000000000
--- a/src/Java/binnie/craftgui/core/geometry/Position.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package binnie.craftgui.core.geometry;
-
-public enum Position
-{
- Top(0, -1), Bottom(0, 1), Left(-1, 0), Right(1, 0);
-
- int x;
- int y;
-
- private Position(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
-
- public int x()
- {
- return this.x;
- }
-
- public int y()
- {
- return this.y;
- }
-
- public Position opposite()
- {
- switch (1.$SwitchMap$binnie$craftgui$core$geometry$Position[ordinal()])
- {
- case 1:
- return Top;
- case 2:
- return Right;
- case 3:
- return Left;
- case 4:
- return Bottom;
- }
- return null;
- }
-}
diff --git a/src/Java/binnie/craftgui/core/geometry/TextJustification.java b/src/Java/binnie/craftgui/core/geometry/TextJustification.java
deleted file mode 100644
index 99b759380b..0000000000
--- a/src/Java/binnie/craftgui/core/geometry/TextJustification.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package binnie.craftgui.core.geometry;
-
-public enum TextJustification
-{
- TopLeft(0.0F, 0.0F), TopCenter(0.5F, 0.0F), TopRight(1.0F, 0.0F), MiddleLeft(0.0F, 0.5F), MiddleCenter(0.5F, 0.5F), MiddleRight(1.0F, 0.5F), BottomLeft(0.0F, 1.0F), BottomCenter(0.5F, 1.0F), BottomRight(1.0F, 1.0F);
-
- float xOffset;
- float yOffset;
-
- private TextJustification(float xOffset, float yOffset)
- {
- this.xOffset = xOffset;
- this.yOffset = yOffset;
- }
-
- public float getXOffset()
- {
- return this.xOffset;
- }
-
- public float getYOffset()
- {
- return this.yOffset;
- }
-}
diff --git a/src/Java/binnie/craftgui/core/renderer/Renderer.java b/src/Java/binnie/craftgui/core/renderer/Renderer.java
deleted file mode 100644
index b1d099bf3a..0000000000
--- a/src/Java/binnie/craftgui/core/renderer/Renderer.java
+++ /dev/null
@@ -1,252 +0,0 @@
-package binnie.craftgui.core.renderer;
-
-import binnie.core.BinnieCore;
-import binnie.core.proxy.BinnieProxy;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IBorder;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.core.geometry.TextJustification;
-import binnie.craftgui.minecraft.GuiCraftGUI;
-import binnie.craftgui.resource.IStyleSheet;
-import binnie.craftgui.resource.Texture;
-import java.util.List;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.renderer.texture.TextureMap;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-import org.lwjgl.opengl.GL11;
-
-public class Renderer
-{
- GuiCraftGUI gui;
-
- public Renderer(GuiCraftGUI gui)
- {
- this.gui = gui;
- }
-
- public final void preRender(IWidget widget)
- {
- GL11.glPushMatrix();
- GL11.glTranslatef(widget.getPosition().x(), widget.getPosition().y(), 0.0F);
- colour(widget.getColour());
- if (widget.isCroppedWidet())
- {
- IWidget cropRelative = widget.getCropWidget() != null ? widget.getCropWidget() : widget;
- IPoint pos = cropRelative.getAbsolutePosition();
- IArea cropZone = widget.getCroppedZone();
- limitArea(new IArea(pos.add(cropZone.pos()), cropZone.size()));
- GL11.glEnable(3089);
- }
- GL11.glDisable(2929);
- }
-
- public final void postRender(IWidget widget)
- {
- if (widget.isCroppedWidet()) {
- GL11.glDisable(3089);
- }
- GL11.glEnable(2929);
- GL11.glPopMatrix();
- }
-
- int currentColour = 16777215;
- Texture currentTexture;
- IStyleSheet stylesheet;
-
- public void colour(int hex)
- {
- this.currentColour = hex;
- int a = (hex & 0xFF000000) >> 24;
- int r = (hex & 0xFF0000) >> 16;
- int g = (hex & 0xFF00) >> 8;
- int b = hex & 0xFF;
- if (a < 0) {
- a += 256;
- }
- if ((a > 0) && (a != 255))
- {
- GL11.glColor4f(r / 255.0F, g / 255.0F, b / 255.0F, a / 255.0F);
- GL11.glEnable(3042);
- }
- else
- {
- GL11.glColor3f(r / 255.0F, g / 255.0F, b / 255.0F);
- }
- }
-
- public Texture getTexture(Object key)
- {
- if ((key instanceof Texture)) {
- return (Texture)key;
- }
- return this.stylesheet.getTexture(key);
- }
-
- public void setTexture(Texture texture)
- {
- if ((texture != this.currentTexture) && (texture != null)) {
- BinnieCore.proxy.bindTexture(texture.getFilename());
- }
- colour(this.currentColour);
- }
-
- public void texture(Object texture, IPoint position)
- {
- texture(getTexture(texture), position);
- }
-
- public void texture(Texture texture, IPoint position)
- {
- if (texture == null) {
- return;
- }
- setTexture(texture);
- IPoint point = position.sub(new IPoint(texture.getBorder().l(), texture.getBorder().t()));
- IArea textureArea = texture.getArea().outset(texture.getBorder());
- this.gui.renderTexture(point, textureArea);
- }
-
- public void texture(Object window, IArea area)
- {
- texture(getTexture(window), area);
- }
-
- public void texture(Texture texture, IArea area)
- {
- if (texture == null) {
- return;
- }
- setTexture(texture);
- IArea textureArea = texture.getArea().outset(texture.getBorder());
- IArea targetArea = area.outset(texture.getBorder());
- if ((textureArea.w() == targetArea.w()) && (textureArea.h() == targetArea.h())) {
- this.gui.renderTexture(targetArea.pos(), textureArea);
- } else {
- this.gui.renderTexturePadded(targetArea, textureArea, texture.getTotalPadding());
- }
- }
-
- public void stylesheet(IStyleSheet sheet)
- {
- this.stylesheet = sheet;
- }
-
- public int textWidth(String text)
- {
- return this.gui.getFontRenderer().getStringWidth(text);
- }
-
- public int textHeight()
- {
- return this.gui.getFontRenderer() == null ? 0 : this.gui.getFontRenderer().FONT_HEIGHT;
- }
-
- public void text(IPoint pos, String text, int colour)
- {
- text(new IArea(pos, new IPoint(500.0F, 500.0F)), TextJustification.TopLeft, text, colour);
- }
-
- public void text(IArea area, TextJustification justification, String text, int colour)
- {
- IPoint pos = area.pos();
- if (area.size().x() <= 0.0F) {
- return;
- }
- List<String> wrappedStrings = this.gui.getFontRenderer().listFormattedStringToWidth(text, (int)area.size().x());
- float totalHeight = wrappedStrings.size() * textHeight();
- float posY = area.pos().y();
- if (area.size().y() > totalHeight) {
- posY += (area.size().y() - totalHeight) * justification.getYOffset();
- }
- for (String string : wrappedStrings)
- {
- float stringWidth = textWidth(string);
- float posX = area.size().x() - stringWidth;
- posX *= justification.getXOffset();
- GL11.glDisable(2929);
- this.gui.getFontRenderer().drawString(string, (int)(pos.x() + posX), (int)posY, colour);
-
- posY += textHeight();
- }
- GL11.glColor3f(1.0F, 1.0F, 1.0F);
- }
-
- public void solid(IArea area, int colour)
- {
- this.gui.drawRect(area.pos().x(), area.pos().y(), area.pos().x() + area.size().x(), area.pos().y() + area.size().y(), 0xFF000000 | colour);
- }
-
- public void solidAlpha(IArea area, int c1)
- {
- this.gui.drawGradientArea(area.pos().x(), area.pos().y(), area.pos().x() + area.size().x(), area.pos().y() + area.size().y(), c1, c1);
- }
-
- public void gradientRect(IArea area, int c1, int c2)
- {
- this.gui.drawGradientArea(area.pos().x(), area.pos().y(), area.pos().x() + area.size().x(), area.pos().y() + area.size().y(), c1, c2);
- }
-
- public void item(IPoint pos, ItemStack item)
- {
- this.gui.renderItem(pos, item, false);
- }
-
- public void item(IPoint pos, ItemStack item, boolean rotating)
- {
- this.gui.renderItem(pos, item, rotating);
- }
-
- public void iconBlock(IPoint pos, IIcon icon)
- {
- this.gui.renderIcon(pos, icon, TextureMap.locationBlocksTexture);
- }
-
- public void iconItem(IPoint pos, IIcon icon)
- {
- this.gui.renderIcon(pos, icon, TextureMap.locationItemsTexture);
- }
-
- public void limitArea(IArea area)
- {
- this.gui.limitArea(area);
- }
-
- public float textHeight(String text, float width)
- {
- return this.gui.getFontRenderer().listFormattedStringToWidth(text, (int)width).size() * textHeight();
- }
-
- public void texturePercentage(Texture texture, IArea area, Position direction, float percentage)
- {
- float dist = (direction == Position.Top) || (direction == Position.Bottom) ? percentage * texture.h() : percentage * texture.w();
-
- float dim = (direction == Position.Top) || (direction == Position.Bottom) ? texture.h() : texture.w();
-
- float x = area.pos().x();
- float y = area.pos().y();
- float w = area.size().x();
- float h = area.size().y();
- switch (1.$SwitchMap$binnie$craftgui$core$geometry$Position[direction.ordinal()])
- {
- case 1:
- h *= percentage;
- break;
- case 2:
- x += (1.0F - percentage) * w;
- w *= percentage;
- break;
- case 3:
- w *= percentage;
- break;
- case 4:
- y += h - (int)(percentage * h);
- h *= percentage;
- }
- texture(texture.crop(direction, dim - dist), new IArea(x, y, w, h));
- }
-
- public void test(IWidget widget) {}
-}
diff --git a/src/Java/binnie/craftgui/core/renderer/TextureType.java b/src/Java/binnie/craftgui/core/renderer/TextureType.java
deleted file mode 100644
index 1c9b0e0d1c..0000000000
--- a/src/Java/binnie/craftgui/core/renderer/TextureType.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.craftgui.core.renderer;
-
-public enum TextureType
-{
- Stretched, Tiled;
-
- private TextureType() {}
-}
diff --git a/src/Java/binnie/craftgui/events/Event.java b/src/Java/binnie/craftgui/events/Event.java
deleted file mode 100644
index 0b4a39426a..0000000000
--- a/src/Java/binnie/craftgui/events/Event.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-
-public class Event
-{
- IWidget origin;
-
- public Event(IWidget origin)
- {
- this.origin = origin;
- }
-
- public IWidget getOrigin()
- {
- return this.origin;
- }
-
- public boolean isOrigin(IWidget widget)
- {
- return this.origin == widget;
- }
-}
diff --git a/src/Java/binnie/craftgui/events/EventButtonClicked.java b/src/Java/binnie/craftgui/events/EventButtonClicked.java
deleted file mode 100644
index 1823e6d430..0000000000
--- a/src/Java/binnie/craftgui/events/EventButtonClicked.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-
-public class EventButtonClicked
- extends Event
-{
- public EventButtonClicked(IWidget origin)
- {
- super(origin);
- }
-
- public static abstract class Handler
- extends EventHandler<EventButtonClicked>
- {
- public Handler()
- {
- super();
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/events/EventCycleChanged.java b/src/Java/binnie/craftgui/events/EventCycleChanged.java
deleted file mode 100644
index 628a177449..0000000000
--- a/src/Java/binnie/craftgui/events/EventCycleChanged.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-
-public class EventCycleChanged
- extends Event
-{
- public int value;
-
- public EventCycleChanged(IWidget origin, int value)
- {
- super(origin);
- this.value = value;
- }
-
- public int getValue()
- {
- return this.value;
- }
-}
diff --git a/src/Java/binnie/craftgui/events/EventHandler.java b/src/Java/binnie/craftgui/events/EventHandler.java
deleted file mode 100644
index 9d2e5d2ad3..0000000000
--- a/src/Java/binnie/craftgui/events/EventHandler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-import java.util.List;
-
-public abstract class EventHandler<E extends Event>
-{
- Class<E> eventClass;
- Origin origin = Origin.Any;
- IWidget relative = null;
-
- public EventHandler(Class<E> eventClass)
- {
- this.eventClass = eventClass;
- }
-
- public EventHandler setOrigin(Origin origin, IWidget relative)
- {
- this.origin = origin;
- this.relative = relative;
- return this;
- }
-
- public abstract void onEvent(E paramE);
-
- public final boolean handles(Event e)
- {
- return (this.eventClass.isInstance(e)) && (this.origin.isOrigin(e.getOrigin(), this.relative));
- }
-
- public static enum Origin
- {
- Any, Self, Parent, DirectChild;
-
- private Origin() {}
-
- public boolean isOrigin(IWidget origin, IWidget test)
- {
- switch (EventHandler.1.$SwitchMap$binnie$craftgui$events$EventHandler$Origin[ordinal()])
- {
- case 1:
- return true;
- case 2:
- return test.getWidgets().contains(origin);
- case 3:
- return test.getParent() == origin;
- case 4:
- return test == origin;
- }
- return false;
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/events/EventKey.java b/src/Java/binnie/craftgui/events/EventKey.java
deleted file mode 100644
index e49b736f43..0000000000
--- a/src/Java/binnie/craftgui/events/EventKey.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-
-public abstract class EventKey
- extends Event
-{
- char character;
- int key;
-
- public EventKey(IWidget origin, char character, int key)
- {
- super(origin);
- this.character = character;
- this.key = key;
- }
-
- public char getCharacter()
- {
- return this.character;
- }
-
- public int getKey()
- {
- return this.key;
- }
-
- public static class Down
- extends EventKey
- {
- public Down(IWidget origin, char character, int key)
- {
- super(character, key);
- }
-
- public static abstract class Handler
- extends EventHandler<EventKey.Down>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class Up
- extends EventKey
- {
- public Up(IWidget origin, char character, int key)
- {
- super(character, key);
- }
-
- public static abstract class Handler
- extends EventHandler<EventKey.Up>
- {
- public Handler()
- {
- super();
- }
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/events/EventMouse.java b/src/Java/binnie/craftgui/events/EventMouse.java
deleted file mode 100644
index 162552098a..0000000000
--- a/src/Java/binnie/craftgui/events/EventMouse.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-
-public abstract class EventMouse
- extends Event
-{
- public EventMouse(IWidget origin)
- {
- super(origin);
- }
-
- public static class Button
- extends EventMouse
- {
- int x;
- int y;
- int button;
-
- public int getX()
- {
- return this.x;
- }
-
- public int getY()
- {
- return this.y;
- }
-
- public int getButton()
- {
- return this.button;
- }
-
- public Button(IWidget currentMousedOverWidget, int x, int y, int button)
- {
- super();
- this.x = x;
- this.y = y;
- this.button = button;
- }
- }
-
- public static class Down
- extends EventMouse.Button
- {
- public Down(IWidget currentMousedOverWidget, int x, int y, int button)
- {
- super(x, y, button);
- }
-
- public static abstract class Handler
- extends EventHandler<EventMouse.Down>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class Up
- extends EventMouse.Button
- {
- public Up(IWidget currentMousedOverWidget, int x, int y, int button)
- {
- super(x, y, button);
- }
-
- public static abstract class Handler
- extends EventHandler<EventMouse.Up>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class Move
- extends EventMouse
- {
- float dx;
- float dy;
-
- public float getDx()
- {
- return this.dx;
- }
-
- public float getDy()
- {
- return this.dy;
- }
-
- public Move(IWidget origin, float dx, float dy)
- {
- super();
- this.dx = dx;
- this.dy = dy;
- }
-
- public static abstract class Handler
- extends EventHandler<EventMouse.Move>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class Drag
- extends EventMouse.Move
- {
- public Drag(IWidget draggedWidget, float dx, float dy)
- {
- super(dx, dy);
- }
-
- public static abstract class Handler
- extends EventHandler<EventMouse.Drag>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class Wheel
- extends EventMouse
- {
- int dWheel = 0;
-
- public Wheel(IWidget origin, int dWheel)
- {
- super();
- this.dWheel = (dWheel / 28);
- }
-
- public int getDWheel()
- {
- return this.dWheel;
- }
-
- public static abstract class Handler
- extends EventHandler<EventMouse.Wheel>
- {
- public Handler()
- {
- super();
- }
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/events/EventTextEdit.java b/src/Java/binnie/craftgui/events/EventTextEdit.java
deleted file mode 100644
index d61ae34008..0000000000
--- a/src/Java/binnie/craftgui/events/EventTextEdit.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-
-public class EventTextEdit
- extends EventValueChanged<String>
-{
- public EventTextEdit(IWidget origin, String text)
- {
- super(origin, text);
- }
-
- public static abstract class Handler
- extends EventHandler<EventTextEdit>
- {
- public Handler()
- {
- super();
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/events/EventToggleButtonClicked.java b/src/Java/binnie/craftgui/events/EventToggleButtonClicked.java
deleted file mode 100644
index 79ff26fa59..0000000000
--- a/src/Java/binnie/craftgui/events/EventToggleButtonClicked.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-
-public class EventToggleButtonClicked
- extends Event
-{
- boolean toggled;
-
- public EventToggleButtonClicked(IWidget origin, boolean toggled)
- {
- super(origin);
- this.toggled = toggled;
- }
-
- public boolean isActive()
- {
- return this.toggled;
- }
-}
diff --git a/src/Java/binnie/craftgui/events/EventValueChanged.java b/src/Java/binnie/craftgui/events/EventValueChanged.java
deleted file mode 100644
index df804cbfa5..0000000000
--- a/src/Java/binnie/craftgui/events/EventValueChanged.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-
-public class EventValueChanged<T>
- extends Event
-{
- public T value;
-
- public EventValueChanged(IWidget origin, T value)
- {
- super(origin);
- this.value = value;
- }
-
- public T getValue()
- {
- return this.value;
- }
-
- public static abstract class Handler
- extends EventHandler<EventValueChanged>
- {
- public Handler()
- {
- super();
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/events/EventValuesChanged.java b/src/Java/binnie/craftgui/events/EventValuesChanged.java
deleted file mode 100644
index e102487f14..0000000000
--- a/src/Java/binnie/craftgui/events/EventValuesChanged.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-
-public class EventValuesChanged<T>
- extends Event
-{
- public T[] values;
-
- public EventValuesChanged(IWidget origin, T[] values)
- {
- super(origin);
- this.values = values;
- }
-
- public T[] getValues()
- {
- return this.values;
- }
-}
diff --git a/src/Java/binnie/craftgui/events/EventWidget.java b/src/Java/binnie/craftgui/events/EventWidget.java
deleted file mode 100644
index 87ca98521f..0000000000
--- a/src/Java/binnie/craftgui/events/EventWidget.java
+++ /dev/null
@@ -1,272 +0,0 @@
-package binnie.craftgui.events;
-
-import binnie.craftgui.core.IWidget;
-
-public class EventWidget
- extends Event
-{
- public EventWidget(IWidget origin)
- {
- super(origin);
- }
-
- public static class Enable
- extends EventWidget
- {
- public Enable(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.Enable>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class Disable
- extends EventWidget
- {
- public Disable(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.Disable>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class Show
- extends EventWidget
- {
- public Show(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.Show>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class Hide
- extends EventWidget
- {
- public Hide(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.Hide>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class ChangePosition
- extends EventWidget
- {
- public ChangePosition(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.ChangePosition>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class ChangeSize
- extends EventWidget
- {
- public ChangeSize(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.ChangeSize>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class ChangeOffset
- extends EventWidget
- {
- public ChangeOffset(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.ChangeOffset>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class ChangeColour
- extends EventWidget
- {
- public ChangeColour(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.ChangeColour>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class StartMouseOver
- extends EventWidget
- {
- public StartMouseOver(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.StartMouseOver>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class EndMouseOver
- extends EventWidget
- {
- public EndMouseOver(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.EndMouseOver>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class StartDrag
- extends EventWidget
- {
- int button;
-
- public StartDrag(IWidget origin, int button)
- {
- super();
- this.button = button;
- }
-
- public int getButton()
- {
- return this.button;
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.StartDrag>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class EndDrag
- extends EventWidget
- {
- public EndDrag(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.EndDrag>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class GainFocus
- extends EventWidget
- {
- public GainFocus(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.GainFocus>
- {
- public Handler()
- {
- super();
- }
- }
- }
-
- public static class LoseFocus
- extends EventWidget
- {
- public LoseFocus(IWidget origin)
- {
- super();
- }
-
- public static abstract class Handler
- extends EventHandler<EventWidget.LoseFocus>
- {
- public Handler()
- {
- super();
- }
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/ContainerCraftGUI.java b/src/Java/binnie/craftgui/minecraft/ContainerCraftGUI.java
deleted file mode 100644
index 9b6a2809d9..0000000000
--- a/src/Java/binnie/craftgui/minecraft/ContainerCraftGUI.java
+++ /dev/null
@@ -1,549 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.core.BinnieCore;
-import binnie.core.machines.IMachine;
-import binnie.core.machines.Machine;
-import binnie.core.machines.network.INetwork.RecieveGuiNBT;
-import binnie.core.machines.network.INetwork.SendGuiNBT;
-import binnie.core.machines.power.ErrorState;
-import binnie.core.machines.power.IErrorStateSource;
-import binnie.core.machines.power.IPoweredMachine;
-import binnie.core.machines.power.IProcess;
-import binnie.core.machines.power.ITankMachine;
-import binnie.core.machines.power.PowerInfo;
-import binnie.core.machines.power.ProcessInfo;
-import binnie.core.machines.power.TankInfo;
-import binnie.core.machines.transfer.TransferRequest;
-import binnie.core.machines.transfer.TransferRequest.TransferSlot;
-import binnie.core.network.packet.MessageContainerUpdate;
-import binnie.core.proxy.BinnieProxy;
-import binnie.craftgui.minecraft.control.ControlSlot;
-import binnie.craftgui.minecraft.control.EnumHighlighting;
-import com.mojang.authlib.GameProfile;
-import cpw.mods.fml.relauncher.Side;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class ContainerCraftGUI
- extends Container
-{
- private Window window;
-
- public ContainerCraftGUI(Window window)
- {
- this.window = window;
- IMachine machine = Machine.getMachine(window.getInventory());
- if (getSide() == Side.SERVER)
- {
- this.inventoryItemStacks = new ListMap();
- this.inventorySlots = new ListMap();
- if (machine != null)
- {
- GameProfile user = machine.getOwner();
- if (user != null)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- nbt.setString("username", user.getName());
- sendNBTToClient("username", nbt);
- }
- }
- }
- }
-
- protected Slot addSlotToContainer(Slot slot)
- {
- return super.addSlotToContainer(slot);
- }
-
- private Side getSide()
- {
- return this.window.isServer() ? Side.SERVER : Side.CLIENT;
- }
-
- public Slot getSlot(int par1)
- {
- if ((par1 < 0) || (par1 >= this.inventorySlots.size())) {
- return null;
- }
- return (Slot)this.inventorySlots.get(par1);
- }
-
- public void putStackInSlot(int par1, ItemStack par2ItemStack)
- {
- if (getSlot(par1) != null) {
- getSlot(par1).putStack(par2ItemStack);
- }
- }
-
- public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack)
- {
- for (int i = 0; i < par1ArrayOfItemStack.length; i++) {
- if (getSlot(i) != null) {
- getSlot(i).putStack(par1ArrayOfItemStack[i]);
- }
- }
- }
-
- public void onContainerClosed(EntityPlayer par1EntityPlayer)
- {
- super.onContainerClosed(par1EntityPlayer);
-
- WindowInventory inventory = this.window.getWindowInventory();
- for (int i = 0; i < inventory.getSizeInventory(); i++) {
- if (inventory.dispenseOnClose(i))
- {
- ItemStack stack = inventory.getStackInSlot(i);
- if (stack != null)
- {
- stack = new TransferRequest(stack, par1EntityPlayer.inventory).transfer(true);
- if (stack != null) {
- par1EntityPlayer.dropPlayerItemWithRandomChoice(stack, false);
- }
- }
- }
- }
- }
-
- public ItemStack slotClick(int slotNum, int mouseButton, int modifier, EntityPlayer player)
- {
- Slot slot = getSlot(slotNum);
- if (((slot instanceof CustomSlot)) && (((CustomSlot)slot).handleClick()))
- {
- ((CustomSlot)slot).onSlotClick(this, mouseButton, modifier, player);
- return player.inventory.getItemStack();
- }
- ItemStack stack = super.slotClick(slotNum, mouseButton, modifier, player);
- return stack;
- }
-
- public void sendNBTToClient(String key, NBTTagCompound nbt)
- {
- this.syncedNBT.put(key, nbt);
- }
-
- public boolean canInteractWith(EntityPlayer var1)
- {
- return true;
- }
-
- public final ItemStack transferStackInSlot(EntityPlayer player, int slotID)
- {
- return shiftClick(player, slotID);
- }
-
- private ItemStack shiftClick(EntityPlayer player, int slotnumber)
- {
- TransferRequest request = getShiftClickRequest(player, slotnumber);
- if (request == null) {
- return null;
- }
- ItemStack itemstack = request.transfer(true);
- Slot shiftClickedSlot = (Slot)this.inventorySlots.get(slotnumber);
-
- shiftClickedSlot.putStack(itemstack);
- shiftClickedSlot.onSlotChanged();
-
- return null;
- }
-
- private TransferRequest getShiftClickRequest(EntityPlayer player, int slotnumber)
- {
- if (slotnumber < 0) {
- return null;
- }
- Slot shiftClickedSlot = (Slot)this.inventorySlots.get(slotnumber);
-
- ItemStack itemstack = null;
- if (shiftClickedSlot.getHasStack()) {
- itemstack = shiftClickedSlot.getStack().copy();
- }
- IInventory playerInventory = player.inventory;
- IInventory containerInventory = this.window.getInventory();
- IInventory windowInventory = this.window.getWindowInventory();
-
- IInventory fromPlayer = containerInventory == null ? windowInventory : containerInventory;
-
- int[] target = new int[36];
- for (int i = 0; i < 36; i++) {
- target[i] = i;
- }
- TransferRequest request;
- TransferRequest request;
- if (shiftClickedSlot.inventory == playerInventory) {
- request = new TransferRequest(itemstack, fromPlayer).setOrigin(shiftClickedSlot.inventory);
- } else {
- request = new TransferRequest(itemstack, playerInventory).setOrigin(shiftClickedSlot.inventory).setTargetSlots(target);
- }
- if ((this.window instanceof IWindowAffectsShiftClick)) {
- ((IWindowAffectsShiftClick)this.window).alterRequest(request);
- }
- return request;
- }
-
- public final ItemStack tankClick(EntityPlayer player, int slotID)
- {
- if (player.inventory.getItemStack() == null) {
- return null;
- }
- ItemStack heldItem = player.inventory.getItemStack().copy();
-
- heldItem = new TransferRequest(heldItem, this.window.getInventory()).setOrigin(player.inventory).setTargetSlots(new int[0]).setTargetTanks(new int[] { slotID }).transfer(true);
-
-
- player.inventory.setItemStack(heldItem);
- if ((player instanceof EntityPlayerMP)) {
- ((EntityPlayerMP)player).updateHeldItem();
- }
- return heldItem;
- }
-
- public boolean handleNBT(Side side, EntityPlayer player, String name, NBTTagCompound action)
- {
- if (side == Side.SERVER)
- {
- if (name.equals("tank-click")) {
- tankClick(player, action.getByte("id"));
- }
- if (name.equals("slot-reg"))
- {
- int type = action.getByte("t");
- int index = action.getShort("i");
- int slotNumber = action.getShort("n");
- getOrCreateSlot(InventoryType.values()[(type % 4)], index, slotNumber);
- }
- }
- if (name.contains("tank-update")) {
- onTankUpdate(action);
- } else if (name.equals("power-update")) {
- onPowerUpdate(action);
- } else if (name.equals("process-update")) {
- onProcessUpdate(action);
- } else if (name.equals("error-update")) {
- onErrorUpdate(action);
- } else if (name.equals("mouse-over-slot")) {
- onMouseOverSlot(player, action);
- } else if (name.equals("shift-click-info")) {
- onRecieveShiftClickHighlights(player, action);
- }
- return false;
- }
-
- private Map<String, NBTTagCompound> syncedNBT = new HashMap();
- private Map<String, NBTTagCompound> sentNBT = new HashMap();
-
- public void detectAndSendChanges()
- {
- super.detectAndSendChanges();
-
-
-
-
- ITankMachine tanks = (ITankMachine)Machine.getInterface(ITankMachine.class, this.window.getInventory());
- IPoweredMachine powered = (IPoweredMachine)Machine.getInterface(IPoweredMachine.class, this.window.getInventory());
- IErrorStateSource error = (IErrorStateSource)Machine.getInterface(IErrorStateSource.class, this.window.getInventory());
- IProcess process = (IProcess)Machine.getInterface(IProcess.class, this.window.getInventory());
- if ((tanks != null) && (this.window.isServer())) {
- for (int i = 0; i < tanks.getTankInfos().length; i++)
- {
- TankInfo tank = tanks.getTankInfos()[i];
- if (!getTankInfo(i).equals(tank))
- {
- this.syncedNBT.put("tank-update-" + i, createTankNBT(i, tank));
-
- this.syncedTanks.put(Integer.valueOf(i), tank);
- }
- }
- }
- if ((powered != null) && (this.window.isServer())) {
- this.syncedNBT.put("power-update", createPowerNBT(powered.getPowerInfo()));
- }
- if ((process != null) && (this.window.isServer())) {
- this.syncedNBT.put("process-update", createProcessNBT(process.getInfo()));
- }
- if ((error != null) && (this.window.isServer())) {
- this.syncedNBT.put("error-update", createErrorNBT(error));
- }
- INetwork.SendGuiNBT machineSync = (INetwork.SendGuiNBT)Machine.getInterface(INetwork.SendGuiNBT.class, this.window.getInventory());
- if (machineSync != null) {
- machineSync.sendGuiNBT(this.syncedNBT);
- }
- Map<String, NBTTagCompound> sentThisTime = new HashMap();
- for (Map.Entry<String, NBTTagCompound> nbt : this.syncedNBT.entrySet())
- {
- ((NBTTagCompound)nbt.getValue()).setString("type", (String)nbt.getKey());
-
-
-
-
-
-
- boolean shouldSend = true;
- NBTTagCompound lastSent = (NBTTagCompound)this.sentNBT.get(nbt.getKey());
- if (lastSent != null) {
- shouldSend = !lastSent.equals(nbt.getValue());
- }
- if (shouldSend)
- {
- for (int j = 0; j < this.crafters.size(); j++) {
- if ((this.crafters.get(j) instanceof EntityPlayerMP))
- {
- EntityPlayerMP player = (EntityPlayerMP)this.crafters.get(j);
- BinnieCore.proxy.sendToPlayer(new MessageContainerUpdate((NBTTagCompound)nbt.getValue()), player);
- }
- }
- sentThisTime.put(nbt.getKey(), nbt.getValue());
- }
- }
- this.sentNBT.putAll(sentThisTime);
-
- this.syncedNBT.clear();
- }
-
- private NBTTagCompound createErrorNBT(IErrorStateSource error)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- ErrorState state = null;
- if (error.canWork() != null)
- {
- nbt.setByte("type", (byte)0);
- state = error.canWork();
- }
- else if (error.canProgress() != null)
- {
- nbt.setByte("type", (byte)1);
- state = error.canProgress();
- }
- if (state != null) {
- state.writeToNBT(nbt);
- }
- return nbt;
- }
-
- public NBTTagCompound createPowerNBT(PowerInfo powerInfo)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- powerInfo.writeToNBT(nbt);
- return nbt;
- }
-
- public NBTTagCompound createProcessNBT(ProcessInfo powerInfo)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- powerInfo.writeToNBT(nbt);
- return nbt;
- }
-
- public NBTTagCompound createTankNBT(int tank, TankInfo tankInfo)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- tankInfo.writeToNBT(nbt);
- nbt.setByte("tank", (byte)tank);
- return nbt;
- }
-
- private Map<Integer, TankInfo> syncedTanks = new HashMap();
- private PowerInfo syncedPower = new PowerInfo();
- private ProcessInfo syncedProcess = new ProcessInfo();
- private int errorType = 0;
- private ErrorState error = null;
-
- public void onTankUpdate(NBTTagCompound nbt)
- {
- int tankID = nbt.getByte("tank");
- TankInfo tank = new TankInfo();
- tank.readFromNBT(nbt);
- this.syncedTanks.put(Integer.valueOf(tankID), tank);
- }
-
- public void onProcessUpdate(NBTTagCompound nbt)
- {
- this.syncedProcess = new ProcessInfo();
- this.syncedProcess.readFromNBT(nbt);
- }
-
- public void onPowerUpdate(NBTTagCompound nbt)
- {
- this.syncedPower = new PowerInfo();
- this.syncedPower.readFromNBT(nbt);
- }
-
- public PowerInfo getPowerInfo()
- {
- return this.syncedPower;
- }
-
- public ProcessInfo getProcessInfo()
- {
- return this.syncedProcess;
- }
-
- public TankInfo getTankInfo(int tank)
- {
- return this.syncedTanks.containsKey(Integer.valueOf(tank)) ? (TankInfo)this.syncedTanks.get(Integer.valueOf(tank)) : new TankInfo();
- }
-
- public void onErrorUpdate(NBTTagCompound nbt)
- {
- this.errorType = nbt.getByte("type");
- if (nbt.hasKey("name"))
- {
- this.error = new ErrorState("", "");
- this.error.readFromNBT(nbt);
- }
- else
- {
- this.error = null;
- }
- }
-
- public ErrorState getErrorState()
- {
- return this.error;
- }
-
- public int getErrorType()
- {
- return this.errorType;
- }
-
- public CustomSlot[] getCustomSlots()
- {
- List<CustomSlot> slots = new ArrayList();
- for (Object object : this.inventorySlots) {
- if ((object instanceof CustomSlot)) {
- slots.add((CustomSlot)object);
- }
- }
- return (CustomSlot[])slots.toArray(new CustomSlot[0]);
- }
-
- private int mousedOverSlotNumber = -1;
-
- public void setMouseOverSlot(Slot slot)
- {
- if (slot.slotNumber != this.mousedOverSlotNumber)
- {
- this.mousedOverSlotNumber = slot.slotNumber;
- ((List)ControlSlot.highlighting.get(EnumHighlighting.ShiftClick)).clear();
- NBTTagCompound nbt = new NBTTagCompound();
- nbt.setShort("slot", (short)slot.slotNumber);
- this.window.sendClientAction("mouse-over-slot", nbt);
- }
- }
-
- private void onMouseOverSlot(EntityPlayer player, NBTTagCompound data)
- {
- int slotnumber = data.getShort("slot");
- TransferRequest request = getShiftClickRequest(player, slotnumber);
- if (request == null) {
- return;
- }
- request.transfer(false);
- NBTTagCompound nbt = new NBTTagCompound();
-
- List<Integer> slots = new ArrayList();
- for (TransferRequest.TransferSlot tslot : request.getInsertedSlots())
- {
- Slot slot = getSlot(tslot.inventory, tslot.id);
- if (slot != null) {
- slots.add(Integer.valueOf(slot.slotNumber));
- }
- }
- int[] array = new int[slots.size()];
- for (int i = 0; i < slots.size(); i++) {
- array[i] = ((Integer)slots.get(i)).intValue();
- }
- nbt.setIntArray("slots", array);
- nbt.setShort("origin", (short)slotnumber);
-
- this.syncedNBT.put("shift-click-info", nbt);
- }
-
- private void onRecieveShiftClickHighlights(EntityPlayer player, NBTTagCompound data)
- {
- ((List)ControlSlot.highlighting.get(EnumHighlighting.ShiftClick)).clear();
- for (int slotnumber : data.getIntArray("slots")) {
- ((List)ControlSlot.highlighting.get(EnumHighlighting.ShiftClick)).add(Integer.valueOf(slotnumber));
- }
- }
-
- private CustomSlot getSlot(IInventory inventory, int id)
- {
- for (Object o : this.inventorySlots)
- {
- CustomSlot slot = (CustomSlot)o;
- if ((slot.inventory == inventory) && (slot.getSlotIndex() == id)) {
- return slot;
- }
- }
- return null;
- }
-
- public void recieveNBT(Side side, EntityPlayer player, NBTTagCompound action)
- {
- String name = action.getString("type");
- if (handleNBT(side, player, name, action)) {
- return;
- }
- this.window.recieveGuiNBT(getSide(), player, name, action);
- INetwork.RecieveGuiNBT machine = (INetwork.RecieveGuiNBT)Machine.getInterface(INetwork.RecieveGuiNBT.class, this.window.getInventory());
- if (machine != null) {
- machine.recieveGuiNBT(getSide(), player, name, action);
- }
- }
-
- public Slot getOrCreateSlot(InventoryType type, int index)
- {
- IInventory inventory = getInventory(type);
- Slot slot = getSlot(inventory, index);
- if (slot == null)
- {
- slot = new CustomSlot(inventory, index);
- addSlotToContainer(slot);
- }
- NBTTagCompound nbt = new NBTTagCompound();
- nbt.setByte("t", (byte)type.ordinal());
- nbt.setShort("i", (short)index);
- nbt.setShort("n", (short)slot.slotNumber);
- this.window.sendClientAction("slot-reg", nbt);
- return slot;
- }
-
- protected IInventory getInventory(InventoryType type)
- {
- if (type == InventoryType.Machine) {
- return this.window.getInventory();
- }
- if (type == InventoryType.Player) {
- return this.window.getPlayer().inventory;
- }
- if (type == InventoryType.Window) {
- return this.window.getWindowInventory();
- }
- return null;
- }
-
- private Slot getOrCreateSlot(InventoryType type, int index, int slotNumber)
- {
- IInventory inventory = getInventory(type);
- if (this.inventorySlots.get(slotNumber) != null) {
- return null;
- }
- Slot slot = new CustomSlot(inventory, index);
- slot.slotNumber = slotNumber;
- this.inventorySlots.add(slotNumber, slot);
- this.inventoryItemStacks.add(slotNumber, (Object)null);
- return slot;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/CustomSlot.java b/src/Java/binnie/craftgui/minecraft/CustomSlot.java
deleted file mode 100644
index ae45ffb3fd..0000000000
--- a/src/Java/binnie/craftgui/minecraft/CustomSlot.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.inventory.IInventorySlots;
-import binnie.core.machines.inventory.InventorySlot;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class CustomSlot
- extends Slot
-{
- public boolean isItemValid(ItemStack par1ItemStack)
- {
- return this.inventory.isItemValidForSlot(getSlotIndex(), par1ItemStack);
- }
-
- public CustomSlot(IInventory inventory, int index)
- {
- super(inventory, index, 0, 0);
- }
-
- public InventorySlot getInventorySlot()
- {
- IInventorySlots slots = (IInventorySlots)Machine.getInterface(IInventorySlots.class, this.inventory);
- if (slots != null) {
- return slots.getSlot(getSlotIndex());
- }
- return null;
- }
-
- public boolean handleClick()
- {
- InventorySlot slot = getInventorySlot();
- return (slot != null) && (slot.isRecipe());
- }
-
- public void onSlotClick(ContainerCraftGUI container, int mouseButton, int modifier, EntityPlayer player)
- {
- ItemStack stack = player.inventory.getItemStack();
- if ((stack == null) || (mouseButton == 2))
- {
- putStack(null);
- }
- else
- {
- stack = stack.copy();
- stack.stackSize = 1;
- putStack(stack);
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/Dialog.java b/src/Java/binnie/craftgui/minecraft/Dialog.java
deleted file mode 100644
index efd67dec25..0000000000
--- a/src/Java/binnie/craftgui/minecraft/Dialog.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public abstract class Dialog
- extends Control
-{
- public Dialog(IWidget parent, float w, float h)
- {
- super(parent, (parent.w() - w) / 2.0F, (parent.h() - h) / 2.0F, w, h);
- addAttribute(Attribute.MouseOver);
- addAttribute(Attribute.AlwaysOnTop);
- addAttribute(Attribute.BlockTooltip);
- initialise();
- addEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- if (!Dialog.this.getArea().contains(Dialog.this.getRelativeMousePosition()))
- {
- Dialog.this.onClose();
- Dialog.this.getParent().deleteChild(Dialog.this);
- }
- }
- }.setOrigin(EventHandler.Origin.Any, this));
- }
-
- public abstract void initialise();
-
- public abstract void onClose();
-
- public void onRenderBackground()
- {
- CraftGUI.Render.gradientRect(getArea().outset(400), -1442840576, -1442840576);
- CraftGUI.Render.texture(CraftGUITexture.Window, getArea());
- CraftGUI.Render.texture(CraftGUITexture.TabOutline, getArea().inset(4));
- }
-
- public boolean isMouseOverWidget(IPoint relativeMouse)
- {
- return true;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/EnumColor.java b/src/Java/binnie/craftgui/minecraft/EnumColor.java
deleted file mode 100644
index e778cf31c8..0000000000
--- a/src/Java/binnie/craftgui/minecraft/EnumColor.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package binnie.craftgui.minecraft;
-
-public enum EnumColor
-{
- Black("Black", 0, '0'), DarkBlue("Dark Blue", 170, '1'), DarkGreen("Dark Green", 43520, '2'), DarkAqua("Dark Aqua", 43690, '3'), DarkRed("Dark Red", 11141120, '4'), Purple("Purple", 11141290, '5'), Gold("Gold", 16755200, '6'), Grey("Grey", 11184810, '7'), DarkGrey("Dark Grey", 5592405, '8'), Blue("Blue", 5592575, '9'), Green("Green", 5635925, 'a'), Aqua("Aqua", 5636095, 'b'), Red("Red", 16733525, 'c'), Pink("Pink", 16733695, 'd'), Yellow("Yellow", 16777045, 'e'), White("White", 16777215, 'f');
-
- int colour;
- String name;
- char code;
-
- private EnumColor(String name, int colour, char code)
- {
- this.name = name;
- this.colour = colour;
- this.code = code;
- }
-
- public int getColour()
- {
- return this.colour;
- }
-
- public String getCode()
- {
- return "§" + this.code;
- }
-
- public String toString()
- {
- return this.name;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/GUIIcon.java b/src/Java/binnie/craftgui/minecraft/GUIIcon.java
deleted file mode 100644
index 96338b2551..0000000000
--- a/src/Java/binnie/craftgui/minecraft/GUIIcon.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.Binnie;
-import binnie.core.BinnieCore;
-import binnie.core.resource.BinnieIcon;
-import binnie.core.resource.ManagerResource;
-import net.minecraft.util.IIcon;
-
-public enum GUIIcon
-{
- ArrowUp("arrow-up"), ArrowDown("arrow-down"), ArrowLeft("arrow-left"), ArrowRight("arrow-right"), ArrowUpLeft("arrow-upleft"), ArrowUpRight("arrow-upright"), ArrowRightUp("arrow-rightup"), ArrowRightDown("arrow-rightdown"), ArrowDownRight("arrow-downright"), ArrowDownLeft("arrow-downleft"), ArrowLeftDown("arrow-leftdown"), ArrowLeftUp("arrow-leftup");
-
- String path;
- BinnieIcon icon;
-
- private GUIIcon(String path)
- {
- this.path = path;
- }
-
- public void register()
- {
- this.icon = Binnie.Resource.getItemIcon(BinnieCore.instance, "gui/" + this.path);
- }
-
- public IIcon getIcon()
- {
- return this.icon.getIcon();
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/GuiCraftGUI.java b/src/Java/binnie/craftgui/minecraft/GuiCraftGUI.java
deleted file mode 100644
index bfd4a5f876..0000000000
--- a/src/Java/binnie/craftgui/minecraft/GuiCraftGUI.java
+++ /dev/null
@@ -1,605 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.core.BinnieCore;
-import binnie.core.proxy.BinnieProxy;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip.Type;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IBorder;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventKey.Down;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Up;
-import binnie.craftgui.events.EventMouse.Wheel;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.entity.EntityClientPlayerMP;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.OpenGlHelper;
-import net.minecraft.client.renderer.RenderHelper;
-import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.client.renderer.entity.RenderItem;
-import net.minecraft.client.settings.GameSettings;
-import net.minecraft.client.settings.KeyBinding;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.JsonToNBT;
-import net.minecraft.nbt.NBTException;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.GL11;
-
-@SideOnly(Side.CLIENT)
-public class GuiCraftGUI
- extends GuiContainer
-{
- IPoint mousePos = new IPoint(0.0F, 0.0F);
- private Window window;
- private ItemStack draggedItem;
-
- public void updateScreen()
- {
- this.window.updateClient();
- }
-
- public Minecraft getMinecraft()
- {
- return this.mc;
- }
-
- public GuiCraftGUI(Window window)
- {
- super(window.getContainer());
- this.window = window;
- resize(window.getSize());
- }
-
- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {}
-
- public void initGui()
- {
- super.initGui();
- this.mc.thePlayer.openContainer = this.inventorySlots;
- this.guiLeft = ((this.width - this.xSize) / 2);
- this.guiTop = ((this.height - this.ySize) / 2);
- this.window.setSize(new IPoint(this.xSize, this.ySize));
- this.window.setPosition(new IPoint(this.guiLeft, this.guiTop));
- this.window.initGui();
- }
-
- public ItemStack getDraggedItem()
- {
- return this.draggedItem;
- }
-
- public void drawScreen(int mouseX, int mouseY, float par3)
- {
- this.window.setMousePosition(mouseX - (int)this.window.getPosition().x(), mouseY - (int)this.window.getPosition().y());
-
-
- drawDefaultBackground();
-
-
- GL11.glDisable(32826);
- RenderHelper.disableStandardItemLighting();
- GL11.glDisable(2896);
- GL11.glDisable(2929);
-
- this.zLevel = 10.0F;
- itemRender.zLevel = this.zLevel;
-
- this.window.render();
-
-
- RenderHelper.enableGUIStandardItemLighting();
- GL11.glPushMatrix();
- GL11.glEnable(32826);
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
-
-
-
-
-
- InventoryPlayer playerInventory = this.mc.thePlayer.inventory;
- this.draggedItem = playerInventory.getItemStack();
- if (this.draggedItem != null)
- {
- renderItem(new IPoint(mouseX - 8, mouseY - 8), this.draggedItem, 200, false);
- renderItem(new IPoint(mouseX - 8, mouseY - 8), this.draggedItem, 200, false);
- }
- GL11.glDisable(32826);
- GL11.glPopMatrix();
-
-
-
-
-
- GL11.glDisable(2896);
- GL11.glDisable(2929);
-
-
- MinecraftTooltip tooltip = new MinecraftTooltip();
- if (isHelpMode())
- {
- tooltip.setType(Tooltip.Type.Help);
- this.window.getHelpTooltip(tooltip);
- }
- else
- {
- tooltip.setType(Tooltip.Type.Standard);
- this.window.getTooltip(tooltip);
- }
- if (tooltip.exists()) {
- renderTooltip(new IPoint(mouseX, mouseY), tooltip);
- }
- this.zLevel = 0.0F;
-
- GL11.glEnable(2896);
- GL11.glEnable(2929);
- }
-
- public void renderTooltip(IPoint mousePosition, MinecraftTooltip tooltip)
- {
- int mouseX = (int)mousePosition.x();
- int mouseY = (int)mousePosition.y();
- FontRenderer font = getFontRenderer();
- GL11.glDisable(32826);
- RenderHelper.disableStandardItemLighting();
- GL11.glDisable(2896);
- GL11.glDisable(2929);
- int k = 0;
-
- List<String> strings = new ArrayList();
- for (String string : tooltip.getList()) {
- if (string != null) {
- if (!string.contains("~~~")) {
- strings.addAll(font.listFormattedStringToWidth(string, tooltip.maxWidth));
- } else {
- strings.add(string);
- }
- }
- }
- Iterator iterator = strings.iterator();
- while (iterator.hasNext())
- {
- String s = (String)iterator.next();
- int l = font.getStringWidth(s);
- if (s.contains("~~~")) {
- l = 12 + font.getStringWidth(s.replaceAll("~~~(.*?)~~~", ""));
- }
- if (l > k) {
- k = l;
- }
- }
- int i1 = mouseX + 12;
- int j1 = mouseY - 12;
- int k1 = 8;
- if (strings.size() > 1) {
- k1 += 2 + (strings.size() - 1) * 10;
- }
- if (i1 + k > this.width) {
- i1 -= 28 + k;
- }
- if (j1 + k1 + 6 > this.height) {
- j1 = this.height - k1 - 6;
- }
- this.zLevel = 300.0F;
- itemRender.zLevel = 300.0F;
- int l1 = -267386864;
- int i2 = 1342177280 + MinecraftTooltip.getOutline(tooltip.getType());
- int j2 = i2;
- drawGradientRect(i1 - 3, j1 - 4, i1 + k + 3, j1 - 3, l1, l1);
- drawGradientRect(i1 - 3, j1 + k1 + 3, i1 + k + 3, j1 + k1 + 4, l1, l1);
- drawGradientRect(i1 - 3, j1 - 3, i1 + k + 3, j1 + k1 + 3, l1, l1);
- drawGradientRect(i1 - 4, j1 - 3, i1 - 3, j1 + k1 + 3, l1, l1);
- drawGradientRect(i1 + k + 3, j1 - 3, i1 + k + 4, j1 + k1 + 3, l1, l1);
-
- drawGradientRect(i1 - 3, j1 - 3 + 1, i1 - 3 + 1, j1 + k1 + 3 - 1, i2, j2);
- drawGradientRect(i1 + k + 2, j1 - 3 + 1, i1 + k + 3, j1 + k1 + 3 - 1, i2, j2);
- drawGradientRect(i1 - 3, j1 - 3, i1 + k + 3, j1 - 3 + 1, i2, i2);
- drawGradientRect(i1 - 3, j1 + k1 + 2, i1 + k + 3, j1 + k1 + 3, j2, j2);
- for (int k2 = 0; k2 < strings.size(); k2++)
- {
- String s1 = (String)strings.get(k2);
- if (k2 == 0) {
- s1 = MinecraftTooltip.getTitle(tooltip.getType()) + s1;
- } else {
- s1 = MinecraftTooltip.getBody(tooltip.getType()) + s1;
- }
- if (s1.contains("~~~"))
- {
- String split = s1.split("~~~")[1];
- try
- {
- NBTTagCompound nbt = (NBTTagCompound)JsonToNBT.func_150315_a(split);
- ItemStack stack = ItemStack.loadItemStackFromNBT(nbt);
- GL11.glPushMatrix();
- GL11.glTranslatef(i1, j1 - 1.5F, 0.0F);
- GL11.glScalef(0.6F, 0.6F, 1.0F);
- renderItem(new IPoint(0.0F, 0.0F), stack, false);
- GL11.glPopMatrix();
- }
- catch (NBTException e)
- {
- e.printStackTrace();
- }
- s1 = " " + s1.replaceAll("~~~(.*?)~~~", "");
- }
- font.drawStringWithShadow(s1, i1, j1, -1);
- if (k2 == 0) {
- j1 += 2;
- }
- j1 += 10;
- }
- this.zLevel = 0.0F;
- itemRender.zLevel = 0.0F;
- GL11.glEnable(2896);
- GL11.glEnable(2929);
- RenderHelper.enableStandardItemLighting();
- GL11.glEnable(32826);
- }
-
- protected void mouseClicked(int x, int y, int button)
- {
- IWidget origin = this.window;
- if (this.window.getMousedOverWidget() != null) {
- origin = this.window.getMousedOverWidget();
- }
- this.window.callEvent(new EventMouse.Down(origin, x, y, button));
- }
-
- public boolean isShiftDown()
- {
- return Keyboard.isKeyDown(this.mc.gameSettings.keyBindSneak.getKeyCode());
- }
-
- protected void keyTyped(char c, int key)
- {
- if ((key == 1) || ((key == this.mc.gameSettings.keyBindInventory.getKeyCode()) && (this.window.getFocusedWidget() == null))) {
- this.mc.thePlayer.closeScreen();
- }
- IWidget origin = this.window.getFocusedWidget() == null ? this.window : this.window.getFocusedWidget();
-
- this.window.callEvent(new EventKey.Down(origin, c, key));
- }
-
- protected void mouseMovedOrUp(int x, int y, int button)
- {
- IWidget origin = this.window.getMousedOverWidget() == null ? this.window : this.window.getMousedOverWidget();
- float dy;
- if (button == -1)
- {
- float dx = Mouse.getEventDX() * this.width / this.mc.displayWidth;
- dy = -(Mouse.getEventDY() * this.height / this.mc.displayHeight);
- }
- else
- {
- this.window.callEvent(new EventMouse.Up(origin, x, y, button));
- }
- }
-
- public void handleMouseInput()
- {
- super.handleMouseInput();
- int dWheel = Mouse.getDWheel();
- IWidget origin = this.window.getFocusedWidget() == null ? this.window : this.window.getFocusedWidget();
- if (dWheel != 0) {
- this.window.callEvent(new EventMouse.Wheel(this.window, dWheel));
- }
- }
-
- public void onGuiClosed()
- {
- this.window.onClose();
- }
-
- public void renderTexturedRect(float x, float y, float u, float v, float w, float h)
- {
- drawTexturedModalRect((int)x, (int)y, (int)u, (int)v, (int)w, (int)h);
- }
-
- public void renderTexture(IPoint position, IArea textureArea)
- {
- drawTexturedModalRect((int)position.x(), (int)position.y(), (int)textureArea.pos().x(), (int)textureArea.pos().y(), (int)textureArea.size().x(), (int)textureArea.size().y());
- }
-
- private void renderTexturedRect(IArea area, IPoint uv)
- {
- renderTexturedRect(area.pos().x(), area.pos().y(), uv.x(), uv.y(), area.size().x(), area.size().y());
- }
-
- public void renderTexturePadded(IArea area, IArea texture, IBorder padding)
- {
- int borderLeft = (int)padding.l();
- int borderRight = (int)padding.r();
- int borderTop = (int)padding.t();
- int borderBottom = (int)padding.b();
-
- int posX = (int)area.pos().x();
- int posY = (int)area.pos().y();
- int width = (int)area.size().x();
- int height = (int)area.size().y();
-
- int textWidth = (int)texture.w();
- int textHeight = (int)texture.h();
-
- int u = (int)texture.x();
- int v = (int)texture.y();
- if (borderTop + borderBottom > height)
- {
- borderTop = height / 2;
- borderBottom = height / 2;
- }
- if (borderLeft + borderRight > width)
- {
- borderLeft = width / 2;
- borderRight = width / 2;
- }
- IPoint origin = area.pos();
-
- drawTexturedModalRect(posX, posY, u, v, borderLeft, borderTop);
-
-
- drawTexturedModalRect(posX + width - borderRight, posY, u + textWidth - borderRight, v, borderRight, borderTop);
-
-
- drawTexturedModalRect(posX, posY + height - borderBottom, u, v + textHeight - borderBottom, borderLeft, borderBottom);
-
-
- drawTexturedModalRect(posX + width - borderRight, posY + height - borderBottom, u + textWidth - borderRight, v + textHeight - borderBottom, borderRight, borderBottom);
-
-
-
- int currentXPos = borderLeft;
- while (currentXPos < width - borderRight)
- {
- int distanceXRemaining = width - borderRight - currentXPos;
-
-
- int texturingWidth = textWidth - borderLeft - borderRight;
- if (texturingWidth > distanceXRemaining) {
- texturingWidth = distanceXRemaining;
- }
- if (texturingWidth <= 0) {
- break;
- }
- drawTexturedModalRect(posX + currentXPos, posY, u + borderLeft, v, texturingWidth, borderTop);
-
- drawTexturedModalRect(posX + currentXPos, posY + height - borderBottom, u + borderLeft, v + textHeight - borderBottom, texturingWidth, borderBottom);
-
-
- int currentYPos = borderTop;
- while (currentYPos < height - borderBottom)
- {
- int distanceYRemaining = height - borderBottom - currentYPos;
-
-
- int texturingHeight = textHeight - borderTop - borderBottom;
- if (texturingHeight > distanceYRemaining) {
- texturingHeight = distanceYRemaining;
- }
- if (texturingHeight <= 0) {
- break;
- }
- drawTexturedModalRect(posX + currentXPos, posY + currentYPos, u + borderLeft, v + borderTop, texturingWidth, texturingHeight);
-
- currentYPos += texturingHeight;
- }
- currentXPos += texturingWidth;
- }
- int currentYPos = borderTop;
- while (currentYPos < height - borderBottom)
- {
- int distanceYRemaining = height - borderBottom - currentYPos;
-
-
- int texturingHeight = textHeight - borderTop - borderBottom;
- if (texturingHeight > distanceYRemaining) {
- texturingHeight = distanceYRemaining;
- }
- if (texturingHeight <= 0) {
- break;
- }
- drawTexturedModalRect(posX, posY + currentYPos, u, v + borderTop, borderLeft, texturingHeight);
-
- drawTexturedModalRect(posX + width - borderRight, posY + currentYPos, u + textWidth - borderRight, v + borderTop, borderRight, texturingHeight);
- currentYPos += texturingHeight;
- }
- }
-
- public void drawGradientArea(float p_73733_1_, float p_73733_2_, float p_73733_3_, float p_73733_4_, int p_73733_5_, int p_73733_6_)
- {
- float f = (p_73733_5_ >> 24 & 0xFF) / 255.0F;
- float f1 = (p_73733_5_ >> 16 & 0xFF) / 255.0F;
- float f2 = (p_73733_5_ >> 8 & 0xFF) / 255.0F;
- float f3 = (p_73733_5_ & 0xFF) / 255.0F;
- float f4 = (p_73733_6_ >> 24 & 0xFF) / 255.0F;
- float f5 = (p_73733_6_ >> 16 & 0xFF) / 255.0F;
- float f6 = (p_73733_6_ >> 8 & 0xFF) / 255.0F;
- float f7 = (p_73733_6_ & 0xFF) / 255.0F;
- GL11.glDisable(3553);
- GL11.glEnable(3042);
- GL11.glDisable(3008);
- OpenGlHelper.glBlendFunc(770, 771, 1, 0);
- GL11.glShadeModel(7425);
- Tessellator tessellator = Tessellator.instance;
- tessellator.startDrawingQuads();
- tessellator.setColorRGBA_F(f1, f2, f3, f);
- tessellator.addVertex(p_73733_3_, p_73733_2_, this.zLevel);
- tessellator.addVertex(p_73733_1_, p_73733_2_, this.zLevel);
- tessellator.setColorRGBA_F(f5, f6, f7, f4);
- tessellator.addVertex(p_73733_1_, p_73733_4_, this.zLevel);
- tessellator.addVertex(p_73733_3_, p_73733_4_, this.zLevel);
- tessellator.draw();
- GL11.glShadeModel(7424);
- GL11.glDisable(3042);
- GL11.glEnable(3008);
- GL11.glEnable(3553);
- }
-
- public void renderItem(IPoint pos, ItemStack item, boolean rotating)
- {
- renderItem(pos, item, (int)this.zLevel + 3, rotating);
- }
-
- private void renderItem(IPoint pos, ItemStack item, int zLevel, boolean rotating)
- {
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
-
- GL11.glPushMatrix();
-
- RenderHelper.enableGUIStandardItemLighting();
- GL11.glEnable(32826);
- GL11.glEnable(2929);
-
-
-
-
-
-
-
- FontRenderer font = item.getItem().getFontRenderer(item);
- if (font == null) {
- font = getFontRenderer();
- }
- if (item != null)
- {
- BinnieCore.proxy.getMinecraftInstance();float phase = (float)Minecraft.getSystemTime() / 20.0F;
-
- GL11.glPushMatrix();
- if (rotating)
- {
- GL11.glTranslatef(8.0F, 8.0F, 0.0F);
- GL11.glRotatef(phase, 0.0F, -0.866F, 0.5F);
- GL11.glTranslatef(-8.0F, -8.0F, -67.099998F);
- }
- itemRender.renderItemAndEffectIntoGUI(font, this.mc.renderEngine, item, (int)pos.x(), (int)pos.y());
- GL11.glPopMatrix();
- itemRender.renderItemOverlayIntoGUI(font, this.mc.renderEngine, item, (int)pos.x(), (int)pos.y(), null);
- }
- GL11.glClear(256);
- GL11.glEnable(3042);
-
- OpenGlHelper.glBlendFunc(770, 771, 1, 0);
-
-
- RenderHelper.disableStandardItemLighting();
-
- CraftGUI.Render.colour(-1);
-
- GL11.glEnable(32826);
- GL11.glPopMatrix();
- }
-
- public void renderIcon(IPoint pos, IIcon icon, ResourceLocation map)
- {
- if (icon == null) {
- return;
- }
- GL11.glPushMatrix();
- GL11.glEnable(32826);
-
-
- BinnieCore.proxy.bindTexture(map);
-
-
- itemRender.zLevel = this.zLevel;
-
- itemRender.renderIcon((int)pos.x(), (int)pos.y(), icon, 16, 16);
-
-
-
- GL11.glEnable(32826);
- GL11.glPopMatrix();
- }
-
- public boolean isHelpMode()
- {
- return Keyboard.isKeyDown(15);
- }
-
- public FontRenderer getFontRenderer()
- {
- return this.fontRendererObj;
- }
-
- public void resize(IPoint size)
- {
- this.xSize = ((int)size.x());
- this.ySize = ((int)size.y());
- this.guiLeft = ((this.width - this.xSize) / 2);
- this.guiTop = ((this.height - this.ySize) / 2);
- this.window.setPosition(new IPoint(this.guiLeft, this.guiTop));
- }
-
- public void limitArea(IArea area)
- {
- float x = area.pos().x();
- float y = area.pos().y();
- float w = area.size().x();
- float h = area.size().y();
-
- y = this.height - (y + h);
- float k = this.xSize;
- float scaleX = this.width / this.mc.displayWidth;
- float scaleY = this.height / this.mc.displayHeight;
-
- x += 0.0F;
- y += 0.0F;
- w += 0.0F;
- h += 0.0F;
-
-
-
- GL11.glScissor((int)(x / scaleX), (int)(y / scaleY), (int)(w / scaleX), (int)(h / scaleY));
- }
-
- public int getZLevel()
- {
- return (int)this.zLevel;
- }
-
- public void drawRect(float p_73734_0_, float p_73734_1_, float p_73734_2_, float p_73734_3_, int p_73734_4_)
- {
- if (p_73734_0_ < p_73734_2_)
- {
- float j1 = p_73734_0_;
- p_73734_0_ = p_73734_2_;
- p_73734_2_ = j1;
- }
- if (p_73734_1_ < p_73734_3_)
- {
- float j1 = p_73734_1_;
- p_73734_1_ = p_73734_3_;
- p_73734_3_ = j1;
- }
- float f3 = (p_73734_4_ >> 24 & 0xFF) / 255.0F;
- float f = (p_73734_4_ >> 16 & 0xFF) / 255.0F;
- float f1 = (p_73734_4_ >> 8 & 0xFF) / 255.0F;
- float f2 = (p_73734_4_ & 0xFF) / 255.0F;
- Tessellator tessellator = Tessellator.instance;
- GL11.glEnable(3042);
- GL11.glDisable(3553);
- OpenGlHelper.glBlendFunc(770, 771, 1, 0);
- GL11.glColor4f(f, f1, f2, f3);
- tessellator.startDrawingQuads();
- tessellator.addVertex(p_73734_0_, p_73734_3_, 0.0D);
- tessellator.addVertex(p_73734_2_, p_73734_3_, 0.0D);
- tessellator.addVertex(p_73734_2_, p_73734_1_, 0.0D);
- tessellator.addVertex(p_73734_0_, p_73734_1_, 0.0D);
- tessellator.draw();
- GL11.glEnable(3553);
- GL11.glDisable(3042);
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/IMachineInformation.java b/src/Java/binnie/craftgui/minecraft/IMachineInformation.java
deleted file mode 100644
index cd709bbf8a..0000000000
--- a/src/Java/binnie/craftgui/minecraft/IMachineInformation.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package binnie.craftgui.minecraft;
-
-public abstract interface IMachineInformation
-{
- public abstract String getInformation();
-}
diff --git a/src/Java/binnie/craftgui/minecraft/IMinecraftTooltip.java b/src/Java/binnie/craftgui/minecraft/IMinecraftTooltip.java
deleted file mode 100644
index 5bdec6e4ae..0000000000
--- a/src/Java/binnie/craftgui/minecraft/IMinecraftTooltip.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.craftgui.core.ITooltip;
-
-public abstract interface IMinecraftTooltip
- extends ITooltip
-{
- public abstract void getTooltip(MinecraftTooltip paramMinecraftTooltip);
-}
diff --git a/src/Java/binnie/craftgui/minecraft/IWindowAffectsShiftClick.java b/src/Java/binnie/craftgui/minecraft/IWindowAffectsShiftClick.java
deleted file mode 100644
index ced88aa028..0000000000
--- a/src/Java/binnie/craftgui/minecraft/IWindowAffectsShiftClick.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.core.machines.transfer.TransferRequest;
-
-public abstract interface IWindowAffectsShiftClick
-{
- public abstract void alterRequest(TransferRequest paramTransferRequest);
-}
diff --git a/src/Java/binnie/craftgui/minecraft/InventoryType.java b/src/Java/binnie/craftgui/minecraft/InventoryType.java
deleted file mode 100644
index f10a065a99..0000000000
--- a/src/Java/binnie/craftgui/minecraft/InventoryType.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.craftgui.minecraft;
-
-public enum InventoryType
-{
- Player, Machine, Window, Custom;
-
- private InventoryType() {}
-}
diff --git a/src/Java/binnie/craftgui/minecraft/ListMap.java b/src/Java/binnie/craftgui/minecraft/ListMap.java
deleted file mode 100644
index 7c0fbf37dd..0000000000
--- a/src/Java/binnie/craftgui/minecraft/ListMap.java
+++ /dev/null
@@ -1,149 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map.Entry;
-import java.util.Set;
-
-class ListMap<T>
- implements List<T>
-{
- private LinkedHashMap<Integer, T> map = new LinkedHashMap();
-
- public int size()
- {
- int i = -1;
- for (Iterator i$ = this.map.keySet().iterator(); i$.hasNext();)
- {
- int k = ((Integer)i$.next()).intValue();
- if (k > i) {
- i = k;
- }
- }
- return i + 1;
- }
-
- public boolean isEmpty()
- {
- return this.map.isEmpty();
- }
-
- public boolean contains(Object o)
- {
- return this.map.containsValue(o);
- }
-
- public Iterator<T> iterator()
- {
- return this.map.values().iterator();
- }
-
- public Object[] toArray()
- {
- return this.map.values().toArray();
- }
-
- public <P> P[] toArray(P[] a)
- {
- return this.map.values().toArray(a);
- }
-
- public boolean add(T e)
- {
- if (get(size()) == null)
- {
- add(size(), e);
- return true;
- }
- return false;
- }
-
- public boolean remove(Object o)
- {
- return false;
- }
-
- public boolean containsAll(Collection<?> c)
- {
- return this.map.values().containsAll(c);
- }
-
- public boolean addAll(Collection<? extends T> c)
- {
- return false;
- }
-
- public boolean addAll(int index, Collection<? extends T> c)
- {
- return false;
- }
-
- public boolean removeAll(Collection<?> c)
- {
- return false;
- }
-
- public boolean retainAll(Collection<?> c)
- {
- return false;
- }
-
- public void clear()
- {
- this.map.clear();
- }
-
- public T get(int index)
- {
- return this.map.get(Integer.valueOf(index));
- }
-
- public T set(int index, T element)
- {
- this.map.put(Integer.valueOf(index), element);
- return element;
- }
-
- public void add(int index, T element)
- {
- this.map.put(Integer.valueOf(index), element);
- }
-
- public T remove(int index)
- {
- return null;
- }
-
- public int indexOf(Object o)
- {
- for (Map.Entry<Integer, T> entry : this.map.entrySet()) {
- if (entry.getValue() == o) {
- return ((Integer)entry.getKey()).intValue();
- }
- }
- return 0;
- }
-
- public int lastIndexOf(Object o)
- {
- return indexOf(o);
- }
-
- public ListIterator<T> listIterator()
- {
- return null;
- }
-
- public ListIterator<T> listIterator(int index)
- {
- return null;
- }
-
- public List<T> subList(int fromIndex, int toIndex)
- {
- return null;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/MinecraftGUI.java b/src/Java/binnie/craftgui/minecraft/MinecraftGUI.java
deleted file mode 100644
index a87b4deeb8..0000000000
--- a/src/Java/binnie/craftgui/minecraft/MinecraftGUI.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.craftgui.window.Panel.IPanelType;
-
-public class MinecraftGUI
-{
- public static enum PanelType
- implements Panel.IPanelType
- {
- Black, Gray, Tinted, Coloured, Outline, TabOutline;
-
- private PanelType() {}
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/MinecraftTooltip.java b/src/Java/binnie/craftgui/minecraft/MinecraftTooltip.java
deleted file mode 100644
index 4b48e33e6d..0000000000
--- a/src/Java/binnie/craftgui/minecraft/MinecraftTooltip.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.Tooltip.ITooltipType;
-import net.minecraft.util.EnumChatFormatting;
-
-public class MinecraftTooltip
- extends Tooltip
-{
- public static enum Type
- implements Tooltip.ITooltipType
- {
- Error, Warning;
-
- private Type() {}
- }
-
- public static int getOutline(Tooltip.ITooltipType type)
- {
- return TypeColour.valueOf(type.toString()).getOutline();
- }
-
- public static String getTitle(Tooltip.ITooltipType type)
- {
- return TypeColour.valueOf(type.toString()).getTitle();
- }
-
- public static String getBody(Tooltip.ITooltipType type)
- {
- return TypeColour.valueOf(type.toString()).getBody();
- }
-
- private static enum TypeColour
- {
- Standard(5243135, EnumChatFormatting.WHITE, EnumChatFormatting.GRAY), Help(5046016, EnumChatFormatting.GREEN, EnumChatFormatting.DARK_GREEN), Information(49151, EnumChatFormatting.AQUA, EnumChatFormatting.DARK_AQUA), Error(16724224, EnumChatFormatting.RED, EnumChatFormatting.DARK_RED), Warning(16752384, EnumChatFormatting.YELLOW, EnumChatFormatting.GOLD), User(9839667, EnumChatFormatting.RED, EnumChatFormatting.DARK_RED), Power(9006592, EnumChatFormatting.YELLOW, EnumChatFormatting.GOLD);
-
- int outline;
- String mainText;
- String bodyText;
-
- private TypeColour(int outline, EnumChatFormatting mainText, EnumChatFormatting bodyText)
- {
- this.outline = outline;
- this.mainText = mainText.toString();
- this.bodyText = bodyText.toString();
- }
-
- public int getOutline()
- {
- return this.outline;
- }
-
- public String getTitle()
- {
- return this.mainText;
- }
-
- public String getBody()
- {
- return this.bodyText;
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/ModuleCraftGUI.java b/src/Java/binnie/craftgui/minecraft/ModuleCraftGUI.java
deleted file mode 100644
index d2655dc2fc..0000000000
--- a/src/Java/binnie/craftgui/minecraft/ModuleCraftGUI.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.core.IInitializable;
-
-public class ModuleCraftGUI
- implements IInitializable
-{
- public void preInit() {}
-
- public void init() {}
-
- public void postInit()
- {
- for (GUIIcon icon : ) {
- icon.register();
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/Window.java b/src/Java/binnie/craftgui/minecraft/Window.java
deleted file mode 100644
index e09cf1e376..0000000000
--- a/src/Java/binnie/craftgui/minecraft/Window.java
+++ /dev/null
@@ -1,338 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.machines.Machine;
-import binnie.core.machines.inventory.IInventoryMachine;
-import binnie.core.machines.network.INetwork.RecieveGuiNBT;
-import binnie.core.machines.power.PowerSystem;
-import binnie.core.network.packet.MessageCraftGUI;
-import binnie.core.proxy.BinnieProxy;
-import binnie.core.resource.BinnieResource;
-import binnie.core.resource.ManagerResource;
-import binnie.core.resource.ResourceType;
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.ControlTextCentered;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.ITooltipHelp;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.TopLevelWidget;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventWidget.ChangeSize;
-import binnie.craftgui.events.EventWidget.ChangeSize.Handler;
-import binnie.craftgui.minecraft.control.ControlHelp;
-import binnie.craftgui.minecraft.control.ControlInfo;
-import binnie.craftgui.minecraft.control.ControlPowerSystem;
-import binnie.craftgui.minecraft.control.ControlSlot;
-import binnie.craftgui.minecraft.control.ControlUser;
-import binnie.craftgui.minecraft.control.EnumHighlighting;
-import binnie.craftgui.resource.StyleSheetManager;
-import binnie.craftgui.resource.Texture;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import binnie.craftgui.resource.minecraft.StandardTexture;
-import com.mojang.authlib.GameProfile;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.ArrayList;
-import java.util.Deque;
-import java.util.List;
-import java.util.Map;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
-
-public abstract class Window
- extends TopLevelWidget
- implements INetwork.RecieveGuiNBT
-{
- private GuiCraftGUI gui;
- private ContainerCraftGUI container;
- private WindowInventory windowInventory;
- private ControlText title;
-
- public void getTooltip(Tooltip tooltip)
- {
- Deque<IWidget> queue = calculateMousedOverWidgets();
- while (!queue.isEmpty())
- {
- IWidget widget = (IWidget)queue.removeFirst();
- if ((widget.isEnabled()) && (widget.isVisible()) && (widget.calculateIsMouseOver()))
- {
- if ((widget instanceof ITooltip))
- {
- ((ITooltip)widget).getTooltip(tooltip);
- if (tooltip.exists()) {
- return;
- }
- }
- if (widget.hasAttribute(Attribute.BlockTooltip)) {
- return;
- }
- }
- }
- }
-
- public void getHelpTooltip(MinecraftTooltip tooltip)
- {
- Deque<IWidget> queue = calculateMousedOverWidgets();
- while (!queue.isEmpty())
- {
- IWidget widget = (IWidget)queue.removeFirst();
- if ((widget.isEnabled()) && (widget.isVisible()) && (widget.calculateIsMouseOver()))
- {
- if ((widget instanceof ITooltipHelp))
- {
- ((ITooltipHelp)widget).getHelpTooltip(tooltip);
- if (tooltip.exists()) {
- return;
- }
- }
- if (widget.hasAttribute(Attribute.BlockTooltip)) {
- return;
- }
- }
- }
- }
-
- protected abstract AbstractMod getMod();
-
- protected abstract String getName();
-
- public BinnieResource getBackgroundTextureFile(int i)
- {
- return Binnie.Resource.getPNG(getMod(), ResourceType.GUI, getName() + (i == 1 ? "" : Integer.valueOf(i)));
- }
-
- public boolean showHelpButton()
- {
- return Machine.getInterface(IInventoryMachine.class, getInventory()) != null;
- }
-
- public String showInfoButton()
- {
- if (Machine.getInterface(IMachineInformation.class, getInventory()) != null) {
- return ((IMachineInformation)Machine.getInterface(IMachineInformation.class, getInventory())).getInformation();
- }
- return null;
- }
-
- public Window(float width, float height, EntityPlayer player, IInventory inventory, Side side)
- {
- this.side = side;
- setInventories(player, inventory);
- this.container = new ContainerCraftGUI(this);
- this.windowInventory = new WindowInventory(this);
- if (side == Side.SERVER) {
- return;
- }
- setSize(new IPoint(width, height));
- this.gui = new GuiCraftGUI(this);
- for (EnumHighlighting h : EnumHighlighting.values()) {
- ControlSlot.highlighting.put(h, new ArrayList());
- }
- CraftGUI.Render = new Renderer(this.gui);
- CraftGUI.Render.stylesheet(StyleSheetManager.getDefault());
-
- this.titleButtonLeft = -14.0F;
- if (showHelpButton()) {
- new ControlHelp(this, this.titleButtonLeft += 22.0F, 8.0F);
- }
- if (showInfoButton() != null) {
- new ControlInfo(this, this.titleButtonLeft += 22.0F, 8.0F, showInfoButton());
- }
- Window wind = this;
-
- addSelfEventHandler(new EventWidget.ChangeSize.Handler()
- {
- public void onEvent(EventWidget.ChangeSize event)
- {
- if ((Window.this.isClient()) && (Window.this.getGui() != null))
- {
- Window.this.getGui().resize(Window.this.getSize());
- if (Window.this.title != null) {
- Window.this.title.setSize(new IPoint(Window.this.w(), Window.this.title.h()));
- }
- }
- }
- });
- }
-
- protected float titleButtonLeft = 8.0F;
- protected float titleButtonRight = 8.0F;
-
- public void setTitle(String title)
- {
- this.title = new ControlTextCentered(this, 12.0F, title);
- this.title.setColour(4210752);
- }
-
- @SideOnly(Side.CLIENT)
- public final GuiCraftGUI getGui()
- {
- return this.gui;
- }
-
- public final ContainerCraftGUI getContainer()
- {
- return this.container;
- }
-
- public final WindowInventory getWindowInventory()
- {
- return this.windowInventory;
- }
-
- private StandardTexture bgText1 = null;
- private StandardTexture bgText2 = null;
- private boolean hasBeenInitialised = false;
- private EntityPlayer player;
- private IInventory entityInventory;
-
- public final void initGui()
- {
- if (this.hasBeenInitialised) {
- return;
- }
- this.bgText1 = new StandardTexture(0, 0, 256, 256, getBackgroundTextureFile(1));
- if (getSize().x() > 256.0F) {
- this.bgText2 = new StandardTexture(0, 0, 256, 256, getBackgroundTextureFile(2));
- }
- if (!BinnieCore.proxy.checkTexture(this.bgText1.getTexture()))
- {
- this.bgText1 = null;
- this.bgText2 = null;
- }
- initialiseClient();
- this.hasBeenInitialised = true;
- }
-
- public abstract void initialiseClient();
-
- public void initialiseServer() {}
-
- public void onRenderBackground()
- {
- CraftGUI.Render.colour(16777215);
- if (getBackground1() != null) {
- CraftGUI.Render.texture(getBackground1(), IPoint.ZERO);
- }
- if (getBackground2() != null) {
- CraftGUI.Render.texture(getBackground2(), new IPoint(256.0F, 0.0F));
- }
- CraftGUI.Render.colour(getColour());
- CraftGUI.Render.texture(CraftGUITexture.Window, getArea());
- }
-
- public void onUpdateClient()
- {
- ((List)ControlSlot.highlighting.get(EnumHighlighting.Help)).clear();
-
- ControlSlot.shiftClickActive = false;
- }
-
- public EntityPlayer getPlayer()
- {
- return this.player;
- }
-
- public GameProfile getUsername()
- {
- return getPlayer().getGameProfile();
- }
-
- public ItemStack getHeldItemStack()
- {
- if (this.player != null) {
- return this.player.inventory.getItemStack();
- }
- return null;
- }
-
- public IInventory getInventory()
- {
- return this.entityInventory;
- }
-
- public void setInventories(EntityPlayer player2, IInventory inventory)
- {
- this.player = player2;
- this.entityInventory = inventory;
- }
-
- public void onClose() {}
-
- public void setHeldItemStack(ItemStack stack)
- {
- if (this.player != null) {
- this.player.inventory.setItemStack(stack);
- }
- }
-
- private Side side = Side.CLIENT;
-
- public boolean isServer()
- {
- return !isClient();
- }
-
- public boolean isClient()
- {
- return this.side == Side.CLIENT;
- }
-
- public World getWorld()
- {
- if (getPlayer() != null) {
- return getPlayer().worldObj;
- }
- return BinnieCore.proxy.getWorld();
- }
-
- public void onInventoryUpdate() {}
-
- public void sendClientAction(String name, NBTTagCompound action)
- {
- action.setString("type", name);
- MessageCraftGUI packet = new MessageCraftGUI(action);
- BinnieCore.proxy.sendToServer(packet);
- }
-
- public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound action)
- {
- if ((side == Side.CLIENT) && (name.equals("username")))
- {
- new ControlUser(this, w() - (this.titleButtonRight += 16.0F), 8.0F, action.getString("username"));
- this.titleButtonRight += 6.0F;
- }
- if ((side == Side.CLIENT) && (name.equals("power-system")))
- {
- new ControlPowerSystem(this, w() - (this.titleButtonRight += 16.0F), 8.0F, PowerSystem.get(action.getByte("system")));
- this.titleButtonRight += 6.0F;
- }
- }
-
- public void onWindowInventoryChanged() {}
-
- public Texture getBackground1()
- {
- return this.bgText1;
- }
-
- public Texture getBackground2()
- {
- return this.bgText2;
- }
-
- public static <T extends Window> T get(IWidget widget)
- {
- return (Window)widget.getSuperParent();
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/WindowInventory.java b/src/Java/binnie/craftgui/minecraft/WindowInventory.java
deleted file mode 100644
index 9c38bf1a9b..0000000000
--- a/src/Java/binnie/craftgui/minecraft/WindowInventory.java
+++ /dev/null
@@ -1,144 +0,0 @@
-package binnie.craftgui.minecraft;
-
-import binnie.core.machines.inventory.SlotValidator;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-
-public class WindowInventory
- implements IInventory
-{
- private Window window;
-
- public WindowInventory(Window window)
- {
- this.window = window;
- }
-
- private Map<Integer, ItemStack> inventory = new HashMap();
- private Map<Integer, SlotValidator> validators = new HashMap();
- private List<Integer> disabledAutoDispenses = new ArrayList();
-
- public int getSizeInventory()
- {
- if (this.inventory.size() == 0) {
- return 0;
- }
- int max = 0;
- for (Iterator i$ = this.inventory.keySet().iterator(); i$.hasNext();)
- {
- int i = ((Integer)i$.next()).intValue();
- if (i > max) {
- max = i;
- }
- }
- return max + 1;
- }
-
- public ItemStack getStackInSlot(int var1)
- {
- if (this.inventory.containsKey(Integer.valueOf(var1))) {
- return (ItemStack)this.inventory.get(Integer.valueOf(var1));
- }
- return null;
- }
-
- public ItemStack decrStackSize(int index, int amount)
- {
- if (this.inventory.containsKey(Integer.valueOf(index)))
- {
- ItemStack item = (ItemStack)this.inventory.get(Integer.valueOf(index));
- ItemStack output = item.copy();
- int available = item.stackSize;
- if (amount > available) {
- amount = available;
- }
- item.stackSize -= amount;
- output.stackSize = amount;
- if (item.stackSize == 0) {
- setInventorySlotContents(index, null);
- }
- return output;
- }
- return null;
- }
-
- public ItemStack getStackInSlotOnClosing(int var1)
- {
- return null;
- }
-
- public void setInventorySlotContents(int var1, ItemStack var2)
- {
- this.inventory.put(Integer.valueOf(var1), var2);
- markDirty();
- }
-
- public String getInventoryName()
- {
- return "window.inventory";
- }
-
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- public void markDirty()
- {
- this.window.onWindowInventoryChanged();
- }
-
- public boolean isUseableByPlayer(EntityPlayer var1)
- {
- return true;
- }
-
- public void openInventory() {}
-
- public void closeInventory() {}
-
- public boolean hasCustomInventoryName()
- {
- return false;
- }
-
- public boolean isItemValidForSlot(int i, ItemStack itemstack)
- {
- if (this.validators.containsKey(Integer.valueOf(i))) {
- return ((SlotValidator)this.validators.get(Integer.valueOf(i))).isValid(itemstack);
- }
- return true;
- }
-
- public void createSlot(int slot)
- {
- this.inventory.put(Integer.valueOf(slot), null);
- }
-
- public void setValidator(int slot, SlotValidator validator)
- {
- this.validators.put(Integer.valueOf(slot), validator);
- }
-
- public void disableAutoDispense(int i)
- {
- this.disabledAutoDispenses.add(Integer.valueOf(i));
- }
-
- public boolean dispenseOnClose(int i)
- {
- return !this.disabledAutoDispenses.contains(Integer.valueOf(i));
- }
-
- public SlotValidator getValidator(int i)
- {
- return (SlotValidator)this.validators.get(Integer.valueOf(i));
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlEnergyBar.java b/src/Java/binnie/craftgui/minecraft/control/ControlEnergyBar.java
deleted file mode 100644
index 0337b154c1..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlEnergyBar.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.TileEntityMachine;
-import binnie.core.machines.power.IPoweredMachine;
-import binnie.core.machines.power.IProcess;
-import binnie.core.machines.power.PowerInfo;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.Tooltip.Type;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.minecraft.ContainerCraftGUI;
-import binnie.craftgui.minecraft.GuiCraftGUI;
-import binnie.craftgui.minecraft.MinecraftTooltip;
-import binnie.craftgui.minecraft.MinecraftTooltip.Type;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import net.minecraft.inventory.IInventory;
-import org.lwjgl.opengl.GL11;
-
-public class ControlEnergyBar
- extends Control
- implements ITooltip
-{
- public static boolean isError;
- private Position direction;
-
- public ControlEnergyBar(IWidget parent, int x, int y, int width, int height, Position direction)
- {
- super(parent, x, y, width, height);
- this.direction = direction;
- addAttribute(Attribute.MouseOver);
- }
-
- public IPoweredMachine getClientPower()
- {
- IInventory inventory = Window.get(this).getInventory();
- TileEntityMachine machine = (TileEntityMachine)((inventory instanceof TileEntityMachine) ? inventory : null);
- if (machine == null) {
- return null;
- }
- IPoweredMachine clientPower = (IPoweredMachine)machine.getMachine().getInterface(IPoweredMachine.class);
- return clientPower;
- }
-
- public float getPercentage()
- {
- float percentage = 100.0F * getStoredEnergy() / getMaxEnergy();
- if (percentage > 100.0F) {
- percentage = 100.0F;
- }
- return percentage;
- }
-
- private float getStoredEnergy()
- {
- return Window.get(this).getContainer().getPowerInfo().getStoredEnergy();
- }
-
- private float getMaxEnergy()
- {
- return Window.get(this).getContainer().getPowerInfo().getMaxEnergy();
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- tooltip.add((int)getPercentage() + "% charged");
-
- tooltip.add(getStoredEnergy() + "/" + getMaxEnergy() + " RF");
- }
-
- public void getHelpTooltip(Tooltip tooltip)
- {
- tooltip.add("Energy Bar");
- tooltip.add("Current: " + getStoredEnergy() + " RF (" + (int)getPercentage() + "%)");
- tooltip.add("Capacity: " + getMaxEnergy() + " RF");
-
- IProcess process = (IProcess)Machine.getInterface(IProcess.class, Window.get(this).getInventory());
- if (process != null) {
- tooltip.add("Usage: " + (int)process.getEnergyPerTick() + " RF");
- }
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(CraftGUITexture.EnergyBarBack, getArea());
-
- float percentage = getPercentage() / 100.0F;
-
- CraftGUI.Render.colour(getColourFromPercentage(percentage));
-
- IArea area = getArea();
- switch (1.$SwitchMap$binnie$craftgui$core$geometry$Position[this.direction.ordinal()])
- {
- case 1:
- case 2:
- float height = area.size().y() * percentage;
- area.setSize(new IPoint(area.size().x(), height));
-
- break;
- case 3:
- case 4:
- float width = area.size().x() * percentage;
- area.setSize(new IPoint(width, area.size().y()));
- }
- if ((isMouseOver()) && (Window.get(this).getGui().isHelpMode()))
- {
- int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.Help);
- CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
- }
- else if (isError)
- {
- int c = -1442840576 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
- CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
- }
- CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlow, area);
-
- GL11.glColor3d(1.0D, 1.0D, 1.0D);
-
- CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, getArea());
- }
-
- public void onRenderForeground()
- {
- if ((isMouseOver()) && (Window.get(this).getGui().isHelpMode()))
- {
- IArea area = getArea();
- CraftGUI.Render.colour(MinecraftTooltip.getOutline(Tooltip.Type.Help));
- CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
- }
- else if (isError)
- {
- IArea area = getArea();
- CraftGUI.Render.colour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error));
- CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
- }
- }
-
- public int getColourFromPercentage(float percentage)
- {
- int colour = 16777215;
- if (percentage > 0.5D)
- {
- int r = (int)((1.0D - 2.0D * (percentage - 0.5D)) * 255.0D);
- colour = (r << 16) + 65280;
- }
- else
- {
- int g = (int)(255.0F * (2.0F * percentage));
- colour = 16711680 + (g << 8);
- }
- return colour;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlErrorState.java b/src/Java/binnie/craftgui/minecraft/control/ControlErrorState.java
deleted file mode 100644
index 6027371297..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlErrorState.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.core.machines.power.ErrorState;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.minecraft.ContainerCraftGUI;
-import binnie.craftgui.minecraft.CustomSlot;
-import binnie.craftgui.minecraft.MinecraftTooltip;
-import binnie.craftgui.minecraft.MinecraftTooltip.Type;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import java.util.List;
-import java.util.Map;
-import net.minecraft.entity.player.InventoryPlayer;
-
-public class ControlErrorState
- extends Control
- implements ITooltip
-{
- private ErrorState errorState;
-
- public void onRenderBackground()
- {
- Object texture = CraftGUITexture.StateWarning;
- if (this.errorState == null) {
- texture = CraftGUITexture.StateNone;
- } else if (this.type == 0) {
- texture = CraftGUITexture.StateError;
- }
- CraftGUI.Render.texture(texture, IPoint.ZERO);
-
- super.onRenderBackground();
- }
-
- public ErrorState getError()
- {
- return Window.get(this).getContainer().getErrorState();
- }
-
- public final void onUpdateClient()
- {
- this.errorState = getError();
- this.type = Window.get(this).getContainer().getErrorType();
-
- ((List)ControlSlot.highlighting.get(EnumHighlighting.Error)).clear();
- ((List)ControlSlot.highlighting.get(EnumHighlighting.Warning)).clear();
- ControlLiquidTank.tankError.clear();
- ControlEnergyBar.isError = false;
- if ((!isMouseOver()) || (this.errorState == null)) {
- return;
- }
- ControlEnergyBar.isError = this.errorState.isPowerError();
- if (this.errorState.isItemError()) {
- for (int slot : this.errorState.getData())
- {
- int id = -1;
- for (CustomSlot cslot : Window.get(this).getContainer().getCustomSlots()) {
- if ((!(cslot.inventory instanceof InventoryPlayer)) && (cslot.getSlotIndex() == slot)) {
- id = cslot.slotNumber;
- }
- }
- if (id >= 0) {
- if (this.type == 0) {
- ((List)ControlSlot.highlighting.get(EnumHighlighting.Error)).add(Integer.valueOf(id));
- } else {
- ((List)ControlSlot.highlighting.get(EnumHighlighting.Warning)).add(Integer.valueOf(id));
- }
- }
- }
- }
- if (this.errorState.isTankError()) {
- for (int slot : this.errorState.getData()) {
- ControlLiquidTank.tankError.add(Integer.valueOf(slot));
- }
- }
- }
-
- private int type = 0;
-
- public ControlErrorState(IWidget parent, float x, float y)
- {
- super(parent, x, y, 16.0F, 16.0F);
- addAttribute(Attribute.MouseOver);
- }
-
- public void getTooltip(Tooltip tooltipOrig)
- {
- MinecraftTooltip tooltip = (MinecraftTooltip)tooltipOrig;
- if (this.errorState != null)
- {
- if (this.type == 0) {
- tooltip.setType(MinecraftTooltip.Type.Error);
- } else {
- tooltip.setType(MinecraftTooltip.Type.Warning);
- }
- tooltip.add(this.errorState.toString());
- if (this.errorState.getTooltip().length() > 0) {
- tooltip.add(this.errorState.getTooltip());
- }
- }
- }
-
- public ErrorState getErrorState()
- {
- return this.errorState;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlHelp.java b/src/Java/binnie/craftgui/minecraft/control/ControlHelp.java
deleted file mode 100644
index d2027747f2..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlHelp.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.Tooltip.Type;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public class ControlHelp
- extends Control
- implements ITooltip
-{
- public ControlHelp(IWidget parent, float x, float y)
- {
- super(parent, x, y, 16.0F, 16.0F);
- addAttribute(Attribute.MouseOver);
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(CraftGUITexture.HelpButton, getArea());
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- tooltip.setType(Tooltip.Type.Help);
- tooltip.add("Help");
- tooltip.add("To activate help tooltips,");
- tooltip.add("hold down the tab key and");
- tooltip.add("mouse over controls.");
- }
-
- public void getHelpTooltip(Tooltip tooltip)
- {
- getTooltip(tooltip);
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlIconDisplay.java b/src/Java/binnie/craftgui/minecraft/control/ControlIconDisplay.java
deleted file mode 100644
index 071e8ee888..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlIconDisplay.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import net.minecraft.util.IIcon;
-
-public class ControlIconDisplay
- extends Control
-{
- private IIcon icon = null;
-
- public ControlIconDisplay(IWidget parent, float x, float y, IIcon icon)
- {
- super(parent, x, y, 16.0F, 16.0F);
- this.icon = icon;
- }
-
- public void onRenderForeground()
- {
- CraftGUI.Render.iconItem(IPoint.ZERO, this.icon);
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlImage.java b/src/Java/binnie/craftgui/minecraft/control/ControlImage.java
deleted file mode 100644
index 0d08626852..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlImage.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.resource.Texture;
-
-public class ControlImage
- extends Control
-{
- private Object key = null;
-
- public ControlImage(IWidget parent, float x, float y, Texture text)
- {
- super(parent, x, y, text.w(), text.h());
- this.key = text;
- }
-
- public void onRenderForeground()
- {
- CraftGUI.Render.texture(this.key, IPoint.ZERO);
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlInfo.java b/src/Java/binnie/craftgui/minecraft/control/ControlInfo.java
deleted file mode 100644
index 8d9c8e95b6..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.Tooltip.Type;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public class ControlInfo
- extends Control
- implements ITooltip
-{
- private String info;
-
- public ControlInfo(IWidget parent, float x, float y, String info)
- {
- super(parent, x, y, 16.0F, 16.0F);
- addAttribute(Attribute.MouseOver);
- this.info = info;
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(CraftGUITexture.InfoButton, getArea());
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- tooltip.setType(Tooltip.Type.Information);
- tooltip.add("Info");
- tooltip.add(this.info);
- tooltip.setMaxWidth(200);
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlItemDisplay.java b/src/Java/binnie/craftgui/minecraft/control/ControlItemDisplay.java
deleted file mode 100644
index 8db438bcc3..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlItemDisplay.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.core.BinnieCore;
-import binnie.core.proxy.BinnieProxy;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.ITopLevelWidget;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.minecraft.Window;
-import net.minecraft.client.Minecraft;
-import net.minecraft.item.ItemStack;
-import org.lwjgl.opengl.GL11;
-
-public class ControlItemDisplay
- extends Control
- implements ITooltip
-{
- private ItemStack itemStack = null;
- public boolean hastooltip = false;
-
- public void setTooltip()
- {
- this.hastooltip = true;
- addAttribute(Attribute.MouseOver);
- }
-
- public ControlItemDisplay(IWidget parent, float x, float y)
- {
- this(parent, x, y, 16.0F);
- }
-
- public ControlItemDisplay(IWidget parent, float f, float y, ItemStack stack, boolean tooltip)
- {
- this(parent, f, y, 16.0F);
- setItemStack(stack);
- if (tooltip) {
- setTooltip();
- }
- }
-
- public ControlItemDisplay(IWidget parent, float x, float y, float size)
- {
- super(parent, x, y, size, size);
- }
-
- public void onRenderBackground()
- {
- IPoint relativeToWindow = getAbsolutePosition().sub(getSuperParent().getPosition());
- if ((relativeToWindow.x() > Window.get(this).getSize().x() + 100.0F) || (relativeToWindow.y() > Window.get(this).getSize().y() + 100.0F)) {
- return;
- }
- if (this.itemStack != null) {
- if (getSize().x() != 16.0F)
- {
- GL11.glPushMatrix();
- float scale = getSize().x() / 16.0F;
- GL11.glScalef(scale, scale, 1.0F);
- BinnieCore.proxy.getMinecraftInstance();float phase = (float)Minecraft.getSystemTime() / 20.0F;
- CraftGUI.Render.item(IPoint.ZERO, this.itemStack, this.rotating);
- GL11.glPopMatrix();
- }
- else
- {
- CraftGUI.Render.item(IPoint.ZERO, this.itemStack, this.rotating);
- }
- }
- }
-
- public void setItemStack(ItemStack itemStack)
- {
- this.itemStack = itemStack;
- }
-
- public ItemStack getItemStack()
- {
- return this.itemStack;
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- if ((this.hastooltip) && (this.itemStack != null)) {
- tooltip.add(this.itemStack.getTooltip(((Window)getSuperParent()).getPlayer(), false));
- }
- super.getTooltip(tooltip);
- }
-
- private boolean rotating = false;
-
- public void setRotating()
- {
- this.rotating = true;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlLiquidTank.java b/src/Java/binnie/craftgui/minecraft/control/ControlLiquidTank.java
deleted file mode 100644
index d69c61136d..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlLiquidTank.java
+++ /dev/null
@@ -1,223 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.core.BinnieCore;
-import binnie.core.machines.Machine;
-import binnie.core.machines.inventory.MachineSide;
-import binnie.core.machines.inventory.TankSlot;
-import binnie.core.machines.inventory.Validator;
-import binnie.core.machines.power.ITankMachine;
-import binnie.core.machines.power.TankInfo;
-import binnie.core.proxy.BinnieProxy;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.ITopLevelWidget;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.Tooltip.Type;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.minecraft.ContainerCraftGUI;
-import binnie.craftgui.minecraft.GuiCraftGUI;
-import binnie.craftgui.minecraft.MinecraftTooltip;
-import binnie.craftgui.minecraft.MinecraftTooltip.Type;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.client.renderer.texture.TextureMap;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.IIcon;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import org.lwjgl.opengl.GL11;
-
-public class ControlLiquidTank
- extends Control
- implements ITooltip
-{
- public static List<Integer> tankError = new ArrayList();
- private int tankID = 0;
- private boolean horizontal = false;
-
- public ControlLiquidTank(IWidget parent, int x, int y)
- {
- this(parent, x, y, false);
- }
-
- public ControlLiquidTank(IWidget parent, int x, int y, boolean horizontal)
- {
- super(parent, x, y, horizontal ? 60.0F : 18.0F, horizontal ? 18.0F : 60.0F);
- this.horizontal = horizontal;
- addAttribute(Attribute.MouseOver);
-
- addSelfEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- if (event.getButton() == 0)
- {
- NBTTagCompound nbt = new NBTTagCompound();
- nbt.setByte("id", (byte)ControlLiquidTank.this.tankID);
- Window.get(ControlLiquidTank.this.getWidget()).sendClientAction("tank-click", nbt);
- }
- }
- });
- }
-
- public void setTankID(int tank)
- {
- this.tankID = tank;
- }
-
- public TankInfo getTank()
- {
- return Window.get(this).getContainer().getTankInfo(this.tankID);
- }
-
- public boolean isTankValid()
- {
- return !getTank().isEmpty();
- }
-
- public int getTankCapacity()
- {
- return (int)getTank().getCapacity();
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, IPoint.ZERO);
- if ((isMouseOver()) && (Window.get(this).getGui().isHelpMode()))
- {
- int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.Help);
- CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
- }
- else if (tankError.contains(Integer.valueOf(this.tankID)))
- {
- int c = -1442840576 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
- CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
- }
- else if (getSuperParent().getMousedOverWidget() == this)
- {
- if (Window.get(this).getGui().getDraggedItem() != null) {
- CraftGUI.Render.gradientRect(getArea().inset(1), -1426089575, -1426089575);
- } else {
- CraftGUI.Render.gradientRect(getArea().inset(1), -2130706433, -2130706433);
- }
- }
- if (isTankValid())
- {
- Object content = null;
-
- float height = this.horizontal ? 16.0F : 58.0F;
-
- int squaled = (int)(height * (getTank().getAmount() / getTank().getCapacity()));
-
-
-
- int yPos = (int)height + 1;
-
- Fluid fluid = getTank().liquid.getFluid();
-
- int hex = fluid.getColor(getTank().liquid);
-
- int r = (hex & 0xFF0000) >> 16;
- int g = (hex & 0xFF00) >> 8;
- int b = hex & 0xFF;
-
- GL11.glColor4f(r / 255.0F, g / 255.0F, b / 255.0F, 1.0F);
-
- GL11.glEnable(3042);
-
- GL11.glBlendFunc(770, 771);
-
- IPoint pos = getAbsolutePosition();
- IPoint offset = new IPoint(0.0F, height - squaled);
- IArea limited = getArea().inset(1);
- if (this.horizontal) {
- limited.setSize(new IPoint(limited.w() - 1.0F, limited.h()));
- }
- CraftGUI.Render.limitArea(new IArea(limited.pos().add(pos).add(offset), limited.size().sub(offset)));
-
-
- GL11.glEnable(3089);
-
- BinnieCore.proxy.bindTexture(TextureMap.locationItemsTexture);
- for (int y = 0; y < height; y += 16) {
- for (int x = 0; x < (this.horizontal ? 58 : 16); x += 16)
- {
- IIcon icon = fluid.getIcon();
-
- CraftGUI.Render.iconBlock(new IPoint(1 + x, 1 + y), icon);
- }
- }
- GL11.glDisable(3089);
- GL11.glDisable(3042);
- }
- }
-
- public void onRenderForeground()
- {
- CraftGUI.Render.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, IPoint.ZERO);
- if ((isMouseOver()) && (Window.get(this).getGui().isHelpMode()))
- {
- IArea area = getArea();
- CraftGUI.Render.colour(MinecraftTooltip.getOutline(Tooltip.Type.Help));
- CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
- }
- if (tankError.contains(Integer.valueOf(this.tankID)))
- {
- IArea area = getArea();
- CraftGUI.Render.colour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error));
- CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
- }
- }
-
- public void getHelpTooltip(Tooltip tooltip)
- {
- if (getTankSlot() != null)
- {
- TankSlot slot = getTankSlot();
- tooltip.add(slot.getName());
- tooltip.add("Capacity: " + getTankCapacity() + " mB");
- tooltip.add("Insert Side: " + MachineSide.asString(slot.getInputSides()));
- tooltip.add("Extract Side: " + MachineSide.asString(slot.getOutputSides()));
- if (slot.isReadOnly()) {
- tooltip.add("Output Only Tank");
- }
- tooltip.add("Accepts: " + (slot.getValidator() == null ? "Any Item" : slot.getValidator().getTooltip()));
-
- return;
- }
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- if (isTankValid())
- {
- int percentage = (int)(100.0D * getTank().getAmount() / getTankCapacity());
-
- tooltip.add(getTank().getName());
-
- tooltip.add(percentage + "% full");
- tooltip.add((int)getTank().getAmount() + " mB");
-
-
-
- return;
- }
- tooltip.add("Empty");
- }
-
- private TankSlot getTankSlot()
- {
- ITankMachine tank = (ITankMachine)Machine.getInterface(ITankMachine.class, Window.get(this).getInventory());
-
- return tank != null ? tank.getTankSlot(this.tankID) : null;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlMachineProgress.java b/src/Java/binnie/craftgui/minecraft/control/ControlMachineProgress.java
deleted file mode 100644
index f2a64e3e38..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlMachineProgress.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.resource.Texture;
-
-public class ControlMachineProgress
- extends ControlProgress
-{
- public ControlMachineProgress(IWidget parent, int x, int y, Texture base, Texture progress, Position dir)
- {
- super(parent, x, y, base, progress, dir);
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlPlayerInventory.java b/src/Java/binnie/craftgui/minecraft/control/ControlPlayerInventory.java
deleted file mode 100644
index f15d102789..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlPlayerInventory.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.minecraft.InventoryType;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class ControlPlayerInventory
- extends Control
-{
- private List<ControlSlot> slots = new ArrayList();
-
- public ControlPlayerInventory(IWidget parent, boolean wide)
- {
- super(parent, (int)(parent.getSize().x() / 2.0F) - (wide ? 110 : 81), (int)parent.getSize().y() - (wide ? 54 : 76) - 12, wide ? 'Ü' : '¢', wide ? 54 : 76);
- for (int row = 0; row < 3; row++) {
- for (int column = 0; column < 9; column++)
- {
- ControlSlot slot = new ControlSlot(this, (wide ? 58 : 0) + column * 18, row * 18);
- this.slots.add(slot);
- }
- }
- if (wide) {
- for (int i1 = 0; i1 < 9; i1++)
- {
- ControlSlot slot = new ControlSlot(this, i1 % 3 * 18, i1 / 3 * 18);
- this.slots.add(slot);
- }
- } else {
- for (int i1 = 0; i1 < 9; i1++)
- {
- ControlSlot slot = new ControlSlot(this, i1 * 18, 58.0F);
- this.slots.add(slot);
- }
- }
- create();
- }
-
- public ControlPlayerInventory(IWidget parent)
- {
- this(parent, false);
- }
-
- public ControlPlayerInventory(IWidget parent, int x, int y)
- {
- super(parent, x, y, 54.0F, 220.0F);
- for (int row = 0; row < 6; row++) {
- for (int column = 0; column < 6; column++)
- {
- ControlSlot slot = new ControlSlot(this, column * 18, row * 18);
- this.slots.add(slot);
- }
- }
- create();
- }
-
- public void create()
- {
- for (int row = 0; row < 3; row++) {
- for (int column = 0; column < 9; column++)
- {
- ControlSlot slot = (ControlSlot)this.slots.get(column + row * 9);
- slot.assign(InventoryType.Player, 9 + column + row * 9);
- }
- }
- for (int i1 = 0; i1 < 9; i1++)
- {
- ControlSlot slot = (ControlSlot)this.slots.get(27 + i1);
- slot.assign(InventoryType.Player, i1);
- }
- }
-
- public void addItem(ItemStack item)
- {
- if (item == null) {
- return;
- }
- for (ControlSlot slot : this.slots) {
- if (!slot.slot.getHasStack())
- {
- slot.slot.putStack(item);
- return;
- }
- }
- }
-
- public void addInventory(IInventory inventory)
- {
- for (int i = 0; i < inventory.getSizeInventory(); i++) {
- addItem(inventory.getStackInSlot(i));
- }
- }
-
- public ControlSlot getSlot(int i)
- {
- if ((i < 0) || (i >= this.slots.size())) {
- return null;
- }
- return (ControlSlot)this.slots.get(i);
- }
-
- public void onUpdateClient() {}
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlPowerSystem.java b/src/Java/binnie/craftgui/minecraft/control/ControlPowerSystem.java
deleted file mode 100644
index b0f522b180..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlPowerSystem.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.core.machines.power.PowerSystem;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.Tooltip.Type;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public class ControlPowerSystem
- extends Control
- implements ITooltip
-{
- private PowerSystem system;
-
- public ControlPowerSystem(IWidget parent, float x, float y, PowerSystem system)
- {
- super(parent, x, y, 16.0F, 16.0F);
- addAttribute(Attribute.MouseOver);
- this.system = system;
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(CraftGUITexture.PowerButton, getArea());
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- tooltip.setType(Tooltip.Type.Power);
- tooltip.add("Power Supply");
- tooltip.add("Powered by " + this.system.getUnitName());
- tooltip.setMaxWidth(200);
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlProgress.java b/src/Java/binnie/craftgui/minecraft/control/ControlProgress.java
deleted file mode 100644
index 6508c84107..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlProgress.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.resource.Texture;
-
-public class ControlProgress
- extends ControlProgressBase
-{
- private Texture progressBlank;
- private Texture progressBar;
- private Position direction;
-
- public ControlProgress(IWidget parent, int x, int y, Texture progressBlank, Texture progressBar, Position dir)
- {
- super(parent, x, y, progressBlank == null ? 0.0F : progressBlank.w(), progressBlank == null ? 0.0F : progressBlank.h());
- this.progressBlank = progressBlank;
- this.progressBar = progressBar;
- this.progress = 0.0F;
- this.direction = dir;
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(this.progressBlank, getArea());
- CraftGUI.Render.texturePercentage(this.progressBar, getArea(), this.direction, this.progress);
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlProgressBase.java b/src/Java/binnie/craftgui/minecraft/control/ControlProgressBase.java
deleted file mode 100644
index f7e2ef4f39..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlProgressBase.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.core.machines.IMachine;
-import binnie.core.machines.Machine;
-import binnie.core.machines.power.IProcess;
-import binnie.core.machines.power.ProcessInfo;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.minecraft.ContainerCraftGUI;
-import binnie.craftgui.minecraft.Window;
-
-public class ControlProgressBase
- extends Control
-{
- protected float progress;
-
- public ControlProgressBase(IWidget parent, float x, float y, float w, float h)
- {
- super(parent, x, y, w, h);
- this.progress = 0.0F;
- addAttribute(Attribute.MouseOver);
- }
-
- public void setProgress(float progress)
- {
- this.progress = progress;
- if (this.progress < 0.0F) {
- this.progress = 0.0F;
- } else if (this.progress > 1.0F) {
- this.progress = 1.0F;
- }
- }
-
- protected ProcessInfo getProcess()
- {
- return Window.get(this).getContainer().getProcessInfo();
- }
-
- public void onUpdateClient()
- {
- ProcessInfo process = getProcess();
- if (process != null) {
- setProgress(process.getCurrentProgress() / 100.0F);
- }
- }
-
- public void getHelpTooltip(Tooltip tooltip)
- {
- ProcessInfo process = getProcess();
-
- IProcess machineProcess = (IProcess)Machine.getMachine(Window.get(this).getInventory()).getInterface(IProcess.class);
- if (process != null)
- {
- tooltip.add("Progress");
- if (this.progress == 0.0F) {
- tooltip.add("Not in Progress");
- } else if (process.getProcessTime() > 0) {
- tooltip.add(machineProcess.getTooltip() + " (" + (int)process.getCurrentProgress() + "%)");
- } else {
- tooltip.add("In Progress");
- }
- if (process.getProcessTime() > 0)
- {
- tooltip.add("Time Left: " + convertTime((int)((1.0F - this.progress) * process.getProcessTime())));
-
- tooltip.add("Total Time: " + convertTime(process.getProcessTime()));
- tooltip.add("Energy Cost: " + process.getProcessEnergy() * 10 + " RF");
- }
- else
- {
- tooltip.add("Energy Cost: " + process.getEnergyPerTick() * 10.0F + " RF / tick");
- }
- }
- }
-
- public static String convertTime(int time)
- {
- int seconds = (int)(time / 20.0F);
- int minutes = 0;
- while (seconds >= 60)
- {
- minutes++;
- seconds -= 60;
- }
- String ts = "";
- if (minutes > 0) {
- ts = ts + minutes + " minute" + (minutes == 1 ? "" : "s");
- }
- if (seconds > 0)
- {
- if (ts.length() > 0) {
- ts = ts + " ";
- }
- ts = ts + seconds + " second" + (seconds == 1 ? "" : "s");
- }
- return ts;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlSlide.java b/src/Java/binnie/craftgui/minecraft/control/ControlSlide.java
deleted file mode 100644
index 44cfe0fd37..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlSlide.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IBorder;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.core.geometry.TextJustification;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.resource.Texture;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import org.lwjgl.opengl.GL11;
-
-public class ControlSlide
- extends Control
-{
- private IArea expanded;
- private IArea shrunk;
- private boolean slideActive = true;
- private Position anchor;
- private String label = null;
-
- public ControlSlide(IWidget parent, float x, float y, float w, float h, Position anchor2)
- {
- super(parent, x, y, w, h);
- addAttribute(Attribute.MouseOver);
- addAttribute(Attribute.BlockTooltip);
- this.expanded = new IArea(getPosition(), getSize());
- this.anchor = anchor2.opposite();
- float border = this.anchor.x() != 0 ? this.expanded.w() - 6.0F : this.expanded.h() - 6.0F;
- this.shrunk = this.expanded.inset(new IBorder(this.anchor, border));
-
-
- this.slideActive = false;
- }
-
- public void onRenderBackground()
- {
- super.onRenderBackground();
- if (this.label != null)
- {
- float lw = CraftGUI.Render.textWidth(this.label) + 16;
- float lh = CraftGUI.Render.textHeight() + 16;
- boolean hor = this.anchor.x() != 0;
- IArea ar = isSlideActive() ? this.expanded : this.shrunk;
- IArea tabArea = new IArea(hor ? -lh / 2.0F : -lw / 2.0F, hor ? -lw / 2.0F : -lh / 2.0F, hor ? lh : lw, hor ? lw : lh);
- IPoint shift = new IPoint(ar.w() * (1 - this.anchor.x()) / 2.0F, ar.h() * (1 - this.anchor.y()) / 2.0F);
-
-
-
-
- tabArea = tabArea.shift(shift.x() - (-3.0F + lh / 2.0F) * this.anchor.x(), shift.y() - (-3.0F + lh / 2.0F) * this.anchor.y());
- Texture texture = CraftGUI.Render.getTexture(isSlideActive() ? CraftGUITexture.Tab : CraftGUITexture.TabDisabled).crop(this.anchor.opposite(), 8.0F);
- CraftGUI.Render.texture(texture, tabArea);
- texture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline).crop(this.anchor.opposite(), 8.0F);
- CraftGUI.Render.texture(texture, tabArea.inset(2));
- IArea labelArea = new IArea(-lw / 2.0F, 0.0F, lw, lh);
- GL11.glPushMatrix();
- GL11.glTranslatef(shift.x() + this.anchor.x() * 2.0F, shift.y() + this.anchor.y() * 2.0F, 0.0F);
- if (this.anchor.x() != 0) {
- GL11.glRotatef(90.0F, 0.0F, 0.0F, this.anchor.x());
- }
- if (this.anchor.y() > 0) {
- GL11.glTranslatef(0.0F, -lh, 0.0F);
- }
- CraftGUI.Render.text(labelArea, TextJustification.MiddleCenter, this.label, 16777215);
- GL11.glPopMatrix();
- }
- CraftGUI.Render.texture(CraftGUITexture.Window, getArea());
- Object slideTexture = this.anchor == Position.Left ? CraftGUITexture.SlideLeft : this.anchor == Position.Top ? CraftGUITexture.SlideUp : this.anchor == Position.Bottom ? CraftGUITexture.SlideDown : CraftGUITexture.SlideRight;
-
- CraftGUI.Render.texture(slideTexture, new IPoint((this.anchor.x() + 1.0F) * w() / 2.0F - 8.0F, (this.anchor.y() + 1.0F) * h() / 2.0F - 8.0F));
- }
-
- public boolean isSlideActive()
- {
- return this.slideActive;
- }
-
- public void onUpdateClient()
- {
- boolean mouseOver = isMouseOverWidget(getRelativeMousePosition());
- if (mouseOver != this.slideActive) {
- setSlide(mouseOver);
- }
- }
-
- public boolean isMouseOverWidget(IPoint relativeMouse)
- {
- return getArea().outset(isSlideActive() ? 16 : 8).outset(new IBorder(this.anchor.opposite(), 16.0F)).contains(relativeMouse);
- }
-
- public boolean isChildVisible(IWidget child)
- {
- return this.slideActive;
- }
-
- public void setSlide(boolean b)
- {
- this.slideActive = b;
- IArea area = isSlideActive() ? this.expanded : this.shrunk;
- setSize(area.size());
- setPosition(area.pos());
- }
-
- public void setLabel(String l)
- {
- this.label = l;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlSlot.java b/src/Java/binnie/craftgui/minecraft/control/ControlSlot.java
deleted file mode 100644
index c3de12acaa..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlSlot.java
+++ /dev/null
@@ -1,221 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.core.machines.inventory.InventorySlot;
-import binnie.core.machines.inventory.MachineSide;
-import binnie.core.machines.inventory.SlotValidator;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITopLevelWidget;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.minecraft.ContainerCraftGUI;
-import binnie.craftgui.minecraft.CustomSlot;
-import binnie.craftgui.minecraft.GuiCraftGUI;
-import binnie.craftgui.minecraft.InventoryType;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.WindowInventory;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.client.multiplayer.PlayerControllerMP;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-public class ControlSlot
- extends ControlSlotBase
-{
- public static Map<EnumHighlighting, List<Integer>> highlighting = new HashMap();
- public static boolean shiftClickActive = false;
-
- static
- {
- for (EnumHighlighting h : EnumHighlighting.values()) {
- highlighting.put(h, new ArrayList());
- }
- }
-
- public Slot slot = null;
-
- public ControlSlot(IWidget parent, float x, float y)
- {
- super(parent, x, y);
-
- addSelfEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- if (ControlSlot.this.slot != null)
- {
- Window.get(ControlSlot.this.getWidget()).getGui();((Window)ControlSlot.this.getSuperParent()).getGui().getMinecraft().playerController.windowClick(((Window)ControlSlot.this.getSuperParent()).getContainer().windowId, ControlSlot.this.slot.slotNumber, event.getButton(), GuiCraftGUI.isShiftKeyDown() ? 1 : 0, ((Window)ControlSlot.this.getSuperParent()).getGui().getMinecraft().thePlayer);
- }
- }
- });
- }
-
- public ControlSlot(IWidget parent, int x, int y, Slot slot)
- {
- super(parent, x, y);
- this.slot = slot;
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(CraftGUITexture.Slot, IPoint.ZERO);
- if (this.slot == null) {
- return;
- }
- InventorySlot islot = getInventorySlot();
- if ((islot != null) && (islot.getValidator() != null))
- {
- IIcon icon = islot.getValidator().getIcon(!islot.getInputSides().isEmpty());
- if (icon != null) {
- CraftGUI.Render.iconItem(new IPoint(1.0F, 1.0F), icon);
- }
- }
- boolean highlighted = false;
- for (Map.Entry<EnumHighlighting, List<Integer>> highlight : highlighting.entrySet()) {
- if ((highlight.getKey() != EnumHighlighting.ShiftClick) || (shiftClickActive)) {
- if ((!highlighted) && (((List)highlight.getValue()).contains(Integer.valueOf(this.slot.slotNumber))))
- {
- highlighted = true;
-
- int c = -1442840576 + Math.min(((EnumHighlighting)highlight.getKey()).getColour(), 16777215);
- CraftGUI.Render.gradientRect(new IArea(1.0F, 1.0F, 16.0F, 16.0F), c, c);
- }
- }
- }
- if ((!highlighted) && (getSuperParent().getMousedOverWidget() == this)) {
- if ((Window.get(this).getGui().getDraggedItem() != null) && (!this.slot.isItemValid(Window.get(this).getGui().getDraggedItem()))) {
- CraftGUI.Render.gradientRect(new IArea(1.0F, 1.0F, 16.0F, 16.0F), -1426089575, -1426089575);
- } else {
- CraftGUI.Render.gradientRect(new IArea(1.0F, 1.0F, 16.0F, 16.0F), -2130706433, -2130706433);
- }
- }
- }
-
- public void onRenderOverlay()
- {
- if (this.slot == null) {
- return;
- }
- boolean highlighted = false;
- for (Map.Entry<EnumHighlighting, List<Integer>> highlight : highlighting.entrySet()) {
- if ((highlight.getKey() != EnumHighlighting.ShiftClick) || (shiftClickActive)) {
- if ((!highlighted) && (((List)highlight.getValue()).contains(Integer.valueOf(this.slot.slotNumber))))
- {
- highlighted = true;
- int c = ((EnumHighlighting)highlight.getKey()).getColour();
- IArea area = getArea();
- if (((getParent() instanceof ControlSlotArray)) || ((getParent() instanceof ControlPlayerInventory)))
- {
- area = getParent().getArea();
- area.setPosition(IPoint.ZERO.sub(getPosition()));
- }
- CraftGUI.Render.colour(c);
- CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
- }
- }
- }
- }
-
- public void onUpdateClient()
- {
- super.onUpdateClient();
- if (this.slot == null) {
- return;
- }
- if ((isMouseOver()) && (GuiScreen.isShiftKeyDown()))
- {
- Window.get(this).getContainer().setMouseOverSlot(this.slot);
- shiftClickActive = true;
- }
- if (Window.get(this).getGui().isHelpMode()) {
- if (isMouseOver()) {
- for (ControlSlot slot2 : getControlSlots()) {
- if (slot2.slot != null) {
- ((List)highlighting.get(EnumHighlighting.Help)).add(Integer.valueOf(slot2.slot.slotNumber));
- }
- }
- }
- }
- }
-
- private List<ControlSlot> getControlSlots()
- {
- List<ControlSlot> slots = new ArrayList();
- if (((getParent() instanceof ControlSlotArray)) || ((getParent() instanceof ControlPlayerInventory))) {
- for (IWidget child : getParent().getWidgets()) {
- slots.add((ControlSlot)child);
- }
- } else {
- slots.add(this);
- }
- return slots;
- }
-
- public ItemStack getItemStack()
- {
- if (this.slot != null) {
- return this.slot.getStack();
- }
- return null;
- }
-
- public ControlSlot assign(int index)
- {
- return assign(InventoryType.Machine, index);
- }
-
- public ControlSlot assign(InventoryType inventory, int index)
- {
- if (this.slot != null) {
- return this;
- }
- this.slot = ((Window)getSuperParent()).getContainer().getOrCreateSlot(inventory, index);
- return this;
- }
-
- public void getHelpTooltip(Tooltip tooltip)
- {
- if (this.slot == null) {
- return;
- }
- InventorySlot slot = getInventorySlot();
- if (getInventorySlot() != null)
- {
- tooltip.add(slot.getName());
- tooltip.add("Insert Side: " + MachineSide.asString(slot.getInputSides()));
- tooltip.add("Extract Side: " + MachineSide.asString(slot.getOutputSides()));
- if (slot.isReadOnly()) {
- tooltip.add("Pickup Only Slot");
- }
- tooltip.add("Accepts: " + (slot.getValidator() == null ? "Any Item" : slot.getValidator().getTooltip()));
- }
- else if ((this.slot.inventory instanceof WindowInventory))
- {
- SlotValidator s = ((WindowInventory)this.slot.inventory).getValidator(this.slot.getSlotIndex());
- tooltip.add("Accepts: " + (s == null ? "Any Item" : s.getTooltip()));
- }
- else if ((this.slot.inventory instanceof InventoryPlayer))
- {
- tooltip.add("Player Inventory");
- }
- }
-
- public InventorySlot getInventorySlot()
- {
- return (this.slot instanceof CustomSlot) ? ((CustomSlot)this.slot).getInventorySlot() : null;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlSlotArray.java b/src/Java/binnie/craftgui/minecraft/control/ControlSlotArray.java
deleted file mode 100644
index 772b9a5f85..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlSlotArray.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.minecraft.InventoryType;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class ControlSlotArray
- extends Control
- implements Iterable<ControlSlot>
-{
- private int rows;
- private int columns;
- private List<ControlSlot> slots = new ArrayList();
-
- public ControlSlotArray(IWidget parent, int x, int y, int columns, int rows)
- {
- super(parent, x, y, columns * 18, rows * 18);
- this.rows = rows;
- this.columns = columns;
- for (int row = 0; row < rows; row++) {
- for (int column = 0; column < columns; column++) {
- this.slots.add(createSlot(column * 18, row * 18));
- }
- }
- }
-
- public ControlSlot createSlot(int x, int y)
- {
- return new ControlSlot(this, x, y);
- }
-
- public void setItemStacks(ItemStack[] array)
- {
- int i = 0;
- for (ItemStack item : array)
- {
- if (i >= this.slots.size()) {
- return;
- }
- ((ControlSlot)this.slots.get(i)).slot.putStack(item);
- i++;
- }
- }
-
- public ControlSlot getControlSlot(int i)
- {
- if ((i < 0) || (i >= this.slots.size())) {
- return null;
- }
- return (ControlSlot)this.slots.get(i);
- }
-
- public ControlSlotArray create(int[] index)
- {
- return create(InventoryType.Machine, index);
- }
-
- public ControlSlotArray create(InventoryType type, int[] index)
- {
- int i = 0;
- for (ControlSlot slot : this.slots) {
- slot.assign(type, index[(i++)]);
- }
- return this;
- }
-
- public Iterator<ControlSlot> iterator()
- {
- return this.slots.iterator();
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlSlotBase.java b/src/Java/binnie/craftgui/minecraft/control/ControlSlotBase.java
deleted file mode 100644
index db7b9fa973..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlSlotBase.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.ITopLevelWidget;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventWidget.ChangeSize;
-import binnie.craftgui.events.EventWidget.ChangeSize.Handler;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import net.minecraft.item.ItemStack;
-
-public abstract class ControlSlotBase
- extends Control
- implements ITooltip
-{
- private ControlItemDisplay itemDisplay;
-
- public ControlSlotBase(IWidget parent, float x, float y)
- {
- this(parent, x, y, 18);
- }
-
- public ControlSlotBase(IWidget parent, float x, float y, int size)
- {
- super(parent, x, y, size, size);
- addAttribute(Attribute.MouseOver);
- this.itemDisplay = new ControlItemDisplay(this, 1.0F, 1.0F, size - 2);
-
- addSelfEventHandler(new EventWidget.ChangeSize.Handler()
- {
- public void onEvent(EventWidget.ChangeSize event)
- {
- if (ControlSlotBase.this.itemDisplay != null) {
- ControlSlotBase.this.itemDisplay.setSize(ControlSlotBase.this.getSize().sub(new IPoint(2.0F, 2.0F)));
- }
- }
- });
- }
-
- protected void setRotating()
- {
- this.itemDisplay.setRotating();
- }
-
- public void onRenderBackground()
- {
- int size = (int)getSize().x();
- CraftGUI.Render.texture(CraftGUITexture.Slot, getArea());
- if (getSuperParent().getMousedOverWidget() == this) {
- CraftGUI.Render.gradientRect(new IArea(new IPoint(1.0F, 1.0F), getArea().size().sub(new IPoint(2.0F, 2.0F))), -2130706433, -2130706433);
- }
- }
-
- public void onUpdateClient()
- {
- super.onUpdateClient();
- this.itemDisplay.setItemStack(getItemStack());
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- ItemStack item = getItemStack();
- if (item == null) {
- return;
- }
- tooltip.add(item.getTooltip(((Window)getSuperParent()).getPlayer(), false));
- }
-
- public abstract ItemStack getItemStack();
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlSlotCharge.java b/src/Java/binnie/craftgui/minecraft/control/ControlSlotCharge.java
deleted file mode 100644
index eb14237a4d..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlSlotCharge.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.inventory.IChargedSlots;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public class ControlSlotCharge
- extends Control
-{
- private int slot;
-
- float getCharge()
- {
- IChargedSlots slots = (IChargedSlots)Machine.getInterface(IChargedSlots.class, Window.get(this).getInventory());
- return slots == null ? 0.0F : slots.getCharge(this.slot);
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(CraftGUITexture.PanelBlack, getArea());
-
- CraftGUI.Render.texturePercentage(CraftGUI.Render.getTexture(CraftGUITexture.SlotCharge), getArea().inset(1), Position.Bottom, getCharge());
- }
-
- public ControlSlotCharge(IWidget parent, int x, int y, int slot)
- {
- super(parent, x, y, 4.0F, 18.0F);
- this.slot = slot;
- }
-
- public void getHelpTooltip(Tooltip tooltip)
- {
- tooltip.add("Charge Remaining: " + (int)(getCharge() * 100.0F) + "%");
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlTabIcon.java b/src/Java/binnie/craftgui/minecraft/control/ControlTabIcon.java
deleted file mode 100644
index 8337dc23fc..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlTabIcon.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.core.genetics.IItemStackRepresentitive;
-import binnie.craftgui.controls.tab.ControlTab;
-import binnie.craftgui.controls.tab.ControlTabBar;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.Position;
-import net.minecraft.item.ItemStack;
-
-public class ControlTabIcon<T>
- extends ControlTab<T>
-{
- private ControlItemDisplay item;
-
- public ControlTabIcon(ControlTabBar<T> parent, float x, float y, float w, float h, T value)
- {
- super(parent, x, y, w, h, value);
- this.item = new ControlItemDisplay(this, -8.0F + w / 2.0F, -8.0F + h / 2.0F);
- this.item.hastooltip = false;
- }
-
- public ItemStack getItemStack()
- {
- if ((this.value instanceof IItemStackRepresentitive)) {
- return ((IItemStackRepresentitive)this.value).getItemStackRepresentitive();
- }
- return null;
- }
-
- public void onUpdateClient()
- {
- super.onUpdateClient();
- this.item.setItemStack(getItemStack());
- float x = ((ControlTabBar)getParent()).getDirection().x();
- this.item.setOffset(new IPoint((isCurrentSelection()) || (isMouseOver()) ? 0.0F : -4.0F * x, 0.0F));
- }
-
- public boolean hasOutline()
- {
- return false;
- }
-
- public int getOutlineColour()
- {
- return 16777215;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/ControlUser.java b/src/Java/binnie/craftgui/minecraft/control/ControlUser.java
deleted file mode 100644
index 41c5a3c0bd..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/ControlUser.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.Tooltip.Type;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public class ControlUser
- extends Control
- implements ITooltip
-{
- private String username = "";
- String team = "";
-
- public ControlUser(IWidget parent, float x, float y, String username)
- {
- super(parent, x, y, 16.0F, 16.0F);
- addAttribute(Attribute.MouseOver);
- this.username = username;
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(CraftGUITexture.UserButton, getArea());
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- tooltip.setType(Tooltip.Type.User);
- tooltip.add("Owner");
- if (this.username != "") {
- tooltip.add(this.username);
- }
- tooltip.setMaxWidth(200);
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/control/EnumHighlighting.java b/src/Java/binnie/craftgui/minecraft/control/EnumHighlighting.java
deleted file mode 100644
index 7eb1f2d988..0000000000
--- a/src/Java/binnie/craftgui/minecraft/control/EnumHighlighting.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package binnie.craftgui.minecraft.control;
-
-import binnie.craftgui.core.Tooltip.Type;
-import binnie.craftgui.minecraft.MinecraftTooltip;
-import binnie.craftgui.minecraft.MinecraftTooltip.Type;
-
-public enum EnumHighlighting
-{
- Error, Warning, Help, ShiftClick;
-
- private EnumHighlighting() {}
-
- int getColour()
- {
- switch (1.$SwitchMap$binnie$craftgui$minecraft$control$EnumHighlighting[ordinal()])
- {
- case 1:
- return MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
- case 2:
- return MinecraftTooltip.getOutline(Tooltip.Type.Help);
- case 3:
- return 16776960;
- case 4:
- return MinecraftTooltip.getOutline(MinecraftTooltip.Type.Warning);
- }
- return 0;
- }
-}
diff --git a/src/Java/binnie/craftgui/minecraft/render/MinecraftTexture.java b/src/Java/binnie/craftgui/minecraft/render/MinecraftTexture.java
deleted file mode 100644
index 51addcd1db..0000000000
--- a/src/Java/binnie/craftgui/minecraft/render/MinecraftTexture.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package binnie.craftgui.minecraft.render;
-
-import binnie.core.resource.IBinnieTexture;
-import binnie.craftgui.core.geometry.IArea;
-
-public class MinecraftTexture
-{
- IArea textureArea = new IArea(0.0F, 0.0F, 0.0F, 0.0F);
- IBinnieTexture texture;
-}
diff --git a/src/Java/binnie/craftgui/minecraft/render/RenderCommand.java b/src/Java/binnie/craftgui/minecraft/render/RenderCommand.java
deleted file mode 100644
index 2cfa60f08a..0000000000
--- a/src/Java/binnie/craftgui/minecraft/render/RenderCommand.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package binnie.craftgui.minecraft.render;
-
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.minecraft.GuiCraftGUI;
-
-public abstract class RenderCommand
-{
- IWidget widget;
-
- public RenderCommand(IWidget widget)
- {
- this.widget = widget;
- }
-
- public abstract void render(GuiCraftGUI paramGuiCraftGUI);
-}
diff --git a/src/Java/binnie/craftgui/mod/database/ControlBranchBox.java b/src/Java/binnie/craftgui/mod/database/ControlBranchBox.java
deleted file mode 100644
index 3aaf90d53a..0000000000
--- a/src/Java/binnie/craftgui/mod/database/ControlBranchBox.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.listbox.ControlList;
-import binnie.craftgui.controls.listbox.ControlListBox;
-import binnie.craftgui.core.IWidget;
-import forestry.api.genetics.IClassification;
-
-class ControlBranchBox
- extends ControlListBox<IClassification>
-{
- public IWidget createOption(IClassification value, int y)
- {
- return new ControlBranchBoxOption((ControlList)getContent(), value, y);
- }
-
- public ControlBranchBox(IWidget parent, float x, float y, float width, float height)
- {
- super(parent, x, y, width, height, 12.0F);
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/ControlBranchBoxOption.java b/src/Java/binnie/craftgui/mod/database/ControlBranchBoxOption.java
deleted file mode 100644
index a3f83f403f..0000000000
--- a/src/Java/binnie/craftgui/mod/database/ControlBranchBoxOption.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.listbox.ControlList;
-import binnie.craftgui.controls.listbox.ControlTextOption;
-import forestry.api.genetics.IClassification;
-
-class ControlBranchBoxOption
- extends ControlTextOption<IClassification>
-{
- public ControlBranchBoxOption(ControlList<IClassification> controlList, IClassification option, int y)
- {
- super(controlList, option, option.getName().contains(".") ? option.getScientific() : option.getName() == null ? option.getScientific() : option.getName(), y);
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/ControlBreedingProgress.java b/src/Java/binnie/craftgui/mod/database/ControlBreedingProgress.java
deleted file mode 100644
index 9340a66752..0000000000
--- a/src/Java/binnie/craftgui/mod/database/ControlBreedingProgress.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.core.genetics.BreedingSystem;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.resource.Texture;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-import binnie.craftgui.resource.minecraft.CraftGUITextureSheet;
-import binnie.craftgui.resource.minecraft.StandardTexture;
-
-class ControlBreedingProgress
- extends Control
-{
- private static Texture Progress = new StandardTexture(80, 22, 4, 4, CraftGUITextureSheet.Controls2);
- private float percentage;
- private int colour;
-
- public ControlBreedingProgress(IWidget parent, int x, int y, int width, int height, BreedingSystem system, float percentage)
- {
- super(parent, x, y, width, height);
- this.percentage = percentage;
- this.colour = system.getColour();
- }
-
- public void onRenderBackground()
- {
- CraftGUI.Render.texture(CraftGUITexture.PanelBlack, getArea());
-
- IArea area = getArea().inset(1);
-
- area.setSize(new IPoint(area.size().x() * this.percentage, area.size().y()));
-
- CraftGUI.Render.colour(this.colour);
-
- CraftGUI.Render.texture(Progress, area);
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/ControlDatabaseIndividualDisplay.java b/src/Java/binnie/craftgui/mod/database/ControlDatabaseIndividualDisplay.java
deleted file mode 100644
index e46cf94df7..0000000000
--- a/src/Java/binnie/craftgui/mod/database/ControlDatabaseIndividualDisplay.java
+++ /dev/null
@@ -1,120 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.Binnie;
-import binnie.core.genetics.BreedingSystem;
-import binnie.core.genetics.ManagerGenetics;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.events.EventMouse.Down;
-import binnie.craftgui.events.EventMouse.Down.Handler;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.control.ControlItemDisplay;
-import com.mojang.authlib.GameProfile;
-import forestry.api.genetics.IAlleleSpecies;
-import forestry.api.genetics.IIndividual;
-import forestry.api.genetics.ISpeciesRoot;
-import net.minecraft.util.IIcon;
-
-public class ControlDatabaseIndividualDisplay
- extends ControlItemDisplay
- implements ITooltip
-{
- public void setSpecies(IAlleleSpecies species)
- {
- setSpecies(species, EnumDiscoveryState.Show);
- }
-
- public void setSpecies(IAlleleSpecies species, EnumDiscoveryState state)
- {
- ISpeciesRoot speciesRoot = Binnie.Genetics.getSpeciesRoot(species);
-
- BreedingSystem system = Binnie.Genetics.getSystem(speciesRoot.getUID());
-
- IIndividual ind = system.getSpeciesRoot().templateAsIndividual(system.getSpeciesRoot().getTemplate(species.getUID()));
-
- super.setItemStack(system.getSpeciesRoot().getMemberStack(ind, system.getDefaultType()));
- this.species = species;
-
- GameProfile username = Window.get(this).getUsername();
- if (state == EnumDiscoveryState.Undetermined) {
- state = system.isSpeciesDiscovered(species, Window.get(this).getWorld(), username) ? EnumDiscoveryState.Discovered : EnumDiscoveryState.Undiscovered;
- }
- if (((Window.get(this) instanceof WindowAbstractDatabase)) &&
- (((WindowAbstractDatabase)Window.get(this)).isNEI)) {
- state = EnumDiscoveryState.Show;
- }
- this.discovered = state;
-
- addAttribute(Attribute.MouseOver);
- }
-
- private IAlleleSpecies species = null;
- EnumDiscoveryState discovered = EnumDiscoveryState.Show;
-
- public ControlDatabaseIndividualDisplay(IWidget parent, float x, float y)
- {
- this(parent, x, y, 16.0F);
- }
-
- public ControlDatabaseIndividualDisplay(IWidget parent, float x, float y, float size)
- {
- super(parent, x, y, size);
-
-
- addSelfEventHandler(new EventMouse.Down.Handler()
- {
- public void onEvent(EventMouse.Down event)
- {
- if ((event.getButton() == 0) && (ControlDatabaseIndividualDisplay.this.species != null) && (EnumDiscoveryState.Show == ControlDatabaseIndividualDisplay.this.discovered)) {
- ((WindowAbstractDatabase)ControlDatabaseIndividualDisplay.this.getSuperParent()).gotoSpeciesDelayed(ControlDatabaseIndividualDisplay.this.species);
- }
- }
- });
- }
-
- public void onRenderForeground()
- {
- IIcon icon = null;
- if (this.species == null) {
- return;
- }
- BreedingSystem system = Binnie.Genetics.getSystem(this.species.getRoot());
- switch (2.$SwitchMap$binnie$craftgui$mod$database$EnumDiscoveryState[this.discovered.ordinal()])
- {
- case 1:
- super.onRenderForeground();
- return;
- case 2:
- icon = system.getDiscoveredIcon();
- break;
- case 3:
- icon = system.getUndiscoveredIcon();
- break;
- }
- if (icon != null) {
- CraftGUI.Render.iconItem(IPoint.ZERO, icon);
- }
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- if (this.species != null) {
- switch (2.$SwitchMap$binnie$craftgui$mod$database$EnumDiscoveryState[this.discovered.ordinal()])
- {
- case 1:
- tooltip.add(this.species.getName());
- break;
- case 2:
- tooltip.add("Discovered Species");
- break;
- case 3:
- tooltip.add("Undiscovered Species");
- }
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/ControlItemStackOption.java b/src/Java/binnie/craftgui/mod/database/ControlItemStackOption.java
deleted file mode 100644
index 2dfa33b083..0000000000
--- a/src/Java/binnie/craftgui/mod/database/ControlItemStackOption.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.listbox.ControlList;
-import binnie.craftgui.controls.listbox.ControlTextOption;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.geometry.CraftGUIUtil;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.minecraft.control.ControlItemDisplay;
-import net.minecraft.item.ItemStack;
-
-public class ControlItemStackOption
- extends ControlTextOption<ItemStack>
-{
- private ControlItemDisplay controlBee;
-
- public ControlItemStackOption(ControlList<ItemStack> controlList, ItemStack option, int y)
- {
- super(controlList, option, option.getDisplayName(), y);
- setSize(new IPoint(getSize().x(), 20.0F));
-
- this.controlBee = new ControlItemDisplay(this, 2.0F, 2.0F);
- this.controlBee.setItemStack(option);
-
- addAttribute(Attribute.MouseOver);
-
- CraftGUIUtil.moveWidget(this.textWidget, new IPoint(22.0F, 0.0F));
- this.textWidget.setSize(this.textWidget.getSize().sub(new IPoint(24.0F, 0.0F)));
-
- int th = (int)CraftGUI.Render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
- int height = Math.max(20, th + 6);
- setSize(new IPoint(size().x(), height));
- this.textWidget.setSize(new IPoint(this.textWidget.getSize().x(), height));
- this.controlBee.setPosition(new IPoint(this.controlBee.pos().x(), (height - 18) / 2));
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/ControlMutationBox.java b/src/Java/binnie/craftgui/mod/database/ControlMutationBox.java
deleted file mode 100644
index 62cdda8dcf..0000000000
--- a/src/Java/binnie/craftgui/mod/database/ControlMutationBox.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.core.genetics.BreedingSystem;
-import binnie.craftgui.controls.listbox.ControlList;
-import binnie.craftgui.controls.listbox.ControlListBox;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.minecraft.Window;
-import forestry.api.genetics.IAlleleSpecies;
-import forestry.api.genetics.IMutation;
-import java.util.List;
-
-class ControlMutationBox
- extends ControlListBox<IMutation>
-{
- private int index;
- private Type type;
-
- public IWidget createOption(IMutation value, int y)
- {
- return new ControlMutationItem((ControlList)getContent(), value, this.species, y);
- }
-
- static enum Type
- {
- Resultant, Further;
-
- private Type() {}
- }
-
- public ControlMutationBox(IWidget parent, int x, int y, int width, int height, Type type)
- {
- super(parent, x, y, width, height, 12.0F);
- this.type = type;
- }
-
- private IAlleleSpecies species = null;
-
- public void setSpecies(IAlleleSpecies species)
- {
- if (species != this.species)
- {
- this.species = species;
- this.index = 0;
- movePercentage(-100.0F);
-
- BreedingSystem system = ((WindowAbstractDatabase)getSuperParent()).getBreedingSystem();
-
- List<IMutation> discovered = system.getDiscoveredMutations(Window.get(this).getWorld(), Window.get(this).getUsername());
- if (species != null) {
- if (this.type == Type.Resultant)
- {
- setOptions(system.getResultantMutations(species));
- }
- else
- {
- List<IMutation> mutations = system.getFurtherMutations(species);
- for (int i = 0; i < mutations.size();)
- {
- IMutation mutation = (IMutation)mutations.get(i);
- if ((!discovered.contains(mutations)) && (!((IAlleleSpecies)mutation.getTemplate()[0]).isCounted())) {
- mutations.remove(i);
- } else {
- i++;
- }
- }
- setOptions(mutations);
- }
- }
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/ControlMutationItem.java b/src/Java/binnie/craftgui/mod/database/ControlMutationItem.java
deleted file mode 100644
index 630294e458..0000000000
--- a/src/Java/binnie/craftgui/mod/database/ControlMutationItem.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.core.genetics.BreedingSystem;
-import binnie.craftgui.controls.listbox.ControlList;
-import binnie.craftgui.controls.listbox.ControlOption;
-import binnie.craftgui.minecraft.Window;
-import forestry.api.genetics.IAlleleSpecies;
-import forestry.api.genetics.IMutation;
-
-class ControlMutationItem
- extends ControlOption<IMutation>
-{
- private ControlDatabaseIndividualDisplay itemWidget1;
- private ControlDatabaseIndividualDisplay itemWidget2;
- private ControlDatabaseIndividualDisplay itemWidget3;
- private ControlMutationSymbol addSymbol;
- private ControlMutationSymbol arrowSymbol;
-
- public ControlMutationItem(ControlList<IMutation> controlList, IMutation option, IAlleleSpecies species, int y)
- {
- super(controlList, option, y);
- this.itemWidget1 = new ControlDatabaseIndividualDisplay(this, 4.0F, 4.0F);
- this.itemWidget2 = new ControlDatabaseIndividualDisplay(this, 44.0F, 4.0F);
- this.itemWidget3 = new ControlDatabaseIndividualDisplay(this, 104.0F, 4.0F);
- this.addSymbol = new ControlMutationSymbol(this, 24, 4, 0);
- this.arrowSymbol = new ControlMutationSymbol(this, 64, 4, 1);
-
- boolean isNEI = ((WindowAbstractDatabase)getSuperParent()).isNEI();
- BreedingSystem system = ((WindowAbstractDatabase)getSuperParent()).getBreedingSystem();
- if (getValue() != null)
- {
- boolean isMutationDiscovered = system.isMutationDiscovered((IMutation)getValue(), Window.get(this).getWorld(), Window.get(this).getUsername());
-
-
- IAlleleSpecies allele = null;
- EnumDiscoveryState state = null;
-
- allele = (IAlleleSpecies)((IMutation)getValue()).getAllele0();
- state = species == allele ? EnumDiscoveryState.Show : (isNEI) || (isMutationDiscovered) ? EnumDiscoveryState.Show : EnumDiscoveryState.Undetermined;
- this.itemWidget1.setSpecies(allele, state);
- allele = (IAlleleSpecies)((IMutation)getValue()).getAllele1();
- state = species == allele ? EnumDiscoveryState.Show : (isNEI) || (isMutationDiscovered) ? EnumDiscoveryState.Show : EnumDiscoveryState.Undetermined;
- this.itemWidget2.setSpecies(allele, state);
- allele = (IAlleleSpecies)((IMutation)getValue()).getTemplate()[0];
- state = species == allele ? EnumDiscoveryState.Show : (isNEI) || (isMutationDiscovered) ? EnumDiscoveryState.Show : EnumDiscoveryState.Undetermined;
- this.itemWidget3.setSpecies(allele, state);
- this.addSymbol.setValue((IMutation)getValue());
- this.arrowSymbol.setValue((IMutation)getValue());
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/ControlMutationSymbol.java b/src/Java/binnie/craftgui/mod/database/ControlMutationSymbol.java
deleted file mode 100644
index 5c8bdc0aed..0000000000
--- a/src/Java/binnie/craftgui/mod/database/ControlMutationSymbol.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.core.genetics.BreedingSystem;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.ITooltip;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.Tooltip;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.resource.Texture;
-import binnie.craftgui.resource.minecraft.CraftGUITextureSheet;
-import binnie.craftgui.resource.minecraft.StandardTexture;
-import forestry.api.genetics.IAllele;
-import forestry.api.genetics.IMutation;
-
-class ControlMutationSymbol
- extends Control
- implements ITooltip
-{
- private static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2);
- private static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.Controls2);
- private IMutation value;
- private boolean discovered;
- private int type;
-
- public void onRenderBackground()
- {
- super.onRenderBackground();
- if (this.type == 0) {
- CraftGUI.Render.texture(MutationPlus, IPoint.ZERO);
- } else {
- CraftGUI.Render.texture(MutationArrow, IPoint.ZERO);
- }
- }
-
- protected ControlMutationSymbol(IWidget parent, int x, int y, int type)
- {
- super(parent, x, y, 16 + type * 16, 16.0F);
- this.value = null;
- this.type = type;
- addAttribute(Attribute.MouseOver);
- }
-
- public void setValue(IMutation value)
- {
- this.value = value;
-
- boolean isNEI = ((WindowAbstractDatabase)getSuperParent()).isNEI();
- BreedingSystem system = ((WindowAbstractDatabase)getSuperParent()).getBreedingSystem();
-
- this.discovered = (isNEI ? true : system.isMutationDiscovered(value, Window.get(this).getWorld(), Window.get(this).getUsername()));
- if (this.discovered) {
- setColour(16777215);
- } else {
- setColour(7829367);
- }
- }
-
- public void getTooltip(Tooltip tooltip)
- {
- if ((this.type == 1) && (this.discovered))
- {
- IAllele species1 = this.value.getAllele0();
- IAllele species2 = this.value.getAllele1();
-
- BreedingSystem system = ((WindowAbstractDatabase)getSuperParent()).getBreedingSystem();
-
- float chance = system.getChance(this.value, Window.get(this).getPlayer(), species1, species2);
- tooltip.add("Current Chance - " + chance + "%");
- if (this.value.getSpecialConditions() != null) {
- for (String string : this.value.getSpecialConditions()) {
- tooltip.add(string);
- }
- }
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/ControlSpeciesBox.java b/src/Java/binnie/craftgui/mod/database/ControlSpeciesBox.java
deleted file mode 100644
index 4f184b0064..0000000000
--- a/src/Java/binnie/craftgui/mod/database/ControlSpeciesBox.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.core.genetics.BreedingSystem;
-import binnie.craftgui.controls.listbox.ControlList;
-import binnie.craftgui.controls.listbox.ControlListBox;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.minecraft.Window;
-import com.mojang.authlib.GameProfile;
-import forestry.api.genetics.IAlleleSpecies;
-import forestry.api.genetics.IClassification;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import net.minecraft.entity.player.EntityPlayer;
-
-public class ControlSpeciesBox
- extends ControlListBox<IAlleleSpecies>
-{
- public IWidget createOption(IAlleleSpecies value, int y)
- {
- return new ControlSpeciexBoxOption((ControlList)getContent(), value, y);
- }
-
- public ControlSpeciesBox(IWidget parent, float x, float y, float width, float height)
- {
- super(parent, x, y, width, height, 12.0F);
- }
-
- private IClassification branch = null;
-
- public void setBranch(IClassification branch)
- {
- if (branch != this.branch)
- {
- this.branch = branch;
- List<IAlleleSpecies> speciesList2 = new ArrayList();
- movePercentage(-100.0F);
- setOptions(speciesList2);
-
- EntityPlayer player = Window.get(this).getPlayer();
- GameProfile playerName = Window.get(this).getUsername();
- WindowAbstractDatabase db = (WindowAbstractDatabase)Window.get(this);
-
- Collection<IAlleleSpecies> speciesList = !db.isNEI ? db.getBreedingSystem().getDiscoveredSpecies(db.getWorld(), playerName) : db.getBreedingSystem().getAllSpecies();
- if (branch != null) {
- for (IAlleleSpecies species : branch.getMemberSpecies()) {
- if (speciesList.contains(species)) {
- speciesList2.add(species);
- }
- }
- }
- setOptions(speciesList2);
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/ControlSpeciexBoxOption.java b/src/Java/binnie/craftgui/mod/database/ControlSpeciexBoxOption.java
deleted file mode 100644
index 36ac5446b2..0000000000
--- a/src/Java/binnie/craftgui/mod/database/ControlSpeciexBoxOption.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.listbox.ControlList;
-import binnie.craftgui.controls.listbox.ControlTextOption;
-import binnie.craftgui.core.Attribute;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.geometry.CraftGUIUtil;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.renderer.Renderer;
-import forestry.api.genetics.IAlleleSpecies;
-
-class ControlSpeciexBoxOption
- extends ControlTextOption<IAlleleSpecies>
-{
- private ControlDatabaseIndividualDisplay controlBee;
-
- public ControlSpeciexBoxOption(ControlList<IAlleleSpecies> controlList, IAlleleSpecies option, int y)
- {
- super(controlList, option, option.getName(), y);
- setSize(new IPoint(getSize().x(), 20.0F));
-
- this.controlBee = new ControlDatabaseIndividualDisplay(this, 2.0F, 2.0F);
-
- this.controlBee.setSpecies((IAlleleSpecies)getValue(), EnumDiscoveryState.Undetermined);
- if (this.controlBee.discovered == EnumDiscoveryState.Discovered) {
- this.controlBee.discovered = EnumDiscoveryState.Show;
- }
- this.textWidget.setValue(this.controlBee.discovered == EnumDiscoveryState.Show ? option.getName() : "Undiscovered");
- if (this.controlBee.discovered == EnumDiscoveryState.Show) {
- addAttribute(Attribute.MouseOver);
- }
- CraftGUIUtil.moveWidget(this.textWidget, new IPoint(22.0F, 0.0F));
- this.textWidget.setSize(this.textWidget.getSize().sub(new IPoint(24.0F, 0.0F)));
-
- int th = (int)CraftGUI.Render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
- int height = Math.max(20, th + 6);
- setSize(new IPoint(size().x(), height));
- this.textWidget.setSize(new IPoint(this.textWidget.getSize().x(), height));
- this.controlBee.setPosition(new IPoint(this.controlBee.pos().x(), (height - 18) / 2));
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/DatabaseTab.java b/src/Java/binnie/craftgui/mod/database/DatabaseTab.java
deleted file mode 100644
index aee8ea5bf2..0000000000
--- a/src/Java/binnie/craftgui/mod/database/DatabaseTab.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.Binnie;
-import binnie.core.AbstractMod;
-import binnie.core.language.ManagerLanguage;
-import binnie.craftgui.core.ITooltipHelp;
-import binnie.craftgui.core.Tooltip;
-
-public class DatabaseTab
- implements ITooltipHelp
-{
- private AbstractMod mod;
- private String unloc;
- private int colour;
-
- public DatabaseTab(AbstractMod mod, String unloc, int colour)
- {
- this.mod = mod;
- this.unloc = unloc;
- this.colour = colour;
- }
-
- public String toString()
- {
- return Binnie.Language.localise(this.mod, "gui.database.tab." + this.unloc);
- }
-
- public void getHelpTooltip(Tooltip tooltip)
- {
- tooltip.add(Binnie.Language.localiseOrBlank(this.mod, "gui.database.tab." + this.unloc + ".help"));
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/EnumDiscoveryState.java b/src/Java/binnie/craftgui/mod/database/EnumDiscoveryState.java
deleted file mode 100644
index fe98cff136..0000000000
--- a/src/Java/binnie/craftgui/mod/database/EnumDiscoveryState.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package binnie.craftgui.mod.database;
-
-public enum EnumDiscoveryState
-{
- Show, Undetermined, Discovered, Undiscovered;
-
- private EnumDiscoveryState() {}
-}
diff --git a/src/Java/binnie/craftgui/mod/database/IDatabaseMode.java b/src/Java/binnie/craftgui/mod/database/IDatabaseMode.java
deleted file mode 100644
index 8744a2f0b7..0000000000
--- a/src/Java/binnie/craftgui/mod/database/IDatabaseMode.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package binnie.craftgui.mod.database;
-
-public abstract interface IDatabaseMode
-{
- public abstract String getName();
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageAbstract.java b/src/Java/binnie/craftgui/mod/database/PageAbstract.java
deleted file mode 100644
index 9219dca0a7..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageAbstract.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.page.ControlPage;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IPoint;
-
-public abstract class PageAbstract<T>
- extends ControlPage<DatabaseTab>
-{
- public PageAbstract(IWidget parent, DatabaseTab tab)
- {
- super(parent, 0.0F, 0.0F, parent.getSize().x(), parent.getSize().y(), tab);
- }
-
- public abstract void onValueChanged(T paramT);
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageBranch.java b/src/Java/binnie/craftgui/mod/database/PageBranch.java
deleted file mode 100644
index 57af5128e5..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageBranch.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.core.IWidget;
-import forestry.api.genetics.IClassification;
-
-abstract class PageBranch
- extends PageAbstract<IClassification>
-{
- public PageBranch(IWidget parent, DatabaseTab tab)
- {
- super(parent, tab);
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageBranchOverview.java b/src/Java/binnie/craftgui/mod/database/PageBranchOverview.java
deleted file mode 100644
index 57ddc63fab..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageBranchOverview.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.ControlTextCentered;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.renderer.Renderer;
-import forestry.api.genetics.IAlleleSpecies;
-import forestry.api.genetics.IClassification;
-import java.util.ArrayList;
-import java.util.List;
-
-public class PageBranchOverview
- extends PageBranch
-{
- private ControlText pageBranchOverview_branchName;
- private ControlText pageBranchOverview_branchScientific;
- private ControlText pageBranchOverview_branchAuthority;
-
- public PageBranchOverview(IWidget parent, DatabaseTab tab)
- {
- super(parent, tab);
-
- this.pageBranchOverview_branchName = new ControlTextCentered(this, 8.0F, "");
-
- this.pageBranchOverview_branchScientific = new ControlTextCentered(this, 32.0F, "");
- this.pageBranchOverview_branchAuthority = new ControlTextCentered(this, 44.0F, "");
- }
-
- private List<ControlText> pageBranchOverview_branchDescription = new ArrayList();
-
- public void onValueChanged(IClassification branch)
- {
- this.pageBranchOverview_branchName.setValue("§n" + branch.getName() + " Branch§r");
-
- this.pageBranchOverview_branchScientific.setValue("§oApidae " + branch.getScientific() + "§r");
-
- this.pageBranchOverview_branchAuthority.setValue("Discovered by §l" + branch.getMemberSpecies()[0].getAuthority() + "§r");
- for (IWidget widget : this.pageBranchOverview_branchDescription) {
- deleteChild(widget);
- }
- this.pageBranchOverview_branchDescription.clear();
-
- String desc = branch.getDescription();
- if ((desc == null) || (desc == "")) {
- desc = "No Description Provided.";
- }
- String line = "";
-
- List<String> descLines = new ArrayList();
- for (String str : desc.split(" "))
- {
- if (CraftGUI.Render.textWidth(line + " " + str) > 134)
- {
- descLines.add("§o" + line + "§r");
- line = "";
- }
- line = line + " " + str;
- }
- descLines.add(line);
-
- int i = 0;
- for (String dLine : descLines) {
- this.pageBranchOverview_branchDescription.add(new ControlTextCentered(this, 84 + 12 * i++, dLine));
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageBranchSpecies.java b/src/Java/binnie/craftgui/mod/database/PageBranchSpecies.java
deleted file mode 100644
index 600ca66674..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageBranchSpecies.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.ControlTextCentered;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.events.EventValueChanged;
-import binnie.craftgui.events.EventValueChanged.Handler;
-import cpw.mods.fml.common.Mod.EventHandler;
-import forestry.api.genetics.IAlleleSpecies;
-import forestry.api.genetics.IClassification;
-
-public class PageBranchSpecies
- extends PageBranch
-{
- private ControlText pageBranchSpecies_title;
- private ControlSpeciesBox pageBranchSpecies_speciesList;
-
- @Mod.EventHandler
- public void onHandleEvent(EventValueChanged<IAlleleSpecies> event) {}
-
- public PageBranchSpecies(IWidget parent, DatabaseTab tab)
- {
- super(parent, tab);
-
- this.pageBranchSpecies_title = new ControlTextCentered(this, 8.0F, "Species");
-
- addEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- if (event.isOrigin(PageBranchSpecies.this.pageBranchSpecies_speciesList)) {
- ((WindowAbstractDatabase)PageBranchSpecies.this.getSuperParent()).gotoSpecies((IAlleleSpecies)event.getValue());
- }
- }
- });
- this.pageBranchSpecies_speciesList = new ControlSpeciesBox(this, 4.0F, 20.0F, 136.0F, 152.0F);
- }
-
- public void onValueChanged(IClassification branch)
- {
- this.pageBranchSpecies_speciesList.setBranch(branch);
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageBreeder.java b/src/Java/binnie/craftgui/mod/database/PageBreeder.java
deleted file mode 100644
index d3f0b7b617..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageBreeder.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.core.genetics.BreedingSystem;
-import binnie.craftgui.controls.ControlTextCentered;
-import binnie.craftgui.controls.page.ControlPage;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.minecraft.Window;
-import com.mojang.authlib.GameProfile;
-import java.util.List;
-
-public class PageBreeder
- extends ControlPage<DatabaseTab>
-{
- private GameProfile player;
-
- public PageBreeder(IWidget parent, GameProfile player, DatabaseTab tab)
- {
- super(parent, 0.0F, 0.0F, parent.getSize().x(), parent.getSize().y(), tab);
-
- this.player = player;
- onPageRefresh();
- }
-
- public void onPageRefresh()
- {
- while (getWidgets().size() > 0) {
- deleteChild((IWidget)getWidgets().get(0));
- }
- BreedingSystem system = ((WindowAbstractDatabase)Window.get(this)).getBreedingSystem();
-
- String descriptor = system.getDescriptor();
-
- new ControlTextCentered(this, 8.0F, "§n" + system.getDescriptor() + " Profile§r");
-
- new ControlTextCentered(this, 75.0F, "" + system.discoveredSpeciesCount + "/" + system.totalSpeciesCount + " Species");
-
-
- new ControlBreedingProgress(this, 20, 87, 102, 14, system, system.discoveredSpeciesPercentage);
-
- new ControlTextCentered(this, 115.0F, "" + system.discoveredBranchCount + "/" + system.totalBranchCount + " Branches");
-
-
- new ControlBreedingProgress(this, 20, 127, 102, 14, system, system.discoveredBranchPercentage);
- if (system.discoveredSecretCount > 0) {
- new ControlTextCentered(this, 155.0F, "" + system.discoveredSecretCount + "/" + system.totalSecretCount + " Secret Species");
- }
- new ControlTextCentered(this, 32.0F, this.player.getName());
- new ControlTextCentered(this, 44.0F, "§o" + system.getEpitome() + "§r");
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageBreederStats.java b/src/Java/binnie/craftgui/mod/database/PageBreederStats.java
deleted file mode 100644
index 18c1f288d5..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageBreederStats.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.core.genetics.BreedingSystem;
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.ControlTextCentered;
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.IWidget;
-
-public class PageBreederStats
- extends Control
-{
- String player;
-
- public PageBreederStats(IWidget parent, int w, int h, String player)
- {
- super(parent, 0.0F, 0.0F, w, h);
- this.player = player;
-
- ControlText pageBranchOverview_branchName = new ControlTextCentered(this, 8.0F, "§nStats§r");
-
- BreedingSystem system = ((WindowAbstractDatabase)getSuperParent()).getBreedingSystem();
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageSpecies.java b/src/Java/binnie/craftgui/mod/database/PageSpecies.java
deleted file mode 100644
index c94984bd3a..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageSpecies.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.core.IWidget;
-import forestry.api.genetics.IAlleleSpecies;
-
-public abstract class PageSpecies
- extends PageAbstract<IAlleleSpecies>
-{
- public PageSpecies(IWidget parent, DatabaseTab tab)
- {
- super(parent, tab);
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageSpeciesClassification.java b/src/Java/binnie/craftgui/mod/database/PageSpeciesClassification.java
deleted file mode 100644
index 3db09e32cf..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageSpeciesClassification.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.ControlTextCentered;
-import binnie.craftgui.core.IWidget;
-import forestry.api.genetics.IAlleleSpecies;
-import forestry.api.genetics.IClassification;
-import forestry.api.genetics.IClassification.EnumClassLevel;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public class PageSpeciesClassification
- extends PageSpecies
-{
- private Map<IClassification.EnumClassLevel, ControlText> levels = new LinkedHashMap();
- private ControlText genus;
-
- public PageSpeciesClassification(IWidget parent, DatabaseTab tab)
- {
- super(parent, tab);
- int y = 16;
- for (IClassification.EnumClassLevel level : IClassification.EnumClassLevel.values())
- {
- ControlText text = new ControlTextCentered(this, y, "");
- text.setColour(level.getColour());
- this.levels.put(level, text);
- y += 12;
- }
- this.genus = new ControlTextCentered(this, y, "");
- this.genus.setColour(16759415);
- }
-
- public void onValueChanged(IAlleleSpecies species)
- {
- if (species != null)
- {
- for (ControlText text : this.levels.values()) {
- text.setValue("- - -");
- }
- this.genus.setValue(species.getBinomial());
-
- IClassification classification = species.getBranch();
- while (classification != null)
- {
- IClassification.EnumClassLevel level = classification.getLevel();
- String text = "";
- int n = level.ordinal();
- text = text + classification.getScientific();
- ((ControlText)this.levels.get(level)).setValue(text);
- classification = classification.getParent();
- }
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageSpeciesMutations.java b/src/Java/binnie/craftgui/mod/database/PageSpeciesMutations.java
deleted file mode 100644
index 16a6e6673a..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageSpeciesMutations.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.ControlTextCentered;
-import binnie.craftgui.core.IWidget;
-import forestry.api.genetics.IAlleleSpecies;
-
-public class PageSpeciesMutations
- extends PageSpecies
-{
- private ControlText pageSpeciesFurther_Title;
- private ControlMutationBox pageSpeciesFurther_List;
-
- public PageSpeciesMutations(IWidget parent, DatabaseTab tab)
- {
- super(parent, tab);
-
- this.pageSpeciesFurther_Title = new ControlTextCentered(this, 8.0F, "Further Mutations");
-
- this.pageSpeciesFurther_List = new ControlMutationBox(this, 4, 20, 136, 152, ControlMutationBox.Type.Further);
- }
-
- public void onValueChanged(IAlleleSpecies species)
- {
- this.pageSpeciesFurther_List.setSpecies(species);
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageSpeciesOverview.java b/src/Java/binnie/craftgui/mod/database/PageSpeciesOverview.java
deleted file mode 100644
index 083162e902..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageSpeciesOverview.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.ControlTextCentered;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.TextJustification;
-import binnie.craftgui.core.renderer.Renderer;
-import forestry.api.genetics.IAlleleSpecies;
-import forestry.api.genetics.IClassification;
-
-public class PageSpeciesOverview
- extends PageSpecies
-{
- private ControlText controlName;
- private ControlText controlScientific;
- private ControlText controlAuthority;
- private ControlText controlComplexity;
- private ControlText controlDescription;
- private ControlText controlSignature;
- private ControlDatabaseIndividualDisplay controlInd1;
- private ControlDatabaseIndividualDisplay controlInd2;
-
- public PageSpeciesOverview(IWidget parent, DatabaseTab tab)
- {
- super(parent, tab);
-
- this.controlInd1 = new ControlDatabaseIndividualDisplay(this, 5.0F, 5.0F);
- this.controlInd2 = new ControlDatabaseIndividualDisplay(this, 123.0F, 5.0F);
-
- this.controlName = new ControlTextCentered(this, 8.0F, "");
-
- this.controlScientific = new ControlTextCentered(this, 32.0F, "");
- this.controlAuthority = new ControlTextCentered(this, 44.0F, "");
- this.controlComplexity = new ControlTextCentered(this, 56.0F, "");
-
- this.controlDescription = new ControlText(this, new IArea(8.0F, 84.0F, getSize().x() - 16.0F, 0.0F), "", TextJustification.MiddleCenter);
-
- this.controlSignature = new ControlText(this, new IArea(8.0F, 84.0F, getSize().x() - 16.0F, 0.0F), "", TextJustification.BottomRight);
- }
-
- public void onValueChanged(IAlleleSpecies species)
- {
- this.controlInd1.setSpecies(species, EnumDiscoveryState.Show);
- this.controlInd2.setSpecies(species, EnumDiscoveryState.Show);
- String branchBinomial = species.getBranch() != null ? species.getBranch().getScientific() : "<Unknown>";
-
- String branchName = species.getBranch() != null ? species.getBranch().getName() : "Unknown";
-
-
- this.controlName.setValue("§n" + species.getName() + "§r");
- this.controlScientific.setValue("§o" + branchBinomial + " " + species.getBinomial() + "§r");
-
- this.controlAuthority.setValue("Discovered by §l" + species.getAuthority() + "§r");
-
- this.controlComplexity.setValue("Complexity: " + species.getComplexity());
-
-
-
- String desc = species.getDescription();
-
- String descBody = "§o";
- String descSig = "";
- if ((desc == null) || (desc == ""))
- {
- descBody = descBody + "No Description Provided.";
- }
- else
- {
- String[] descStrings = desc.split("\\|");
- descBody = descBody + descStrings[0];
- for (int i = 1; i < descStrings.length - 1; i++) {
- descBody = descBody + " " + descStrings[i];
- }
- if (descStrings.length > 1) {
- descSig = descSig + descStrings[(descStrings.length - 1)];
- }
- }
- this.controlDescription.setValue(descBody + "§r");
- this.controlSignature.setValue(descSig + "§r");
-
- float descHeight = CraftGUI.Render.textHeight(this.controlDescription.getValue(), this.controlDescription.getSize().x());
-
- this.controlSignature.setPosition(new IPoint(this.controlSignature.pos().x(), this.controlDescription.getPosition().y() + descHeight + 10.0F));
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/PageSpeciesResultant.java b/src/Java/binnie/craftgui/mod/database/PageSpeciesResultant.java
deleted file mode 100644
index f6f2d487c0..0000000000
--- a/src/Java/binnie/craftgui/mod/database/PageSpeciesResultant.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.controls.ControlTextCentered;
-import binnie.craftgui.core.IWidget;
-import forestry.api.genetics.IAlleleSpecies;
-
-public class PageSpeciesResultant
- extends PageSpecies
-{
- private ControlText pageSpeciesResultant_Title;
- private ControlMutationBox pageSpeciesResultant_List;
-
- public PageSpeciesResultant(IWidget parent, DatabaseTab tab)
- {
- super(parent, tab);
-
- this.pageSpeciesResultant_Title = new ControlTextCentered(this, 8.0F, "Resultant Mutations");
-
- this.pageSpeciesResultant_List = new ControlMutationBox(this, 4, 20, 136, 152, ControlMutationBox.Type.Resultant);
- }
-
- public void onValueChanged(IAlleleSpecies species)
- {
- this.pageSpeciesResultant_List.setSpecies(species);
- }
-}
diff --git a/src/Java/binnie/craftgui/mod/database/WindowAbstractDatabase.java b/src/Java/binnie/craftgui/mod/database/WindowAbstractDatabase.java
deleted file mode 100644
index 54ca5a4aca..0000000000
--- a/src/Java/binnie/craftgui/mod/database/WindowAbstractDatabase.java
+++ /dev/null
@@ -1,314 +0,0 @@
-package binnie.craftgui.mod.database;
-
-import binnie.core.BinnieCore;
-import binnie.core.genetics.BreedingSystem;
-import binnie.core.proxy.BinnieProxy;
-import binnie.core.util.IValidator;
-import binnie.craftgui.controls.ControlTextEdit;
-import binnie.craftgui.controls.listbox.ControlListBox;
-import binnie.craftgui.controls.listbox.ControlTextOption;
-import binnie.craftgui.controls.page.ControlPage;
-import binnie.craftgui.controls.page.ControlPages;
-import binnie.craftgui.controls.tab.ControlTab;
-import binnie.craftgui.controls.tab.ControlTabBar;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.CraftGUIUtil;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IPoint;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.events.EventHandler.Origin;
-import binnie.craftgui.events.EventTextEdit;
-import binnie.craftgui.events.EventTextEdit.Handler;
-import binnie.craftgui.events.EventValueChanged;
-import binnie.craftgui.events.EventValueChanged.Handler;
-import binnie.craftgui.minecraft.MinecraftGUI.PanelType;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.control.ControlHelp;
-import binnie.craftgui.window.Panel;
-import com.mojang.authlib.GameProfile;
-import cpw.mods.fml.relauncher.Side;
-import forestry.api.genetics.IAlleleSpecies;
-import forestry.api.genetics.IBreedingTracker;
-import forestry.api.genetics.IClassification;
-import forestry.api.genetics.ISpeciesRoot;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import net.minecraft.entity.player.EntityPlayer;
-
-public abstract class WindowAbstractDatabase
- extends Window
-{
- private float selectionBoxWidth = 95.0F;
- private final float infoBoxWidth = 144.0F;
- private final float infoBoxHeight = 176.0F;
- private final float infoTabWidth = 16.0F;
- private final float modeTabWidth = 22.0F;
- private final float searchBoxHeight = 16.0F;
-
- public void changeMode(IDatabaseMode mode)
- {
- this.modePages.setValue(mode);
- }
-
- public WindowAbstractDatabase(EntityPlayer player, Side side, boolean nei, BreedingSystem system, float wid)
- {
- super(100.0F, 192.0F, player, null, side);
- this.isNEI = nei;
- this.system = system;
- this.selectionBoxWidth = wid;
- }
-
- public static enum Mode
- implements IDatabaseMode
- {
- Species, Branches, Breeder;
-
- private Mode() {}
-
- public String getName()
- {
- return BinnieCore.proxy.localise("gui.database.mode." + name().toLowerCase());
- }
- }
-
- public static abstract class ModeWidgets
- {
- public WindowAbstractDatabase database;
- public ControlPage<IDatabaseMode> modePage;
- private ControlPages<DatabaseTab> infoPages;
- public ControlListBox listBox;
- private ControlTabBar<DatabaseTab> infoTabs;
-
- public ModeWidgets(IDatabaseMode mode, WindowAbstractDatabase database)
- {
- this.database = database;
- this.modePage = new ControlPage(database.modePages, 0.0F, 0.0F, database.getSize().x(), database.getSize().y(), mode);
-
- IArea listBoxArea = database.panelSearch.area().inset(2);
-
- createListBox(listBoxArea);
-
- CraftGUIUtil.alignToWidget(this.listBox, database.panelSearch);
- CraftGUIUtil.moveWidget(this.listBox, new IPoint(2.0F, 2.0F));
-
- this.infoPages = new ControlPages(this.modePage, 0.0F, 0.0F, 144.0F, 176.0F);
-
- CraftGUIUtil.alignToWidget(this.infoPages, database.panelInformation);
- }
-
- public abstract void createListBox(IArea paramIArea);
- }
-
- public ControlPages<DatabaseTab> getInfoPages(IDatabaseMode mode)
- {
- return ((ModeWidgets)this.modes.get(mode)).infoPages;
- }
-
- private Map<IDatabaseMode, ModeWidgets> modes = new HashMap();
- boolean isNEI;
- private BreedingSystem system;
-
- public boolean isNEI()
- {
- return this.isNEI;
- }
-
- public BreedingSystem getBreedingSystem()
- {
- return this.system;
- }
-
- public WindowAbstractDatabase(EntityPlayer player, Side side, boolean nei, BreedingSystem system)
- {
- this(player, side, nei, system, 95.0F);
- }
-
- private Panel panelInformation = null;
- private Panel panelSearch = null;
- private ControlPages<IDatabaseMode> modePages = null;
-
- protected ModeWidgets createMode(IDatabaseMode mode, ModeWidgets widgets)
- {
- this.modes.put(mode, widgets);
-
- return widgets;
- }
-
- public void initialiseClient()
- {
- setSize(new IPoint(176.0F + this.selectionBoxWidth + 22.0F + 8.0F, 208.0F));
-
- addEventHandler(new EventValueChanged.Handler()
- {
- public void onEvent(EventValueChanged event)
- {
- if (((event.getOrigin().getParent() instanceof ControlPage)) && (!(event.getValue() instanceof DatabaseTab)))
- {
- ControlPage parent = (ControlPage)event.getOrigin().getParent();
- if ((parent.getValue() instanceof IDatabaseMode)) {
- for (IWidget widget : parent.getWidgets()) {
- if ((widget instanceof ControlPages)) {
- if (event.getValue() == null)
- {
- widget.hide();
- }
- else
- {
- widget.show();
- for (IWidget widget2 : widget.getWidgets()) {
- if ((widget2 instanceof PageAbstract)) {
- ((PageAbstract)widget2).onValueChanged(event.getValue());
- }
- }
- }
- }
- }
- }
- }
- }
- });
- addEventHandler(new EventTextEdit.Handler()
- {
- public void onEvent(final EventTextEdit event)
- {
- for (WindowAbstractDatabase.ModeWidgets widgets : WindowAbstractDatabase.this.modes.values()) {
- widgets.listBox.setValidator(new IValidator()
- {
- public boolean isValid(IWidget object)
- {
- return (event.getValue() == "") || (((ControlTextOption)object).getText().toLowerCase().contains(((String)event.getValue()).toLowerCase()));
- }
- });
- }
- }
- }.setOrigin(EventHandler.Origin.DirectChild, this));
-
-
-
-
-
-
-
-
-
-
-
-
- new ControlHelp(this, 4.0F, 4.0F);
-
- this.panelInformation = new Panel(this, 24.0F, 24.0F, 144.0F, 176.0F, MinecraftGUI.PanelType.Black);
- this.panelInformation.setColour(860416);
-
- this.panelSearch = new Panel(this, 176.0F, 24.0F, this.selectionBoxWidth, 160.0F, MinecraftGUI.PanelType.Black);
-
- this.panelSearch.setColour(860416);
-
- this.modePages = new ControlPages(this, 0.0F, 0.0F, getSize().x(), getSize().y());
-
- new ControlTextEdit(this, 176.0F, 184.0F, this.selectionBoxWidth, 16.0F);
-
-
- createMode(Mode.Species, new ModeWidgets(Mode.Species, this)
- {
- public void createListBox(IArea area)
- {
- GameProfile playerName = WindowAbstractDatabase.this.getUsername();
-
- Collection<IAlleleSpecies> speciesList = !this.database.isNEI ? this.database.system.getDiscoveredSpecies(this.database.getWorld(), playerName) : this.database.system.getAllSpecies();
-
-
- this.listBox = new ControlSpeciesBox(this.modePage, area.x(), area.y(), area.w(), area.h());
- this.listBox.setOptions(speciesList);
- }
- });
- createMode(Mode.Branches, new ModeWidgets(Mode.Branches, this)
- {
- public void createListBox(IArea area)
- {
- EntityPlayer player = this.database.getPlayer();
- GameProfile playerName = WindowAbstractDatabase.this.getUsername();
-
- Collection<IClassification> speciesList = !this.database.isNEI ? this.database.system.getDiscoveredBranches(this.database.getWorld(), playerName) : this.database.system.getAllBranches();
-
-
- this.listBox = new ControlBranchBox(this.modePage, area.x(), area.y(), area.w(), area.h());
- this.listBox.setOptions(speciesList);
- }
- });
- createMode(Mode.Breeder, new ModeWidgets(Mode.Breeder, this)
- {
- public void createListBox(IArea area)
- {
- this.listBox = new ControlListBox(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0F);
- }
- });
- addTabs();
-
- ControlTabBar<IDatabaseMode> tab = new ControlTabBar(this, 176.0F + this.selectionBoxWidth, 24.0F, 22.0F, 176.0F, Position.Right)
- {
- public ControlTab<IDatabaseMode> createTab(float x, float y, float w, float h, IDatabaseMode value)
- {
- new ControlTab(this, x, y, w, h, value)
- {
- public String getName()
- {
- return ((IDatabaseMode)this.value).getName();
- }
- };
- }
- };
- tab.setValues(this.modePages.getValues());
-
- CraftGUIUtil.linkWidgets(tab, this.modePages);
-
-
- changeMode(Mode.Species);
- for (IDatabaseMode mode : this.modes.keySet())
- {
- ((ModeWidgets)this.modes.get(mode)).infoTabs = new ControlTabBar(((ModeWidgets)this.modes.get(mode)).modePage, 8.0F, 24.0F, 16.0F, 176.0F, Position.Left);
-
-
- ((ModeWidgets)this.modes.get(mode)).infoTabs.setValues(((ModeWidgets)this.modes.get(mode)).infoPages.getValues());
-
- CraftGUIUtil.linkWidgets(((ModeWidgets)this.modes.get(mode)).infoTabs, ((ModeWidgets)this.modes.get(mode)).infoPages);
- }
- }
-
- public void initialiseServer()
- {
- IBreedingTracker tracker = this.system.getSpeciesRoot().getBreedingTracker(getWorld(), getUsername());
- if (tracker != null) {
- tracker.synchToPlayer(getPlayer());
- }
- }
-
- protected void addTabs() {}
-
- public void gotoSpecies(IAlleleSpecies value)
- {
- if (value != null)
- {
- this.modePages.setValue(Mode.Species);
- changeMode(Mode.Species);
- ((ModeWidgets)this.modes.get(this.modePages.getValue())).listBox.setValue(value);
- }
- }
-
- public void gotoSpeciesDelayed(IAlleleSpecies species)
- {
- this.gotoSpecies = species;
- }
-
- private IAlleleSpecies gotoSpecies = null;
-
- public void onUpdateClient()
- {
- super.onUpdateClient();
- if (this.gotoSpecies != null)
- {
- ((WindowAbstractDatabase)getSuperParent()).gotoSpecies(this.gotoSpecies);
- this.gotoSpecies = null;
- }
- }
-}
diff --git a/src/Java/binnie/craftgui/resource/IStyleSheet.java b/src/Java/binnie/craftgui/resource/IStyleSheet.java
deleted file mode 100644
index 1ce8e7da2c..0000000000
--- a/src/Java/binnie/craftgui/resource/IStyleSheet.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package binnie.craftgui.resource;
-
-public abstract interface IStyleSheet
-{
- public abstract Texture getTexture(Object paramObject);
-}
diff --git a/src/Java/binnie/craftgui/resource/StyleSheet.java b/src/Java/binnie/craftgui/resource/StyleSheet.java
deleted file mode 100644
index 8685abd5be..0000000000
--- a/src/Java/binnie/craftgui/resource/StyleSheet.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package binnie.craftgui.resource;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class StyleSheet
- implements IStyleSheet
-{
- protected Map<Object, Texture> textures = new HashMap();
-
- public Texture getTexture(Object key)
- {
- if (!this.textures.containsKey(key)) {
- return StyleSheetManager.getTexture(key);
- }
- return (Texture)this.textures.get(key);
- }
-}
diff --git a/src/Java/binnie/craftgui/resource/StyleSheetManager.java b/src/Java/binnie/craftgui/resource/StyleSheetManager.java
deleted file mode 100644
index b1bbd50272..0000000000
--- a/src/Java/binnie/craftgui/resource/StyleSheetManager.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package binnie.craftgui.resource;
-
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.resource.minecraft.CraftGUIResourceManager;
-
-public class StyleSheetManager
-{
- static IStyleSheet defaultSS = new DefaultStyleSheet(null);
-
- public static Texture getTexture(Object key)
- {
- return defaultSS.getTexture(key);
- }
-
- private static class DefaultStyleSheet
- implements IStyleSheet
- {
- public Texture getTexture(Object key)
- {
- return CraftGUI.ResourceManager.getTexture(key.toString());
- }
- }
-
- public static IStyleSheet getDefault()
- {
- return defaultSS;
- }
-}
diff --git a/src/Java/binnie/craftgui/resource/Texture.java b/src/Java/binnie/craftgui/resource/Texture.java
deleted file mode 100644
index 249be8f257..0000000000
--- a/src/Java/binnie/craftgui/resource/Texture.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package binnie.craftgui.resource;
-
-import binnie.core.resource.BinnieResource;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IBorder;
-import binnie.craftgui.core.geometry.Position;
-
-public class Texture
-{
- public static final Texture NULL = null;
- IArea area;
- IBorder padding = IBorder.ZERO;
- IBorder border = IBorder.ZERO;
- BinnieResource filename;
-
- public Texture(IArea area, BinnieResource filename)
- {
- this(area, IBorder.ZERO, IBorder.ZERO, filename);
- }
-
- public Texture(IArea area, IBorder padding, BinnieResource filename)
- {
- this(area, padding, IBorder.ZERO, filename);
- }
-
- public Texture(IArea area, IBorder padding, IBorder border, BinnieResource filename)
- {
- this.area = new IArea(area);
- this.padding = new IBorder(padding);
- this.border = new IBorder(border);
- this.filename = filename;
- }
-
- public IArea getArea()
- {
- return this.area;
- }
-
- public IBorder getPadding()
- {
- return this.padding;
- }
-
- public IBorder getBorder()
- {
- return this.border;
- }
-
- public BinnieResource getFilename()
- {
- return this.filename;
- }
-
- public IBorder getTotalPadding()
- {
- return this.padding.add(this.border);
- }
-
- public float w()
- {
- return getArea().w();
- }
-
- public float h()
- {
- return getArea().h();
- }
-
- public float u()
- {
- return getArea().x();
- }
-
- public float v()
- {
- return getArea().y();
- }
-
- public Texture crop(Position anchor, float dist)
- {
- return crop(new IBorder(anchor.opposite(), dist));
- }
-
- public Texture crop(IBorder crop)
- {
- Texture copy = new Texture(this.area, this.padding, this.border, this.filename);
- if (crop.b() > 0.0F)
- {
- copy.border.b(0.0F);
- copy.padding.b(copy.padding.b() - Math.min(crop.b(), copy.padding.b()));
- copy.area.h(copy.area.h() - crop.b());
- }
- if (crop.t() > 0.0F)
- {
- copy.border.t(0.0F);
- copy.padding.t(copy.padding.t() - Math.min(crop.t(), copy.padding.t()));
- copy.area.h(copy.area.h() - crop.t());
- copy.area.y(copy.area.y() + crop.t());
- }
- if (crop.r() > 0.0F)
- {
- copy.border.r(0.0F);
- copy.padding.r(copy.padding.r() - Math.min(crop.r(), copy.padding.r()));
- copy.area.w(copy.area.w() - crop.r());
- }
- if (crop.l() > 0.0F)
- {
- copy.border.l(0.0F);
- copy.padding.l(copy.padding.l() - Math.min(crop.l(), copy.padding.l()));
- copy.area.w(copy.area.w() - crop.l());
- copy.area.x(copy.area.x() + crop.l());
- }
- return copy;
- }
-
- public String toString()
- {
- String out = "Texture[";
- out = out + this.area.toString();
- if (!this.padding.isNonZero()) {
- out = out + " padding:" + this.padding.toString();
- }
- if (!this.border.isNonZero()) {
- out = out + " border:" + this.border.toString();
- }
- return out + "]";
- }
-}
diff --git a/src/Java/binnie/craftgui/resource/minecraft/CraftGUIResourceManager.java b/src/Java/binnie/craftgui/resource/minecraft/CraftGUIResourceManager.java
deleted file mode 100644
index 42ff445f92..0000000000
--- a/src/Java/binnie/craftgui/resource/minecraft/CraftGUIResourceManager.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package binnie.craftgui.resource.minecraft;
-
-import binnie.core.resource.IBinnieTexture;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IBorder;
-import binnie.craftgui.resource.Texture;
-import com.google.common.base.Charsets;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParseException;
-import com.google.gson.JsonParser;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import net.minecraft.client.resources.IResource;
-import net.minecraft.client.resources.IResourceManager;
-import net.minecraft.client.resources.IResourceManagerReloadListener;
-import net.minecraft.util.ResourceLocation;
-import org.apache.commons.io.IOUtils;
-
-@SideOnly(Side.CLIENT)
-public class CraftGUIResourceManager
- implements IResourceManagerReloadListener
-{
- private Map<String, ParsedTextureSheet> textureSheets = new HashMap();
- private Map<String, Texture> textures = new HashMap();
-
- public CraftGUIResourceManager()
- {
- binnie.craftgui.core.CraftGUI.ResourceManager = this;
- }
-
- public void onResourceManagerReload(IResourceManager manager)
- {
- this.textureSheets.clear();
- try
- {
- IResource res = manager.getResource(new ResourceLocation("binniecore", "gui/stylesheet.json"));
-
- JsonObject jsonobject = null;
- BufferedReader bufferedreader = null;
- try
- {
- bufferedreader = new BufferedReader(new InputStreamReader(res.getInputStream(), Charsets.UTF_8));
- jsonobject = new JsonParser().parse(bufferedreader).getAsJsonObject();
- for (JsonElement el : jsonobject.get("texture-sheets").getAsJsonArray()) {
- if ((el instanceof JsonObject))
- {
- JsonObject sheet = (JsonObject)el;
- String name = sheet.get("name").getAsString();
- String modid = sheet.get("modid").getAsString();
- String path = sheet.get("path").getAsString();
- this.textureSheets.put(name, new ParsedTextureSheet(name, modid, path));
- }
- }
- for (JsonElement el : jsonobject.get("textures").getAsJsonArray()) {
- if ((el instanceof JsonObject))
- {
- JsonObject sheet = (JsonObject)el;
- String name = sheet.get("name").getAsString();
- IBinnieTexture textureSheet = getTextureSheet(sheet.get("sheet").getAsString());
- IArea uv = getArea(sheet.get("uv").getAsString());
- IBorder border = IBorder.ZERO;
- IBorder padding = IBorder.ZERO;
- if (sheet.has("border")) {
- border = getBorder(sheet.get("border").getAsString());
- }
- if (sheet.has("padding")) {
- padding = getBorder(sheet.get("padding").getAsString());
- }
- this.textures.put(name, new Texture(uv, padding, border, textureSheet.getTexture()));
- }
- }
- }
- catch (RuntimeException runtimeexception)
- {
- throw new JsonParseException("Failed to parse stylesheet for Binnie's Mods", runtimeexception);
- }
- finally
- {
- IOUtils.closeQuietly(bufferedreader);
- }
- }
- catch (IOException e)
- {
- throw new RuntimeException("Failed to load default stylesheet for Binnie's Mods.", e);
- }
- }
-
- public IArea getArea(String name)
- {
- String[] split = name.split(" ");
- if ((split.length < 1) || (split.length > 4)) {
- throw new RuntimeException("Parameter must have between one and four numbers");
- }
- List<Float> f = new ArrayList();
- for (String string : split) {
- f.add(Float.valueOf(Float.parseFloat(string)));
- }
- if (f.size() == 1) {
- return new IArea(((Float)f.get(0)).floatValue());
- }
- if (f.size() == 2) {
- return new IArea(((Float)f.get(0)).floatValue(), ((Float)f.get(1)).floatValue());
- }
- if (f.size() == 3) {
- return new IArea(((Float)f.get(0)).floatValue(), ((Float)f.get(1)).floatValue(), ((Float)f.get(2)).floatValue());
- }
- return new IArea(((Float)f.get(0)).floatValue(), ((Float)f.get(1)).floatValue(), ((Float)f.get(2)).floatValue(), ((Float)f.get(3)).floatValue());
- }
-
- public IBorder getBorder(String name)
- {
- String[] split = name.split(" ");
- if ((split.length < 1) || (split.length > 4)) {
- throw new RuntimeException("Parameter must have between one and four numbers");
- }
- List<Float> f = new ArrayList();
- for (String string : split) {
- f.add(Float.valueOf(Float.parseFloat(string)));
- }
- if (f.size() == 1) {
- return new IBorder(((Float)f.get(0)).floatValue());
- }
- if (f.size() == 2) {
- return new IBorder(((Float)f.get(0)).floatValue(), ((Float)f.get(1)).floatValue());
- }
- if (f.size() == 3) {
- return new IBorder(((Float)f.get(0)).floatValue(), ((Float)f.get(1)).floatValue(), ((Float)f.get(2)).floatValue());
- }
- return new IBorder(((Float)f.get(0)).floatValue(), ((Float)f.get(1)).floatValue(), ((Float)f.get(2)).floatValue(), ((Float)f.get(3)).floatValue());
- }
-
- public IBinnieTexture getTextureSheet(String name)
- {
- if (!this.textureSheets.containsKey(name)) {
- throw new RuntimeException("Missing GUI texture sheet for Binnie Mods: " + name);
- }
- return (IBinnieTexture)this.textureSheets.get(name);
- }
-
- public Texture getTexture(String name)
- {
- if (!this.textures.containsKey(name)) {
- throw new RuntimeException("Missing GUI texture Binnie Mods: " + name);
- }
- return (Texture)this.textures.get(name);
- }
-}
diff --git a/src/Java/binnie/craftgui/resource/minecraft/CraftGUITexture.java b/src/Java/binnie/craftgui/resource/minecraft/CraftGUITexture.java
deleted file mode 100644
index cb1ca27bd5..0000000000
--- a/src/Java/binnie/craftgui/resource/minecraft/CraftGUITexture.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package binnie.craftgui.resource.minecraft;
-
-public enum CraftGUITexture
-{
- Window("window"), PanelGray("panel.gray"), PanelBlack("panel.black"), PanelTinted("panel.tinted"), ButtonDisabled("button.disabled"), Button("button"), ButtonHighlighted("button.highlighted"), Slot("slot"), SlotBorder("slot.border"), SlotOverlay("slot.overlay"), SlotCharge("slot.charge"), LiquidTank("liquidtank"), LiquidTankOverlay("liquidtank.overlay"), StateError("errorstate.error"), StateWarning("errorstate.warning"), StateNone("errorstate.none"), EnergyBarBack("energybar.back"), EnergyBarGlow("energybar.glow"), EnergyBarGlass("energybar.glass"), TabDisabled("tab.disabled"), Tab("tab"), TabHighlighted("tab.highlighted"), TabOutline("tab.outline"), TabSolid("tab.solid"), ScrollDisabled("scroll.disabled"), Scroll("scroll"), ScrollHighlighted("scroll.highlighted"), Outline("outline"), HelpButton("button.help"), InfoButton("button.info"), UserButton("button.user"), PowerButton("button.power"), HorizontalLiquidTank("horizontalliquidtank"), HorizontalLiquidTankOverlay("horizontalliquidtank.overlay"), SlideUp("slide.up"), SlideDown("slide.down"), SlideLeft("slide.left"), SlideRight("slide.right"), Checkbox("checkbox"), CheckboxHighlighted("checkbox.highlighted"), CheckboxChecked("checkbox.checked"), CheckboxCheckedHighlighted("checkbox.checked.highlighted");
-
- String name;
-
- private CraftGUITexture(String name)
- {
- this.name = name;
- }
-
- public String toString()
- {
- return this.name;
- }
-}
diff --git a/src/Java/binnie/craftgui/resource/minecraft/CraftGUITextureSheet.java b/src/Java/binnie/craftgui/resource/minecraft/CraftGUITextureSheet.java
deleted file mode 100644
index 816a422749..0000000000
--- a/src/Java/binnie/craftgui/resource/minecraft/CraftGUITextureSheet.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package binnie.craftgui.resource.minecraft;
-
-import binnie.core.BinnieCore;
-import binnie.core.proxy.BinnieProxy;
-import binnie.core.resource.BinnieResource;
-import binnie.core.resource.IBinnieTexture;
-import binnie.craftgui.core.CraftGUI;
-
-public enum CraftGUITextureSheet
- implements IBinnieTexture
-{
- Controls2("controls"), Panel2("panels"), Slots("slots");
-
- String name;
-
- private CraftGUITextureSheet(String name)
- {
- this.name = name;
- }
-
- public String toString()
- {
- return this.name;
- }
-
- public BinnieResource getTexture()
- {
- if (BinnieCore.proxy.isServer()) {
- return null;
- }
- return CraftGUI.ResourceManager.getTextureSheet(this.name).getTexture();
- }
-}
diff --git a/src/Java/binnie/craftgui/resource/minecraft/PaddedTexture.java b/src/Java/binnie/craftgui/resource/minecraft/PaddedTexture.java
deleted file mode 100644
index a682d0b37d..0000000000
--- a/src/Java/binnie/craftgui/resource/minecraft/PaddedTexture.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package binnie.craftgui.resource.minecraft;
-
-import binnie.core.resource.BinnieResource;
-import binnie.core.resource.IBinnieTexture;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IBorder;
-import binnie.craftgui.resource.Texture;
-
-public class PaddedTexture
- extends Texture
-{
- public PaddedTexture(int u, int v, int w, int h, int offset, IBinnieTexture textureFile, int leftPadding, int rightPadding, int topPadding, int bottomPadding)
- {
- this(u, v, w, h, offset, textureFile.getTexture(), leftPadding, rightPadding, topPadding, bottomPadding);
- }
-
- public PaddedTexture(int u, int v, int w, int h, int offset, BinnieResource textureFile, int leftPadding, int rightPadding, int topPadding, int bottomPadding)
- {
- super(new IArea(u, v, w, h), new IBorder(topPadding, rightPadding, bottomPadding, leftPadding), new IBorder(offset), textureFile);
- }
-}
diff --git a/src/Java/binnie/craftgui/resource/minecraft/ParsedTextureSheet.java b/src/Java/binnie/craftgui/resource/minecraft/ParsedTextureSheet.java
deleted file mode 100644
index 4a10017b7c..0000000000
--- a/src/Java/binnie/craftgui/resource/minecraft/ParsedTextureSheet.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package binnie.craftgui.resource.minecraft;
-
-import binnie.core.resource.BinnieResource;
-import binnie.core.resource.IBinnieTexture;
-import binnie.core.resource.ResourceType;
-
-class ParsedTextureSheet
- implements IBinnieTexture
-{
- private String name;
- private String modid;
- private String path;
-
- public ParsedTextureSheet(String name, String modid, String path)
- {
- this.name = name;
- this.modid = modid;
- this.path = path;
- }
-
- public BinnieResource getTexture()
- {
- return new BinnieResource(this.modid, ResourceType.GUI, this.path);
- }
-}
diff --git a/src/Java/binnie/craftgui/resource/minecraft/StandardTexture.java b/src/Java/binnie/craftgui/resource/minecraft/StandardTexture.java
deleted file mode 100644
index b98facb505..0000000000
--- a/src/Java/binnie/craftgui/resource/minecraft/StandardTexture.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package binnie.craftgui.resource.minecraft;
-
-import binnie.core.resource.BinnieResource;
-import binnie.core.resource.IBinnieTexture;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.IBorder;
-import binnie.craftgui.resource.Texture;
-
-public class StandardTexture
- extends Texture
-{
- public StandardTexture(int u, int v, int w, int h, IBinnieTexture textureFile)
- {
- this(u, v, w, h, 0, textureFile.getTexture());
- }
-
- public StandardTexture(int u, int v, int w, int h, int offset, IBinnieTexture textureFile)
- {
- this(u, v, w, h, offset, textureFile.getTexture());
- }
-
- public StandardTexture(int u, int v, int w, int h, BinnieResource textureFile)
- {
- this(u, v, w, h, 0, textureFile);
- }
-
- public StandardTexture(int u, int v, int w, int h, int padding, BinnieResource textureFile)
- {
- super(new IArea(u, v, w, h), IBorder.ZERO, new IBorder(padding), textureFile);
- }
-
- public BinnieResource getTexture()
- {
- return getFilename();
- }
-}
diff --git a/src/Java/binnie/craftgui/window/Panel.java b/src/Java/binnie/craftgui/window/Panel.java
deleted file mode 100644
index 3b305f6d69..0000000000
--- a/src/Java/binnie/craftgui/window/Panel.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package binnie.craftgui.window;
-
-import binnie.craftgui.controls.core.Control;
-import binnie.craftgui.core.CraftGUI;
-import binnie.craftgui.core.IWidget;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.renderer.Renderer;
-import binnie.craftgui.minecraft.MinecraftGUI.PanelType;
-import binnie.craftgui.resource.minecraft.CraftGUITexture;
-
-public class Panel
- extends Control
-{
- IPanelType type;
-
- public Panel(IWidget parent, float x, float y, float width, float height, IPanelType type)
- {
- super(parent, x, y, width, height);
- this.type = type;
- }
-
- public Panel(IWidget parent, IArea area, IPanelType type)
- {
- this(parent, area.x(), area.y(), area.w(), area.h(), type);
- }
-
- public IPanelType getType()
- {
- return this.type;
- }
-
- public void onRenderBackground()
- {
- IPanelType panelType = getType();
- if ((panelType instanceof MinecraftGUI.PanelType)) {
- switch (1.$SwitchMap$binnie$craftgui$minecraft$MinecraftGUI$PanelType[((MinecraftGUI.PanelType)panelType).ordinal()])
- {
- case 1:
- CraftGUI.Render.texture(CraftGUITexture.PanelBlack, getArea());
- break;
- case 2:
- CraftGUI.Render.texture(CraftGUITexture.PanelGray, getArea());
- break;
- case 3:
- CraftGUI.Render.texture(CraftGUITexture.PanelTinted, getArea());
- break;
- case 4:
- CraftGUI.Render.texture(CraftGUITexture.Outline, getArea());
- break;
- case 5:
- CraftGUI.Render.texture(CraftGUITexture.TabOutline, getArea());
- break;
- }
- }
- }
-
- public static abstract interface IPanelType {}
-}
diff --git a/src/Java/binnie/extrabees/ExtraBees.java b/src/Java/binnie/extrabees/ExtraBees.java
deleted file mode 100644
index ef93560cc0..0000000000
--- a/src/Java/binnie/extrabees/ExtraBees.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package binnie.extrabees;
-
-import binnie.core.AbstractMod;
-import binnie.core.BinnieCore;
-import binnie.core.gui.IBinnieGUID;
-import binnie.core.network.BinniePacketHandler;
-import binnie.core.proxy.IProxyCore;
-import binnie.extrabees.apiary.ModuleApiary;
-import binnie.extrabees.config.ConfigurationMachines;
-import binnie.extrabees.config.ConfigurationMain;
-import binnie.extrabees.core.ExtraBeeGUID;
-import binnie.extrabees.core.ModuleCore;
-import binnie.extrabees.genetics.ModuleGenetics;
-import binnie.extrabees.liquids.ModuleLiquids;
-import binnie.extrabees.products.ModuleProducts;
-import binnie.extrabees.proxy.ExtraBeesProxy;
-import binnie.extrabees.worldgen.ModuleGeneration;
-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.SidedProxy;
-import cpw.mods.fml.common.event.FMLInitializationEvent;
-import cpw.mods.fml.common.event.FMLPostInitializationEvent;
-import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.item.Item;
-
-@Mod(modid="ExtraBees", name="Extra Bees", useMetadata=true, dependencies="after:BinnieCore")
-public class ExtraBees
- extends AbstractMod
-{
- @Mod.Instance("ExtraBees")
- public static ExtraBees instance;
- @SidedProxy(clientSide="binnie.extrabees.proxy.ExtraBeesProxyClient", serverSide="binnie.extrabees.proxy.ExtraBeesProxyServer")
- public static ExtraBeesProxy proxy;
- public static Block hive;
- public static Material materialBeehive;
- public static Block ectoplasm;
- public static Block apiaristMachine;
- public static Block geneticMachine;
- public static Block advGeneticMachine;
- public static Item comb;
- public static Item propolis;
- public static Item honeyDrop;
- public static Item honeyCrystal;
- public static Item honeyCrystalEmpty;
- public static Item dictionary;
- public static Item itemMisc;
-
- @Mod.EventHandler
- public void preInit(FMLPreInitializationEvent evt)
- {
- addModule(new ModuleCore());
- addModule(new ModuleProducts());
- addModule(new ModuleGenetics());
- addModule(new ModuleGeneration());
- addModule(new ModuleLiquids());
- addModule(new ModuleApiary());
- preInit();
- }
-
- @Mod.EventHandler
- public void init(FMLInitializationEvent evt)
- {
- init();
- }
-
- @Mod.EventHandler
- public void postInit(FMLPostInitializationEvent evt)
- {
- postInit();
- }
-
- public ExtraBees()
- {
- instance = this;
- }
-
- public IBinnieGUID[] getGUIDs()
- {
- return ExtraBeeGUID.values();
- }
-
- public Class<?>[] getConfigs()
- {
- return new Class[] { ConfigurationMain.class, ConfigurationMachines.class };
- }
-
- public IProxyCore getProxy()
- {
- return proxy;
- }
-
- public String getChannel()
- {
- return "EB";
- }
-
- public String getModID()
- {
- return "extrabees";
- }
-
- protected Class<? extends BinniePacketHandler> getPacketHandler()
- {
- return PacketHandler.class;
- }
-
- public static class PacketHandler
- extends BinniePacketHandler
- {
- public PacketHandler()
- {
- super();
- }
- }
-
- public boolean isActive()
- {
- return BinnieCore.isExtraBeesActive();
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/ComponentBeeModifier.java b/src/Java/binnie/extrabees/apiary/ComponentBeeModifier.java
deleted file mode 100644
index 32cb7dcd48..0000000000
--- a/src/Java/binnie/extrabees/apiary/ComponentBeeModifier.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package binnie.extrabees.apiary;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachineComponent;
-import forestry.api.apiculture.IBee;
-import forestry.api.apiculture.IBeeGenome;
-import forestry.api.apiculture.IBeeListener;
-import forestry.api.apiculture.IBeeModifier;
-import forestry.api.genetics.IIndividual;
-import net.minecraft.item.ItemStack;
-
-public class ComponentBeeModifier
- extends MachineComponent
- implements IBeeModifier, IBeeListener
-{
- public ComponentBeeModifier(Machine machine)
- {
- super(machine);
- }
-
- public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
- {
- return 1.0F;
- }
-
- public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return 1.0F;
- }
-
- public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return 1.0F;
- }
-
- public float getProductionModifier(IBeeGenome genome, float currentModifier)
- {
- return 1.0F;
- }
-
- public float getFloweringModifier(IBeeGenome genome, float currentModifier)
- {
- return 1.0F;
- }
-
- public boolean isSealed()
- {
- return false;
- }
-
- public boolean isSelfLighted()
- {
- return false;
- }
-
- public boolean isSunlightSimulated()
- {
- return false;
- }
-
- public boolean isHellish()
- {
- return false;
- }
-
- public void onQueenChange(ItemStack queen) {}
-
- public void wearOutEquipment(int amount) {}
-
- public void onQueenDeath(IBee queen) {}
-
- public void onPostQueenDeath(IBee queen) {}
-
- public boolean onPollenRetrieved(IBee queen, IIndividual pollen, boolean isHandled)
- {
- return false;
- }
-
- public boolean onEggLaid(IBee queen)
- {
- return false;
- }
-
- public float getGeneticDecay(IBeeGenome genome, float currentModifier)
- {
- return 1.0F;
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/ComponentExtraBeeGUI.java b/src/Java/binnie/extrabees/apiary/ComponentExtraBeeGUI.java
deleted file mode 100644
index db2527e14c..0000000000
--- a/src/Java/binnie/extrabees/apiary/ComponentExtraBeeGUI.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package binnie.extrabees.apiary;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachineComponent;
-import binnie.core.machines.component.IInteraction.RightClick;
-import binnie.extrabees.ExtraBees;
-import binnie.extrabees.core.ExtraBeeGUID;
-import binnie.extrabees.proxy.ExtraBeesProxy;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.world.World;
-
-public class ComponentExtraBeeGUI
- extends MachineComponent
- implements IInteraction.RightClick
-{
- ExtraBeeGUID id;
-
- public ComponentExtraBeeGUI(Machine machine, ExtraBeeGUID id)
- {
- super(machine);
- this.id = id;
- }
-
- public void onRightClick(World world, EntityPlayer player, int x, int y, int z)
- {
- ExtraBees.proxy.openGui(this.id, player, x, y, z);
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/EnumHiveFrame.java b/src/Java/binnie/extrabees/apiary/EnumHiveFrame.java
deleted file mode 100644
index 6a135c2532..0000000000
--- a/src/Java/binnie/extrabees/apiary/EnumHiveFrame.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package binnie.extrabees.apiary;
-
-import binnie.core.Mods;
-import binnie.core.Mods.Mod;
-import binnie.core.genetics.BeeModifierLogic;
-import binnie.core.genetics.EnumBeeBooleanModifier;
-import binnie.core.genetics.EnumBeeModifier;
-import binnie.extrabees.ExtraBees;
-import binnie.extrabees.proxy.ExtraBeesProxy;
-import cpw.mods.fml.common.registry.GameRegistry;
-import forestry.api.apiculture.IBee;
-import forestry.api.apiculture.IBeeGenome;
-import forestry.api.apiculture.IBeeHousing;
-import forestry.api.apiculture.IHiveFrame;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-
-public enum EnumHiveFrame
- implements IHiveFrame
-{
- Cocoa, Cage, Soul, Clay, Debug;
-
- Item item;
-
- public static void init()
- {
- Cocoa.logic.setModifier(EnumBeeModifier.Lifespan, 0.75F, 0.25F);
- Cocoa.logic.setModifier(EnumBeeModifier.Production, 1.5F, 5.0F);
-
- Cage.logic.setModifier(EnumBeeModifier.Territory, 0.5F, 0.1F);
- Cage.logic.setModifier(EnumBeeModifier.Lifespan, 0.75F, 0.5F);
- Cage.logic.setModifier(EnumBeeModifier.Production, 0.75F, 0.5F);
-
- Soul.logic.setModifier(EnumBeeModifier.Mutation, 1.5F, 5.0F);
- Soul.logic.setModifier(EnumBeeModifier.Lifespan, 0.75F, 0.5F);
- Soul.logic.setModifier(EnumBeeModifier.Production, 0.25F, 0.1F);
- Soul.setMaxDamage(80);
-
- Clay.logic.setModifier(EnumBeeModifier.Lifespan, 1.5F, 5.0F);
- Clay.logic.setModifier(EnumBeeModifier.Mutation, 0.5F, 0.2F);
- Clay.logic.setModifier(EnumBeeModifier.Production, 0.75F, 0.2F);
-
- Debug.logic.setModifier(EnumBeeModifier.Lifespan, 1.0E-004F, 1.0E-004F);
-
-
-
- GameRegistry.addRecipe(new ItemStack(Cocoa.item), new Object[] { " c ", "cFc", " c ", Character.valueOf('F'), Mods.Forestry.stack("frameImpregnated"), Character.valueOf('c'), new ItemStack(Items.dye, 1, 3) });
-
-
-
- GameRegistry.addShapelessRecipe(new ItemStack(Cage.item), new Object[] { Mods.Forestry.stack("frameImpregnated"), Blocks.iron_bars });
-
-
- GameRegistry.addShapelessRecipe(new ItemStack(Soul.item), new Object[] { Mods.Forestry.stack("frameImpregnated"), Blocks.soul_sand });
-
-
- GameRegistry.addRecipe(new ItemStack(Clay.item), new Object[] { " c ", "cFc", " c ", Character.valueOf('F'), Mods.Forestry.stack("frameImpregnated"), Character.valueOf('c'), Items.clay_ball });
- }
-
- public int getIconIndex()
- {
- return 55 + ordinal();
- }
-
- public void setMaxDamage(int damage)
- {
- this.maxDamage = damage;
- }
-
- int maxDamage = 240;
- BeeModifierLogic logic = new BeeModifierLogic();
-
- private EnumHiveFrame() {}
-
- public ItemStack frameUsed(IBeeHousing house, ItemStack frame, IBee queen, int wear)
- {
- frame.setItemDamage(frame.getItemDamage() + wear);
- if (frame.getItemDamage() >= frame.getMaxDamage()) {
- return null;
- }
- return frame;
- }
-
- public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.Territory, currentModifier);
- }
-
- public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.Mutation, currentModifier);
- }
-
- public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.Lifespan, currentModifier);
- }
-
- public float getProductionModifier(IBeeGenome genome, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.Production, currentModifier);
- }
-
- public float getFloweringModifier(IBeeGenome genome, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.Flowering, currentModifier);
- }
-
- public float getGeneticDecay(IBeeGenome genome, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier);
- }
-
- public boolean isSealed()
- {
- return this.logic.getModifier(EnumBeeBooleanModifier.Sealed);
- }
-
- public boolean isSelfLighted()
- {
- return this.logic.getModifier(EnumBeeBooleanModifier.SelfLighted);
- }
-
- public boolean isSunlightSimulated()
- {
- return this.logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated);
- }
-
- public boolean isHellish()
- {
- return this.logic.getModifier(EnumBeeBooleanModifier.Hellish);
- }
-
- public String getName()
- {
- return ExtraBees.proxy.localise("item.frame." + toString().toLowerCase());
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/IndustrialFrame.java b/src/Java/binnie/extrabees/apiary/IndustrialFrame.java
deleted file mode 100644
index f8d3e5ff7a..0000000000
--- a/src/Java/binnie/extrabees/apiary/IndustrialFrame.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package binnie.extrabees.apiary;
-
-import forestry.api.apiculture.IBeeGenome;
-import forestry.api.apiculture.IBeeModifier;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-public enum IndustrialFrame
- implements IBeeModifier
-{
- Empty("Empty", 5, 0), Light("Glowstone Lighting", 2, 4), Rain("Rain Shielding", 2, 4), Sunlight("Sunlight Simulator", 4, 8), Soul("Low Grade Mutagen", 5, 15), Uranium("High Grade Mutagen", 10, 50), Cage("Meshed Restrainer", 3, 12), Freedom("Territory Extension", 3, 16), Honey("Honey Amplifier", 4, 12), Jelly("Gelatin Amplifier", 8, 36), Leaf("Pollinator MK I", 3, 15), Pollen("Pollinator MK II", 7, 25), Clay("Lifespan Extensor", 2, 10), Emerald("Eon Simulator", 7, 20), NetherStar("Immortality Gate", 12, 50), Poison("Mortality Inhibitor", 8, 18);
-
- String name;
-
- private IndustrialFrame(String name, int wear, int power)
- {
- this.name = name;
- this.wearMod = wear;
- this.power = power;
- }
-
- public static ItemStack getItemStack(Item item, IndustrialFrame frame)
- {
- ItemStack stack = new ItemStack(item);
- NBTTagCompound nbt = new NBTTagCompound();
- nbt.setInteger("frame", frame.ordinal());
- stack.setTagCompound(nbt);
- return stack;
- }
-
- static
- {
- Light.lighted = true;
-
- Rain.rain = true;
-
- Sunlight.lighted = true;
- Sunlight.sunlight = true;
-
- Soul.mutationMod = 1.3F;
-
- Uranium.mutationMod = 2.0F;
-
- Cage.territoryMod = 0.4F;
-
- Freedom.territoryMod = 1.4F;
-
- Honey.productionMod = 1.4F;
-
- Jelly.productionMod = 1.8F;
-
- Leaf.floweringMod = 1.4F;
-
- Pollen.floweringMod = 2.0F;
-
- Clay.lifespanMod = 1.4F;
-
- Emerald.lifespanMod = 2.0F;
-
- NetherStar.lifespanMod = 20.0F;
-
- Poison.lifespanMod = 0.5F;
- }
-
- float territoryMod = 1.0F;
- float mutationMod = 1.0F;
- float lifespanMod = 1.0F;
- float productionMod = 1.0F;
- float floweringMod = 1.0F;
- boolean lighted = false;
- boolean sunlight = false;
- boolean rain = false;
- int wearMod;
- int power;
-
- public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
- {
- return this.territoryMod;
- }
-
- public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return this.mutationMod;
- }
-
- public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return this.lifespanMod;
- }
-
- public float getProductionModifier(IBeeGenome genome, float currentModifier)
- {
- return this.productionMod;
- }
-
- public float getFloweringModifier(IBeeGenome genome, float currentModifier)
- {
- return this.floweringMod;
- }
-
- public boolean isSealed()
- {
- return this.rain;
- }
-
- public boolean isSelfLighted()
- {
- return this.lighted;
- }
-
- public boolean isSunlightSimulated()
- {
- return this.sunlight;
- }
-
- public boolean isHellish()
- {
- return false;
- }
-
- public Object getName()
- {
- return this.name;
- }
-
- public int getWearModifier()
- {
- return this.wearMod;
- }
-
- public int getPowerUsage()
- {
- return this.power;
- }
-
- public float getGeneticDecay(IBeeGenome genome, float currentModifier)
- {
- return 1.0F;
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/ItemHiveFrame.java b/src/Java/binnie/extrabees/apiary/ItemHiveFrame.java
deleted file mode 100644
index c2e8c27fbc..0000000000
--- a/src/Java/binnie/extrabees/apiary/ItemHiveFrame.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package binnie.extrabees.apiary;
-
-import binnie.extrabees.ExtraBees;
-import binnie.extrabees.proxy.ExtraBeesProxy;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import forestry.api.apiculture.IBee;
-import forestry.api.apiculture.IBeeGenome;
-import forestry.api.apiculture.IBeeHousing;
-import forestry.api.apiculture.IHiveFrame;
-import forestry.api.core.Tabs;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-
-public class ItemHiveFrame
- extends Item
- implements IHiveFrame
-{
- EnumHiveFrame frame;
-
- public String getItemStackDisplayName(ItemStack par1ItemStack)
- {
- return this.frame.getName();
- }
-
- public ItemHiveFrame(EnumHiveFrame frame)
- {
- this.frame = frame;
- setMaxDamage(frame.maxDamage);
- setCreativeTab(Tabs.tabApiculture);
- setMaxStackSize(1);
- setUnlocalizedName("hiveFrame");
- }
-
- public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
- {
- return this.frame.getTerritoryModifier(genome, currentModifier);
- }
-
- public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return this.frame.getMutationModifier(genome, mate, currentModifier);
- }
-
- public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return this.frame.getLifespanModifier(genome, mate, currentModifier);
- }
-
- public float getProductionModifier(IBeeGenome genome, float currentModifier)
- {
- return this.frame.getProductionModifier(genome, currentModifier);
- }
-
- public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
- {
- frame.setItemDamage(frame.getItemDamage() + wear);
- if (frame.getItemDamage() >= frame.getMaxDamage()) {
- return null;
- }
- return frame;
- }
-
- public float getFloweringModifier(IBeeGenome genome, float currentModifier)
- {
- return 1.0F;
- }
-
- public boolean isSealed()
- {
- return false;
- }
-
- public boolean isSelfLighted()
- {
- return false;
- }
-
- public boolean isSunlightSimulated()
- {
- return false;
- }
-
- public boolean isHellish()
- {
- return false;
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister register)
- {
- this.itemIcon = ExtraBees.proxy.getIcon(register, "frame" + this.frame.toString());
- }
-
- public float getGeneticDecay(IBeeGenome genome, float currentModifier)
- {
- return 1.0F;
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/ItemIndustrialFrame.java b/src/Java/binnie/extrabees/apiary/ItemIndustrialFrame.java
deleted file mode 100644
index 0450798b52..0000000000
--- a/src/Java/binnie/extrabees/apiary/ItemIndustrialFrame.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package binnie.extrabees.apiary;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import java.util.List;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class ItemIndustrialFrame
- extends Item
-{
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses()
- {
- return true;
- }
-
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List)
- {
- for (IndustrialFrame frame : )
- {
- ItemStack stack = new ItemStack(this);
- NBTTagCompound nbt = new NBTTagCompound();
- nbt.setInteger("frame", frame.ordinal());
- stack.setTagCompound(nbt);
- par3List.add(stack);
- }
- }
-
- @SideOnly(Side.CLIENT)
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
- {
- super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
- IndustrialFrame frame = getFrame(par1ItemStack);
- if (frame == null) {
- par3List.add("Invalid Contents");
- } else {
- par3List.add(frame.getName());
- }
- }
-
- public String getItemStackDisplayName(ItemStack par1ItemStack)
- {
- return "Industrial Frame";
- }
-
- public ItemIndustrialFrame()
- {
- setCreativeTab(CreativeTabs.tabMisc);
- setMaxDamage(400);
- setMaxStackSize(1);
- setUnlocalizedName("industrialFrame");
- }
-
- public static IndustrialFrame getFrame(ItemStack stack)
- {
- if ((stack == null) || (!stack.hasTagCompound()) || (!stack.getTagCompound().hasKey("frame"))) {
- return null;
- }
- return IndustrialFrame.values()[stack.getTagCompound().getInteger("frame")];
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/ModuleApiary.java b/src/Java/binnie/extrabees/apiary/ModuleApiary.java
deleted file mode 100644
index bcf9da626b..0000000000
--- a/src/Java/binnie/extrabees/apiary/ModuleApiary.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package binnie.extrabees.apiary;
-
-import binnie.core.BinnieCore;
-import binnie.core.IInitializable;
-import binnie.core.Mods;
-import binnie.core.Mods.Mod;
-import binnie.core.circuits.BinnieCircuitLayout;
-import binnie.core.machines.MachineGroup;
-import binnie.core.proxy.BinnieProxy;
-import binnie.extrabees.ExtraBees;
-import binnie.extrabees.apiary.machine.AlvearyMachine;
-import binnie.extrabees.apiary.machine.AlvearyMutator;
-import binnie.extrabees.apiary.machine.AlvearyStimulator.CircuitType;
-import cpw.mods.fml.common.registry.GameRegistry;
-import forestry.api.core.Tabs;
-import net.minecraft.block.Block;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.oredict.ShapedOreRecipe;
-
-public class ModuleApiary
- implements IInitializable
-{
- public static Block blockComponent;
- BinnieCircuitLayout stimulatorLayout;
-
- public void preInit()
- {
- MachineGroup machineGroup = new MachineGroup(ExtraBees.instance, "alveay", "alveary", AlvearyMachine.values());
- machineGroup.setCreativeTab(Tabs.tabApiculture);
-
- BinnieCore.proxy.registerTileEntity(TileExtraBeeAlveary.class, "extrabees.tile.alveary", BinnieCore.proxy.createObject("binnie.core.machines.RendererMachine"));
-
-
-
-
-
- blockComponent = machineGroup.getBlock();
-
- AlvearyMutator.addMutationItem(new ItemStack(Blocks.soul_sand), 1.5F);
-
- AlvearyMutator.addMutationItem(Mods.IC2.stack("UranFuel"), 4.0F);
- AlvearyMutator.addMutationItem(Mods.IC2.stack("MOXFuel"), 10.0F);
- AlvearyMutator.addMutationItem(Mods.IC2.stack("Plutonium"), 8.0F);
- AlvearyMutator.addMutationItem(Mods.IC2.stack("smallPlutonium"), 5.0F);
- AlvearyMutator.addMutationItem(Mods.IC2.stack("Uran235"), 4.0F);
- AlvearyMutator.addMutationItem(Mods.IC2.stack("smallUran235"), 2.5F);
- AlvearyMutator.addMutationItem(Mods.IC2.stack("Uran238"), 2.0F);
-
- AlvearyMutator.addMutationItem(new ItemStack(Items.ender_pearl), 2.0F);
- AlvearyMutator.addMutationItem(new ItemStack(Items.ender_eye), 4.0F);
- for (EnumHiveFrame frame : EnumHiveFrame.values())
- {
- frame.item = new ItemHiveFrame(frame);
- GameRegistry.registerItem(frame.item, "hiveFrame." + frame.name().toLowerCase());
- }
- }
-
- public void postInit()
- {
- EnumHiveFrame.init();
-
- GameRegistry.addRecipe(AlvearyMachine.Mutator.get(1), new Object[] { "g g", " a ", "t t", Character.valueOf('g'), Items.gold_ingot, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5) });
-
-
-
- GameRegistry.addRecipe(AlvearyMachine.Frame.get(1), new Object[] { "iii", "tat", " t ", Character.valueOf('i'), Items.iron_ingot, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) });
-
-
-
- GameRegistry.addRecipe(AlvearyMachine.RainShield.get(1), new Object[] { " b ", "bab", "t t", Character.valueOf('b'), Items.brick, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) });
-
-
-
-
- GameRegistry.addRecipe(AlvearyMachine.Lighting.get(1), new Object[] { "iii", "iai", " t ", Character.valueOf('i'), Items.glowstone_dust, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) });
-
-
- GameRegistry.addRecipe(AlvearyMachine.Stimulator.get(1), new Object[] { "kik", "iai", " t ", Character.valueOf('i'), Items.gold_nugget, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4), Character.valueOf('k'), new ItemStack(Mods.Forestry.item("chipsets"), 1, 2) });
-
-
- GameRegistry.addRecipe(AlvearyMachine.Hatchery.get(1), new Object[] { "i i", " a ", "iti", Character.valueOf('i'), Blocks.glass_pane, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5) });
-
-
- GameRegistry.addRecipe(new ShapedOreRecipe(AlvearyMachine.Transmission.get(1), new Object[] { " t ", "tat", " t ", Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), "gearTin" }));
- for (AlvearyStimulator.CircuitType type : AlvearyStimulator.CircuitType.values()) {
- type.createCircuit(this.stimulatorLayout);
- }
- }
-
- public void init()
- {
- this.stimulatorLayout = new BinnieCircuitLayout(ExtraBees.instance, "Stimulator");
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/TileExtraBeeAlveary.java b/src/Java/binnie/extrabees/apiary/TileExtraBeeAlveary.java
deleted file mode 100644
index 3edf7e4a9c..0000000000
--- a/src/Java/binnie/extrabees/apiary/TileExtraBeeAlveary.java
+++ /dev/null
@@ -1,355 +0,0 @@
-package binnie.extrabees.apiary;
-
-import binnie.Binnie;
-import binnie.core.BinnieCore;
-import binnie.core.genetics.ManagerGenetics;
-import binnie.core.machines.Machine;
-import binnie.core.machines.TileEntityMachine;
-import binnie.core.proxy.BinnieProxy;
-import binnie.extrabees.apiary.machine.AlvearyMachine.AlvearyPackage;
-import forestry.api.apiculture.IAlvearyComponent;
-import forestry.api.apiculture.IBee;
-import forestry.api.apiculture.IBeeGenome;
-import forestry.api.apiculture.IBeeHousing;
-import forestry.api.apiculture.IBeeListener;
-import forestry.api.apiculture.IBeeModifier;
-import forestry.api.apiculture.IBeeRoot;
-import forestry.api.core.IStructureLogic;
-import forestry.api.core.ITileStructure;
-import forestry.api.genetics.IIndividual;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.inventory.ISidedInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public class TileExtraBeeAlveary
- extends TileEntityMachine
- implements IAlvearyComponent, IBeeModifier, IBeeListener
-{
- boolean init = false;
- IStructureLogic structureLogic;
- private boolean isMaster;
- protected int masterX;
- protected int masterZ;
-
- public void updateEntity()
- {
- super.updateEntity();
- if (!BinnieCore.proxy.isSimulating(this.worldObj)) {
- return;
- }
- if (this.worldObj.getWorldTime() % 200L == 0L)
- {
- if ((!isIntegratedIntoStructure()) || (isMaster())) {
- validateStructure();
- }
- ITileStructure master = getCentralTE();
- if (master == null) {
- return;
- }
- if (getBeeListener() != null) {
- ((IAlvearyComponent)master).registerBeeListener(getBeeListener());
- }
- if (getBeeModifier() != null) {
- ((IAlvearyComponent)master).registerBeeModifier(getBeeModifier());
- }
- this.init = true;
- }
- }
-
- public void readFromNBT(NBTTagCompound nbttagcompound)
- {
- super.readFromNBT(nbttagcompound);
-
- this.isMaster = nbttagcompound.getBoolean("IsMaster");
- this.masterX = nbttagcompound.getInteger("MasterX");
- this.masterY = nbttagcompound.getInteger("MasterY");
- this.masterZ = nbttagcompound.getInteger("MasterZ");
- if (this.isMaster) {
- makeMaster();
- }
- this.structureLogic.readFromNBT(nbttagcompound);
-
- updateAlvearyBlocks();
-
- this.init = false;
- }
-
- public void writeToNBT(NBTTagCompound nbttagcompound)
- {
- super.writeToNBT(nbttagcompound);
-
- nbttagcompound.setBoolean("IsMaster", this.isMaster);
- nbttagcompound.setInteger("MasterX", this.masterX);
- nbttagcompound.setInteger("MasterY", this.masterY);
- nbttagcompound.setInteger("MasterZ", this.masterZ);
-
-
- this.structureLogic.writeToNBT(nbttagcompound);
- }
-
- AlvearyMachine.AlvearyPackage getAlvearyPackage()
- {
- return (AlvearyMachine.AlvearyPackage)getMachine().getPackage();
- }
-
- public TileExtraBeeAlveary()
- {
- this.structureLogic = Binnie.Genetics.getBeeRoot().createAlvearyStructureLogic(this);
- }
-
- public TileExtraBeeAlveary(AlvearyMachine.AlvearyPackage alvearyPackage)
- {
- super(alvearyPackage);
- this.structureLogic = Binnie.Genetics.getBeeRoot().createAlvearyStructureLogic(this);
- }
-
- public String getTypeUID()
- {
- return this.structureLogic.getTypeUID();
- }
-
- protected int masterY = -99;
-
- public void makeMaster() {}
-
- public void onStructureReset()
- {
- setCentralTE(null);
- this.isMaster = false;
- this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
- updateAlvearyBlocks();
- }
-
- public ITileStructure getCentralTE()
- {
- if ((this.worldObj == null) || (!isIntegratedIntoStructure())) {
- return null;
- }
- if (!isMaster())
- {
- TileEntity tile = this.worldObj.getTileEntity(this.masterX, this.masterY, this.masterZ);
- if ((tile instanceof ITileStructure))
- {
- ITileStructure master = (ITileStructure)this.worldObj.getTileEntity(this.masterX, this.masterY, this.masterZ);
- if (master.isMaster()) {
- return master;
- }
- return null;
- }
- return null;
- }
- return this;
- }
-
- public void validateStructure()
- {
- this.structureLogic.validateStructure();
- updateAlvearyBlocks();
- }
-
- private boolean isSameTile(TileEntity tile)
- {
- return (tile.xCoord == this.xCoord) && (tile.yCoord == this.yCoord) && (tile.zCoord == this.zCoord);
- }
-
- public void setCentralTE(TileEntity tile)
- {
- if ((tile == null) || (tile == this) || (isSameTile(tile)))
- {
- this.masterX = (this.masterZ = 0);
- this.masterY = -99;
- updateAlvearyBlocks();
- return;
- }
- this.isMaster = false;
- this.masterX = tile.xCoord;
- this.masterY = tile.yCoord;
- this.masterZ = tile.zCoord;
-
-
- markDirty();
- if (getBeeListener() != null) {
- ((IAlvearyComponent)tile).registerBeeListener(getBeeListener());
- }
- if (getBeeModifier() != null) {
- ((IAlvearyComponent)tile).registerBeeModifier(getBeeModifier());
- }
- updateAlvearyBlocks();
- }
-
- public boolean isMaster()
- {
- return this.isMaster;
- }
-
- protected boolean hasMaster()
- {
- return this.masterY >= 0;
- }
-
- public boolean isIntegratedIntoStructure()
- {
- return (this.isMaster) || (this.masterY >= 0);
- }
-
- public void registerBeeModifier(IBeeModifier modifier) {}
-
- public void removeBeeModifier(IBeeModifier modifier) {}
-
- public void addTemperatureChange(float change, float boundaryDown, float boundaryUp) {}
-
- public void addHumidityChange(float change, float boundaryDown, float boundaryUp) {}
-
- public boolean hasFunction()
- {
- return true;
- }
-
- public IBeeModifier getBeeModifier()
- {
- return (IBeeModifier)getMachine().getInterface(IBeeModifier.class);
- }
-
- public IBeeListener getBeeListener()
- {
- return (IBeeListener)getMachine().getInterface(IBeeListener.class);
- }
-
- public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
- {
- return getBeeModifier() == null ? 1.0F : getBeeModifier().getTerritoryModifier(genome, currentModifier);
- }
-
- public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return getBeeModifier() == null ? 1.0F : getBeeModifier().getMutationModifier(genome, mate, currentModifier);
- }
-
- public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return getBeeModifier() == null ? 1.0F : getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
- }
-
- public float getProductionModifier(IBeeGenome genome, float currentModifier)
- {
- return getBeeModifier() == null ? 1.0F : getBeeModifier().getProductionModifier(genome, currentModifier);
- }
-
- public float getFloweringModifier(IBeeGenome genome, float currentModifier)
- {
- return getBeeModifier() == null ? 1.0F : getBeeModifier().getFloweringModifier(genome, currentModifier);
- }
-
- public boolean isSealed()
- {
- return getBeeModifier() == null ? false : getBeeModifier().isSealed();
- }
-
- public boolean isSelfLighted()
- {
- return getBeeModifier() == null ? false : getBeeModifier().isSelfLighted();
- }
-
- public boolean isSunlightSimulated()
- {
- return getBeeModifier() == null ? false : getBeeModifier().isSunlightSimulated();
- }
-
- public boolean isHellish()
- {
- return getBeeModifier() == null ? false : getBeeModifier().isHellish();
- }
-
- public void registerBeeListener(IBeeListener event) {}
-
- public void removeBeeListener(IBeeListener event) {}
-
- public void onQueenChange(ItemStack queen)
- {
- if (getBeeListener() != null) {
- getBeeListener().onQueenChange(queen);
- }
- }
-
- public void wearOutEquipment(int amount)
- {
- if (getBeeListener() != null) {
- getBeeListener().wearOutEquipment(amount);
- }
- }
-
- public void onQueenDeath(IBee queen)
- {
- if (getBeeListener() != null) {
- getBeeListener().onQueenDeath(queen);
- }
- }
-
- public void onPostQueenDeath(IBee queen)
- {
- if (getBeeListener() != null) {
- getBeeListener().onPostQueenDeath(queen);
- }
- }
-
- public boolean onPollenRetrieved(IBee queen, IIndividual pollen, boolean isHandled)
- {
- return false;
- }
-
- public boolean onEggLaid(IBee queen)
- {
- return false;
- }
-
- public float getGeneticDecay(IBeeGenome genome, float currentModifier)
- {
- return 1.0F;
- }
-
- public IBeeHousing getBeeHousing()
- {
- return getCentralTE() == null ? null : (IBeeHousing)getCentralTE();
- }
-
- List<TileEntity> tiles = new ArrayList();
-
- public List<TileEntity> getAlvearyBlocks()
- {
- updateAlvearyBlocks();
- return this.tiles;
- }
-
- private void updateAlvearyBlocks()
- {
- this.tiles.clear();
- if (getCentralTE() != null)
- {
- ITileStructure struct = getCentralTE();
- if (!struct.isIntegratedIntoStructure()) {
- return;
- }
- TileEntity central = (TileEntity)struct;
- for (int x = -2; x <= 2; x++) {
- for (int z = -2; z <= 2; z++) {
- for (int y = -2; y <= 2; y++)
- {
- TileEntity tile = getWorldObj().getTileEntity(this.xCoord + x, this.yCoord + y, this.zCoord + z);
- if ((tile != null) && ((tile instanceof ITileStructure)) && (((ITileStructure)tile).getCentralTE() == struct)) {
- this.tiles.add(tile);
- }
- }
- }
- }
- }
- }
-
- public ISidedInventory getStructureInventory()
- {
- return (ISidedInventory)getMachine().getInterface(ISidedInventory.class);
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyFrame.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyFrame.java
deleted file mode 100644
index a910e101f9..0000000000
--- a/src/Java/binnie/extrabees/apiary/machine/AlvearyFrame.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package binnie.extrabees.apiary.machine;
-
-import binnie.Binnie;
-import binnie.core.genetics.ManagerGenetics;
-import binnie.core.machines.IMachine;
-import binnie.core.machines.Machine;
-import binnie.core.machines.inventory.ComponentInventorySlots;
-import binnie.core.machines.inventory.InventorySlot;
-import binnie.core.machines.inventory.SlotValidator;
-import binnie.craftgui.minecraft.IMachineInformation;
-import binnie.extrabees.apiary.ComponentBeeModifier;
-import binnie.extrabees.apiary.ComponentExtraBeeGUI;
-import binnie.extrabees.apiary.TileExtraBeeAlveary;
-import binnie.extrabees.core.ExtraBeeGUID;
-import binnie.extrabees.core.ExtraBeeTexture;
-import forestry.api.apiculture.IBeeGenome;
-import forestry.api.apiculture.IBeeHousing;
-import forestry.api.apiculture.IBeeListener;
-import forestry.api.apiculture.IBeeModifier;
-import forestry.api.apiculture.IBeeRoot;
-import forestry.api.apiculture.IBeekeepingMode;
-import forestry.api.apiculture.IHiveFrame;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public class AlvearyFrame
-{
- public static int slotFrame = 0;
-
- public static class PackageAlvearyFrame
- extends AlvearyMachine.AlvearyPackage
- implements IMachineInformation
- {
- public PackageAlvearyFrame()
- {
- super(ExtraBeeTexture.AlvearyFrame.getTexture(), false);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyFrame);
-
- ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
-
- inventory.addSlot(AlvearyFrame.slotFrame, "frame");
- inventory.getSlot(AlvearyFrame.slotFrame).setValidator(new AlvearyFrame.SlotValidatorFrame());
-
- new AlvearyFrame.ComponentFrameModifier(machine);
- }
- }
-
- public static class SlotValidatorFrame
- extends SlotValidator
- {
- public SlotValidatorFrame()
- {
- super();
- }
-
- public boolean isValid(ItemStack itemStack)
- {
- return (itemStack != null) && ((itemStack.getItem() instanceof IHiveFrame));
- }
-
- public String getTooltip()
- {
- return "Hive Frames";
- }
- }
-
- public static class ComponentFrameModifier
- extends ComponentBeeModifier
- implements IBeeModifier, IBeeListener
- {
- public ComponentFrameModifier(Machine machine)
- {
- super();
- }
-
- public void wearOutEquipment(int amount)
- {
- if (getHiveFrame() == null) {
- return;
- }
- World world = getMachine().getTileEntity().getWorldObj();
- int wear = Math.round(amount * 5 * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getWearModifier());
- getInventory().setInventorySlotContents(AlvearyFrame.slotFrame, getHiveFrame().frameUsed((IBeeHousing)((TileExtraBeeAlveary)getMachine().getTileEntity()).getCentralTE(), getInventory().getStackInSlot(AlvearyFrame.slotFrame), null, wear));
- }
-
- public IHiveFrame getHiveFrame()
- {
- if (getInventory().getStackInSlot(AlvearyFrame.slotFrame) != null) {
- return (IHiveFrame)getInventory().getStackInSlot(AlvearyFrame.slotFrame).getItem();
- }
- return null;
- }
-
- public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
- {
- return getHiveFrame() == null ? 1.0F : getHiveFrame().getTerritoryModifier(genome, currentModifier);
- }
-
- public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return getHiveFrame() == null ? 1.0F : getHiveFrame().getMutationModifier(genome, mate, currentModifier);
- }
-
- public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return getHiveFrame() == null ? 1.0F : getHiveFrame().getLifespanModifier(genome, mate, currentModifier);
- }
-
- public float getProductionModifier(IBeeGenome genome, float currentModifier)
- {
- return getHiveFrame() == null ? 1.0F : getHiveFrame().getProductionModifier(genome, currentModifier);
- }
-
- public float getFloweringModifier(IBeeGenome genome, float currentModifier)
- {
- return getHiveFrame() == null ? 1.0F : getHiveFrame().getFloweringModifier(genome, currentModifier);
- }
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyHatchery.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyHatchery.java
deleted file mode 100644
index 276683b860..0000000000
--- a/src/Java/binnie/extrabees/apiary/machine/AlvearyHatchery.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package binnie.extrabees.apiary.machine;
-
-import binnie.Binnie;
-import binnie.core.genetics.ManagerGenetics;
-import binnie.core.machines.IMachine;
-import binnie.core.machines.Machine;
-import binnie.core.machines.inventory.ComponentInventorySlots;
-import binnie.core.machines.inventory.InventorySlot;
-import binnie.core.machines.inventory.SlotValidator;
-import binnie.core.machines.transfer.TransferRequest;
-import binnie.craftgui.minecraft.IMachineInformation;
-import binnie.extrabees.apiary.ComponentBeeModifier;
-import binnie.extrabees.apiary.ComponentExtraBeeGUI;
-import binnie.extrabees.apiary.TileExtraBeeAlveary;
-import binnie.extrabees.core.ExtraBeeGUID;
-import binnie.extrabees.core.ExtraBeeTexture;
-import forestry.api.apiculture.EnumBeeType;
-import forestry.api.apiculture.IBee;
-import forestry.api.apiculture.IBeeHousing;
-import forestry.api.apiculture.IBeeListener;
-import forestry.api.apiculture.IBeeModifier;
-import forestry.api.apiculture.IBeeRoot;
-import forestry.core.EnumErrorCode;
-import java.util.Random;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-
-public class AlvearyHatchery
-{
- public static int[] slotLarvae = { 0, 1, 2, 3, 4 };
-
- public static class PackageAlvearyHatchery
- extends AlvearyMachine.AlvearyPackage
- implements IMachineInformation
- {
- public PackageAlvearyHatchery()
- {
- super(ExtraBeeTexture.AlvearyHatchery.getTexture(), false);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyHatchery);
-
- ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
- for (InventorySlot slot : inventory.addSlotArray(AlvearyHatchery.slotLarvae, "hatchery")) {
- slot.setValidator(new AlvearyHatchery.SlotValidatorLarvae());
- }
- new AlvearyHatchery.ComponentFrameModifier(machine);
- }
- }
-
- public static class SlotValidatorLarvae
- extends SlotValidator
- {
- public SlotValidatorLarvae()
- {
- super();
- }
-
- public boolean isValid(ItemStack itemStack)
- {
- return (Binnie.Genetics.getBeeRoot().isMember(itemStack)) && (Binnie.Genetics.getBeeRoot().getType(itemStack) == EnumBeeType.LARVAE);
- }
-
- public String getTooltip()
- {
- return "Larvae";
- }
- }
-
- public static class ComponentFrameModifier
- extends ComponentBeeModifier
- implements IBeeModifier, IBeeListener
- {
- public ComponentFrameModifier(Machine machine)
- {
- super();
- }
-
- public void onUpdate()
- {
- if (new Random().nextInt(2400) == 0)
- {
- TileEntity tile = getMachine().getTileEntity();
- if ((tile instanceof TileExtraBeeAlveary))
- {
- IBeeHousing house = ((TileExtraBeeAlveary)tile).getBeeHousing();
- if ((house != null) && (house.getErrorState() == EnumErrorCode.OK))
- {
- ItemStack queenStack = house.getQueen();
- IBee queen = queenStack == null ? null : Binnie.Genetics.getBeeRoot().getMember(queenStack);
- if (queen != null)
- {
- ItemStack larvae = Binnie.Genetics.getBeeRoot().getMemberStack(Binnie.Genetics.getBeeRoot().getBee(getMachine().getWorld(), queen.getGenome()), EnumBeeType.LARVAE.ordinal());
-
-
-
- new TransferRequest(larvae, getInventory()).transfer(true);
- }
- }
- }
- }
- }
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyLighting.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyLighting.java
deleted file mode 100644
index fad796c889..0000000000
--- a/src/Java/binnie/extrabees/apiary/machine/AlvearyLighting.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package binnie.extrabees.apiary.machine;
-
-import binnie.core.machines.Machine;
-import binnie.craftgui.minecraft.IMachineInformation;
-import binnie.extrabees.apiary.ComponentBeeModifier;
-import binnie.extrabees.core.ExtraBeeTexture;
-import forestry.api.apiculture.IBeeListener;
-import forestry.api.apiculture.IBeeModifier;
-
-public class AlvearyLighting
-{
- public static class PackageAlvearyLighting
- extends AlvearyMachine.AlvearyPackage
- implements IMachineInformation
- {
- public PackageAlvearyLighting()
- {
- super(ExtraBeeTexture.AlvearyLighting.getTexture(), false);
- }
-
- public void createMachine(Machine machine)
- {
- new AlvearyLighting.ComponentLighting(machine);
- }
- }
-
- public static class ComponentLighting
- extends ComponentBeeModifier
- implements IBeeModifier, IBeeListener
- {
- public ComponentLighting(Machine machine)
- {
- super();
- }
-
- public boolean isSelfLighted()
- {
- return true;
- }
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyMachine.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyMachine.java
deleted file mode 100644
index 2dc0410770..0000000000
--- a/src/Java/binnie/extrabees/apiary/machine/AlvearyMachine.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package binnie.extrabees.apiary.machine;
-
-import binnie.core.machines.IMachineType;
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachinePackage;
-import binnie.core.machines.MachineRendererBlock;
-import binnie.core.resource.BinnieResource;
-import binnie.extrabees.apiary.ModuleApiary;
-import binnie.extrabees.apiary.TileExtraBeeAlveary;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-
-public enum AlvearyMachine
- implements IMachineType
-{
- Mutator(AlvearyMutator.PackageAlvearyMutator.class), Frame(AlvearyFrame.PackageAlvearyFrame.class), RainShield(AlvearyRainShield.PackageAlvearyRainShield.class), Lighting(AlvearyLighting.PackageAlvearyLighting.class), Stimulator(AlvearyStimulator.PackageAlvearyStimulator.class), Hatchery(AlvearyHatchery.PackageAlvearyHatchery.class), Transmission(AlvearyTransmission.PackageAlvearyTransmission.class);
-
- Class<? extends MachinePackage> clss;
-
- private AlvearyMachine(Class<? extends MachinePackage> clss)
- {
- this.clss = clss;
- }
-
- public Class<? extends MachinePackage> getPackageClass()
- {
- return this.clss;
- }
-
- public ItemStack get(int size)
- {
- return new ItemStack(ModuleApiary.blockComponent, size, ordinal());
- }
-
- public static abstract class AlvearyPackage
- extends MachinePackage
- {
- BinnieResource machineTexture;
-
- public AlvearyPackage(String id, BinnieResource machineTexture, boolean powered)
- {
- super(powered);
- this.machineTexture = machineTexture;
- }
-
- public void createMachine(Machine machine) {}
-
- public TileEntity createTileEntity()
- {
- return new TileExtraBeeAlveary(this);
- }
-
- public void register() {}
-
- public void renderMachine(Machine machine, double x, double y, double z, float var8, RenderBlocks renderer)
- {
- MachineRendererBlock.instance.renderMachine(this.machineTexture, x, y, z, var8);
- }
- }
-
- public boolean isActive()
- {
- return true;
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyMutator.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyMutator.java
deleted file mode 100644
index 9c9fafc15a..0000000000
--- a/src/Java/binnie/extrabees/apiary/machine/AlvearyMutator.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package binnie.extrabees.apiary.machine;
-
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachineUtil;
-import binnie.core.machines.inventory.ComponentInventorySlots;
-import binnie.core.machines.inventory.InventorySlot;
-import binnie.core.machines.inventory.SlotValidator;
-import binnie.core.machines.inventory.ValidatorIcon;
-import binnie.craftgui.minecraft.IMachineInformation;
-import binnie.extrabees.ExtraBees;
-import binnie.extrabees.apiary.ComponentBeeModifier;
-import binnie.extrabees.apiary.ComponentExtraBeeGUI;
-import binnie.extrabees.core.ExtraBeeGUID;
-import binnie.extrabees.core.ExtraBeeTexture;
-import forestry.api.apiculture.IBee;
-import forestry.api.apiculture.IBeeGenome;
-import forestry.api.apiculture.IBeeListener;
-import forestry.api.apiculture.IBeeModifier;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import net.minecraft.item.ItemStack;
-
-public class AlvearyMutator
-{
- public static int slotMutator = 0;
-
- public static class PackageAlvearyMutator
- extends AlvearyMachine.AlvearyPackage
- implements IMachineInformation
- {
- public PackageAlvearyMutator()
- {
- super(ExtraBeeTexture.AlvearyMutator.getTexture(), false);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyMutator);
-
- ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
-
- inventory.addSlot(AlvearyMutator.slotMutator, "mutator");
- inventory.getSlot(AlvearyMutator.slotMutator).setValidator(new AlvearyMutator.SlotValidatorMutator());
-
- new AlvearyMutator.ComponentMutatorModifier(machine);
- }
- }
-
- public static class SlotValidatorMutator
- extends SlotValidator
- {
- public SlotValidatorMutator()
- {
- super();
- }
-
- public boolean isValid(ItemStack itemStack)
- {
- return AlvearyMutator.isMutationItem(itemStack);
- }
-
- public String getTooltip()
- {
- return "Mutagenic Agents";
- }
- }
-
- public static class ComponentMutatorModifier
- extends ComponentBeeModifier
- implements IBeeModifier, IBeeListener
- {
- public ComponentMutatorModifier(Machine machine)
- {
- super();
- }
-
- public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- if (getUtil().isSlotEmpty(AlvearyMutator.slotMutator)) {
- return 1.0F;
- }
- float mult = AlvearyMutator.getMutationMult(getUtil().getStack(AlvearyMutator.slotMutator));
- return Math.min(mult, 15.0F / currentModifier);
- }
-
- public void onPostQueenDeath(IBee queen)
- {
- getUtil().decreaseStack(AlvearyMutator.slotMutator, 1);
- }
- }
-
- static Map<ItemStack, Float> mutations = new HashMap();
-
- public static boolean isMutationItem(ItemStack item)
- {
- return getMutationMult(item) > 0.0F;
- }
-
- public static float getMutationMult(ItemStack item)
- {
- if (item == null) {
- return 1.0F;
- }
- for (ItemStack comp : mutations.keySet()) {
- if ((ItemStack.areItemStackTagsEqual(item, comp)) && (item.isItemEqual(comp))) {
- return ((Float)mutations.get(comp)).floatValue();
- }
- }
- return 1.0F;
- }
-
- public static void addMutationItem(ItemStack item, float chance)
- {
- if (item == null) {
- return;
- }
- mutations.put(item, Float.valueOf(chance));
- }
-
- public static Collection<ItemStack> getMutagens()
- {
- return mutations.keySet();
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyRainShield.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyRainShield.java
deleted file mode 100644
index 18b5dcee34..0000000000
--- a/src/Java/binnie/extrabees/apiary/machine/AlvearyRainShield.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package binnie.extrabees.apiary.machine;
-
-import binnie.core.machines.Machine;
-import binnie.craftgui.minecraft.IMachineInformation;
-import binnie.extrabees.apiary.ComponentBeeModifier;
-import binnie.extrabees.core.ExtraBeeTexture;
-import forestry.api.apiculture.IBeeListener;
-import forestry.api.apiculture.IBeeModifier;
-
-public class AlvearyRainShield
-{
- public static class PackageAlvearyRainShield
- extends AlvearyMachine.AlvearyPackage
- implements IMachineInformation
- {
- public PackageAlvearyRainShield()
- {
- super(ExtraBeeTexture.AlvearyRainShield.getTexture(), false);
- }
-
- public void createMachine(Machine machine)
- {
- new AlvearyRainShield.ComponentRainShield(machine);
- }
- }
-
- public static class ComponentRainShield
- extends ComponentBeeModifier
- implements IBeeModifier, IBeeListener
- {
- public ComponentRainShield(Machine machine)
- {
- super();
- }
-
- public boolean isSealed()
- {
- return true;
- }
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyStimulator.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyStimulator.java
deleted file mode 100644
index 47b6dab48b..0000000000
--- a/src/Java/binnie/extrabees/apiary/machine/AlvearyStimulator.java
+++ /dev/null
@@ -1,430 +0,0 @@
-package binnie.extrabees.apiary.machine;
-
-import binnie.core.Mods;
-import binnie.core.Mods.Mod;
-import binnie.core.circuits.BinnieCircuit;
-import binnie.core.genetics.BeeModifierLogic;
-import binnie.core.genetics.EnumBeeBooleanModifier;
-import binnie.core.genetics.EnumBeeModifier;
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachineUtil;
-import binnie.core.machines.inventory.ComponentInventorySlots;
-import binnie.core.machines.inventory.InventorySlot;
-import binnie.core.machines.inventory.SlotValidator;
-import binnie.core.machines.power.ComponentPowerReceptor;
-import binnie.craftgui.minecraft.IMachineInformation;
-import binnie.extrabees.apiary.ComponentBeeModifier;
-import binnie.extrabees.apiary.ComponentExtraBeeGUI;
-import binnie.extrabees.core.ExtraBeeGUID;
-import binnie.extrabees.core.ExtraBeeTexture;
-import forestry.api.apiculture.IBeeGenome;
-import forestry.api.apiculture.IBeeListener;
-import forestry.api.apiculture.IBeeModifier;
-import forestry.api.circuits.ChipsetManager;
-import forestry.api.circuits.ICircuit;
-import forestry.api.circuits.ICircuitBoard;
-import forestry.api.circuits.ICircuitLayout;
-import forestry.api.circuits.ICircuitRegistry;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.item.ItemStack;
-
-public class AlvearyStimulator
-{
- public static int slotCircuit = 0;
-
- public static class PackageAlvearyStimulator
- extends AlvearyMachine.AlvearyPackage
- implements IMachineInformation
- {
- public PackageAlvearyStimulator()
- {
- super(ExtraBeeTexture.AlvearyStimulator.getTexture(), true);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyStimulator);
-
- ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
-
- inventory.addSlot(AlvearyStimulator.slotCircuit, "circuit");
- inventory.getSlot(AlvearyStimulator.slotCircuit).setValidator(new AlvearyStimulator.SlotValidatorCircuit());
-
- ComponentPowerReceptor power = new ComponentPowerReceptor(machine);
-
-
- new AlvearyStimulator.ComponentStimulatorModifier(machine);
- }
- }
-
- public static class SlotValidatorCircuit
- extends SlotValidator
- {
- public SlotValidatorCircuit()
- {
- super();
- }
-
- public boolean isValid(ItemStack itemStack)
- {
- return (itemStack != null) && (ChipsetManager.circuitRegistry.isChipset(itemStack));
- }
-
- public String getTooltip()
- {
- return "Forestry Circuits";
- }
- }
-
- public static class ComponentStimulatorModifier
- extends ComponentBeeModifier
- implements IBeeModifier, IBeeListener
- {
- public ComponentStimulatorModifier(Machine machine)
- {
- super();
- }
-
- float powerUsage = 0.0F;
- boolean powered = false;
-
- public void onUpdate()
- {
- super.onUpdate();
- this.modifiers = getCircuits();
- this.powerUsage = 0.0F;
- for (AlvearyStimulator.StimulatorCircuit beeMod : this.modifiers) {
- this.powerUsage += beeMod.getPowerUsage();
- }
- this.powered = getUtil().hasEnergyMJ(this.powerUsage);
- }
-
- AlvearyStimulator.StimulatorCircuit[] modifiers = new AlvearyStimulator.StimulatorCircuit[0];
-
- public ICircuitBoard getHiveFrame()
- {
- if (!getUtil().isSlotEmpty(AlvearyStimulator.slotCircuit)) {
- return ChipsetManager.circuitRegistry.getCircuitboard(getUtil().getStack(AlvearyStimulator.slotCircuit));
- }
- return null;
- }
-
- public AlvearyStimulator.StimulatorCircuit[] getCircuits()
- {
- ICircuitBoard board = getHiveFrame();
- if (board == null) {
- return new AlvearyStimulator.StimulatorCircuit[0];
- }
- ICircuit[] circuits = board.getCircuits();
- List<IBeeModifier> mod = new ArrayList();
- for (ICircuit circuit : circuits) {
- if ((circuit instanceof AlvearyStimulator.StimulatorCircuit)) {
- mod.add((AlvearyStimulator.StimulatorCircuit)circuit);
- }
- }
- return (AlvearyStimulator.StimulatorCircuit[])mod.toArray(new AlvearyStimulator.StimulatorCircuit[0]);
- }
-
- public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
- {
- float mod = 1.0F;
- if (!this.powered) {
- return mod;
- }
- for (IBeeModifier beeMod : this.modifiers) {
- mod *= beeMod.getTerritoryModifier(genome, mod);
- }
- return mod;
- }
-
- public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- float mod = 1.0F;
- if (!this.powered) {
- return mod;
- }
- for (IBeeModifier beeMod : this.modifiers) {
- mod *= beeMod.getMutationModifier(genome, mate, mod);
- }
- return mod;
- }
-
- public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- float mod = 1.0F;
- if (!this.powered) {
- return mod;
- }
- for (IBeeModifier beeMod : this.modifiers) {
- mod *= beeMod.getLifespanModifier(genome, mate, mod);
- }
- return mod;
- }
-
- public float getProductionModifier(IBeeGenome genome, float currentModifier)
- {
- float mod = 1.0F;
- if (!this.powered) {
- return mod;
- }
- for (IBeeModifier beeMod : this.modifiers) {
- mod *= beeMod.getProductionModifier(genome, mod);
- }
- return mod;
- }
-
- public float getFloweringModifier(IBeeGenome genome, float currentModifier)
- {
- float mod = 1.0F;
- if (!this.powered) {
- return mod;
- }
- for (IBeeModifier beeMod : this.modifiers) {
- mod *= beeMod.getFloweringModifier(genome, mod);
- }
- return mod;
- }
-
- public float getGeneticDecay(IBeeGenome genome, float currentModifier)
- {
- float mod = 1.0F;
- if (!this.powered) {
- return mod;
- }
- for (IBeeModifier beeMod : this.modifiers) {
- mod *= beeMod.getGeneticDecay(genome, mod);
- }
- return mod;
- }
-
- public boolean isSealed()
- {
- if (!this.powered) {
- return false;
- }
- for (IBeeModifier beeMod : this.modifiers) {
- if (beeMod.isSealed()) {
- return true;
- }
- }
- return false;
- }
-
- public boolean isSelfLighted()
- {
- if (!this.powered) {
- return false;
- }
- for (IBeeModifier beeMod : this.modifiers) {
- if (beeMod.isSelfLighted()) {
- return true;
- }
- }
- return false;
- }
-
- public boolean isSunlightSimulated()
- {
- if (!this.powered) {
- return false;
- }
- for (IBeeModifier beeMod : this.modifiers) {
- if (beeMod.isSunlightSimulated()) {
- return true;
- }
- }
- return false;
- }
-
- public boolean isHellish()
- {
- if (!this.powered) {
- return false;
- }
- for (IBeeModifier beeMod : this.modifiers) {
- if (beeMod.isHellish()) {
- return true;
- }
- }
- return false;
- }
-
- public void wearOutEquipment(int amount)
- {
- getUtil().useEnergyMJ(this.powerUsage);
- }
- }
-
- public static class StimulatorCircuit
- extends BinnieCircuit
- implements IBeeModifier
- {
- AlvearyStimulator.CircuitType type;
-
- public StimulatorCircuit(AlvearyStimulator.CircuitType type, ICircuitLayout layout)
- {
- super(4, layout, Mods.Forestry.item("thermionicTubes"), type.recipe);
- this.type = type;
- }
-
- public int getPowerUsage()
- {
- return this.type.power;
- }
-
- public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
- {
- return this.type.getTerritoryModifier(genome, currentModifier);
- }
-
- public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return this.type.getMutationModifier(genome, mate, currentModifier);
- }
-
- public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return this.type.getLifespanModifier(genome, mate, currentModifier);
- }
-
- public float getProductionModifier(IBeeGenome genome, float currentModifier)
- {
- return this.type.getProductionModifier(genome, currentModifier);
- }
-
- public float getFloweringModifier(IBeeGenome genome, float currentModifier)
- {
- return this.type.getFloweringModifier(genome, currentModifier);
- }
-
- public boolean isSealed()
- {
- return this.type.isSealed();
- }
-
- public boolean isSelfLighted()
- {
- return this.type.isSelfLighted();
- }
-
- public boolean isSunlightSimulated()
- {
- return this.type.isSunlightSimulated();
- }
-
- public boolean isHellish()
- {
- return this.type.isHellish();
- }
-
- public float getGeneticDecay(IBeeGenome genome, float currentModifier)
- {
- return this.type.getGeneticDecay(genome, currentModifier);
- }
- }
-
- public static enum CircuitType
- implements IBeeModifier
- {
- LowVoltage(3, 10), HighVoltage(5, 20), Plant(10, 10), Death(6, 10), Life(11, 10), Nether(7, 15), Mutation(4, 15), Inhibitor(1, 10), Territory(2, 10);
-
- public int recipe;
- public int power;
- BeeModifierLogic logic = new BeeModifierLogic();
-
- static
- {
- LowVoltage.logic.setModifier(EnumBeeModifier.Production, 1.5F, 5.0F);
- HighVoltage.logic.setModifier(EnumBeeModifier.Production, 2.5F, 10.0F);
- Plant.logic.setModifier(EnumBeeModifier.Flowering, 1.5F, 5.0F);
- Death.logic.setModifier(EnumBeeModifier.Lifespan, 0.8F, 0.2F);
- Life.logic.setModifier(EnumBeeModifier.Lifespan, 1.5F, 5.0F);
- Nether.logic.setModifier(EnumBeeBooleanModifier.Hellish);
- Mutation.logic.setModifier(EnumBeeModifier.Mutation, 1.5F, 5.0F);
- Inhibitor.logic.setModifier(EnumBeeModifier.Territory, 0.4F, 0.1F);
- Inhibitor.logic.setModifier(EnumBeeModifier.Production, 0.9F, 0.5F);
- Territory.logic.setModifier(EnumBeeModifier.Territory, 1.5F, 5.0F);
- for (CircuitType type : values()) {
- type.logic.setModifier(EnumBeeModifier.GeneticDecay, 1.5F, 10.0F);
- }
- }
-
- private CircuitType(int recipe, int power)
- {
- this.recipe = recipe;
- this.power = power;
- }
-
- public void createCircuit(ICircuitLayout layout)
- {
- AlvearyStimulator.StimulatorCircuit circuit = new AlvearyStimulator.StimulatorCircuit(this, layout);
- for (EnumBeeModifier modifier : EnumBeeModifier.values())
- {
- float mod = this.logic.getModifier(modifier, 1.0F);
- if (mod != 1.0F) {
- if (mod > 1.0F)
- {
- int increase = (int)((mod - 1.0F) * 100.0F);
- circuit.addTooltipString("Increases " + modifier.getName() + " by " + increase + "%");
- }
- else
- {
- int decrease = (int)((1.0F - mod) * 100.0F);
- circuit.addTooltipString("Decreases " + modifier.getName() + " by " + decrease + "%");
- }
- }
- }
- }
-
- public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.Territory, currentModifier);
- }
-
- public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.Mutation, currentModifier);
- }
-
- public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.Lifespan, currentModifier);
- }
-
- public float getProductionModifier(IBeeGenome genome, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.Production, currentModifier);
- }
-
- public float getFloweringModifier(IBeeGenome genome, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.Flowering, currentModifier);
- }
-
- public float getGeneticDecay(IBeeGenome genome, float currentModifier)
- {
- return this.logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier);
- }
-
- public boolean isSealed()
- {
- return this.logic.getModifier(EnumBeeBooleanModifier.Sealed);
- }
-
- public boolean isSelfLighted()
- {
- return this.logic.getModifier(EnumBeeBooleanModifier.SelfLighted);
- }
-
- public boolean isSunlightSimulated()
- {
- return this.logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated);
- }
-
- public boolean isHellish()
- {
- return this.logic.getModifier(EnumBeeBooleanModifier.Hellish);
- }
- }
-}
diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyTransmission.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyTransmission.java
deleted file mode 100644
index b041bf1c37..0000000000
--- a/src/Java/binnie/extrabees/apiary/machine/AlvearyTransmission.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package binnie.extrabees.apiary.machine;
-
-import binnie.core.machines.IMachine;
-import binnie.core.machines.Machine;
-import binnie.core.machines.MachineComponent;
-import binnie.core.machines.MachineUtil;
-import binnie.core.machines.power.ComponentPowerReceptor;
-import binnie.core.machines.power.IPoweredMachine;
-import binnie.craftgui.minecraft.IMachineInformation;
-import binnie.extrabees.apiary.TileExtraBeeAlveary;
-import binnie.extrabees.core.ExtraBeeTexture;
-import cofh.api.energy.IEnergyHandler;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class AlvearyTransmission
-{
- public static class PackageAlvearyTransmission
- extends AlvearyMachine.AlvearyPackage
- implements IMachineInformation
- {
- public PackageAlvearyTransmission()
- {
- super(ExtraBeeTexture.AlvearyTransmission.getTexture(), false);
- }
-
- public void createMachine(Machine machine)
- {
- new ComponentPowerReceptor(machine, 1000);
- new AlvearyTransmission.ComponentTransmission(machine);
- }
- }
-
- public static class ComponentTransmission
- extends MachineComponent
- {
- public ComponentTransmission(Machine machine)
- {
- super();
- }
-
- public void onUpdate()
- {
- super.onUpdate();
- int energy = getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
- if (energy == 0) {
- return;
- }
- TileExtraBeeAlveary tile = (TileExtraBeeAlveary)getMachine().getTileEntity();
-
- List<IEnergyHandler> handlers = new ArrayList();
- for (TileEntity alvearyTile : tile.getAlvearyBlocks()) {
- if (((alvearyTile instanceof IEnergyHandler)) && (alvearyTile != tile)) {
- handlers.add((IEnergyHandler)alvearyTile);
- }
- }
- if (handlers.isEmpty()) {
- return;
- }
- int maxOutput = 500;
- int output = energy / handlers.size();
- if (output > maxOutput) {
- output = maxOutput;
- }
- if (output < 1) {
- output = 1;
- }
- for (IEnergyHandler handler : handlers)
- {
- int recieved = handler.receiveEnergy(ForgeDirection.NORTH, output, false);
- getUtil().getPoweredMachine().extractEnergy(ForgeDirection.NORTH, recieved, false);
- energy = getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
- if (energy == 0) {
- return;
- }
- }
- }
- }
-}
diff --git a/src/Java/binnie/extrabees/config/ConfigurationMachines.java b/src/Java/binnie/extrabees/config/ConfigurationMachines.java
deleted file mode 100644
index 7d08d216f2..0000000000
--- a/src/Java/binnie/extrabees/config/ConfigurationMachines.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package binnie.extrabees.config;
-
-import binnie.core.mod.config.ConfigFile;
-import binnie.core.mod.config.ConfigProperty;
-import binnie.core.mod.config.PropDouble;
-import binnie.core.mod.config.PropPercentage;
-
-@ConfigFile(filename="/config/forestry/extrabees/machines.conf")
-public class ConfigurationMachines
-{
- @ConfigProperty(key="isolatorConsumptionChance", comment={"Percentage chance of Isolator consuming bee, in x%."})
- @PropPercentage
- public static int isolatorConsumptionChance = 30;
- @ConfigProperty(key="geneticErrorModifier", comment={"Modifier that changes how severe splicer/inoculator erros are.", "0 would result in no errors, even for awful serums.", "2.0 would result in twice as severe errors"})
- @PropDouble
- public static double geneticErrorModifier = 1.0D;
-}
diff --git a/src/Java/binnie/extrabees/config/ConfigurationMain.java b/src/Java/binnie/extrabees/config/ConfigurationMain.java
deleted file mode 100644
index e6ee442a14..0000000000
--- a/src/Java/binnie/extrabees/config/ConfigurationMain.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package binnie.extrabees.config;
-
-import binnie.core.mod.config.ConfigFile;
-import binnie.core.mod.config.ConfigProperty;
-import binnie.core.mod.config.PropBoolean;
-import binnie.core.mod.config.PropInteger;
-
-@ConfigFile(filename="/config/forestry/extrabees/main.conf")
-public class ConfigurationMain
-{
- @ConfigProperty(key="canQuarryMineHives")
- @PropBoolean
- public static boolean canQuarryMineHives = true;
- @ConfigProperty(key="waterHiveRate")
- @PropInteger
- public static int waterHiveRate = 1;
- @ConfigProperty(key="rockHiveRate")
- @PropInteger
- public static int rockHiveRate = 2;
- @ConfigProperty(key="netherHiveRate")
- @PropInteger
- public static int netherHiveRate = 2;
- @ConfigProperty(key="marbleHiveRate")
- @PropInteger
- public static int marbleHiveRate = 2;
-}
diff --git a/src/Java/binnie/extrabees/core/ExtraBeeGUID.java b/src/Java/binnie/extrabees/core/ExtraBeeGUID.java
deleted file mode 100644
index 4d9667460c..0000000000
--- a/src/Java/binnie/extrabees/core/ExtraBeeGUID.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package binnie.extrabees.core;
-
-import binnie.core.gui.IBinnieGUID;
-import binnie.craftgui.minecraft.Window;
-import binnie.extrabees.gui.WindowAlvearyFrame;
-import binnie.extrabees.gui.WindowAlvearyHatchery;
-import binnie.extrabees.gui.WindowAlvearyMutator;
-import binnie.extrabees.gui.WindowAlvearyStimulator;
-import binnie.extrabees.gui.database.WindowApiaristDatabase;
-import cpw.mods.fml.relauncher.Side;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public enum ExtraBeeGUID
- implements IBinnieGUID
-{
- Database, DatabaseNEI, AlvearyMutator, AlvearyFrame, AlvearyStimulator, PunnettSquare, AlvearyHatchery;
-
- private ExtraBeeGUID() {}
-
- public Window getWindow(EntityPlayer player, World world, int x, int y, int z, Side side)
- {
- Window window = null;
-
- TileEntity tileEntity = world.getTileEntity(x, y, z);
-
- IInventory object = null;
- if ((tileEntity instanceof IInventory)) {
- object = (IInventory)tileEntity;
- }
- switch (1.$SwitchMap$binnie$extrabees$core$ExtraBeeGUID[ordinal()])
- {
- case 1:
- case 2:
- window = WindowApiaristDatabase.create(player, side, this != Database);
- break;
- case 3:
- window = WindowAlvearyMutator.create(player, object, side);
- break;
- case 4:
- window = WindowAlvearyFrame.create(player, object, side);
- break;
- case 5:
- window = WindowAlvearyStimulator.create(player, object, side);
- break;
- case 6:
- window = WindowAlvearyHatchery.create(player, object, side);
- break;
- }
- return window;
- }
-}
diff --git a/src/Java/binnie/extrabees/core/ExtraBeeItems.java b/src/Java/binnie/extrabees/core/ExtraBeeItems.java
deleted file mode 100644
index 3bcea19f08..0000000000
--- a/src/Java/binnie/extrabees/core/ExtraBeeItems.java
+++ /dev/null
@@ -1,172 +0,0 @@
-package binnie.extrabees.core;
-
-import binnie.Binnie;
-import binnie.core.Mods;
-import binnie.core.Mods.Mod;
-import binnie.core.item.IItemMisc;
-import binnie.core.liquid.ManagerLiquid;
-import binnie.extrabees.ExtraBees;
-import binnie.extrabees.proxy.ExtraBeesProxy;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import forestry.api.recipes.ICarpenterManager;
-import forestry.api.recipes.RecipeManagers;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-import net.minecraftforge.oredict.OreDictionary;
-
-public enum ExtraBeeItems
- implements IItemMisc
-{
- ScentedGear("Scented Gear", "scentedGear"), DiamondShard("Diamond Fragment", "diamondShard"), EmeraldShard("Emerald Fragment", "emeraldShard"), RubyShard("Ruby Fragment", "rubyShard"), SapphireShard("Sapphire Fragment", "sapphireShard"), LapisShard("Lapis Fragment", "lapisShard"), IronDust("Iron Grains", "ironDust"), GoldDust("Gold Grains", "goldDust"), SilverDust("Silver Grains", "silverDust"), PlatinumDust("Platinum Grains", "platinumDust"), CopperDust("Copper Grains", "copperDust"), TinDust("Tin Grains", "tinDust"), NickelDust("Nickel Grains", "nickelDust"), LeadDust("Lead Grains", "leadDust"), ZincDust("Zinc Grains", "zincDust"), TitaniumDust("Titanium Grains", "titaniumDust"), TungstenDust("Tungsten Grains", "tungstenDust"), UraniumDust("Radioactive Fragments", "radioactiveDust"), CoalDust("Coal Grains", "coalDust"), RedDye("Red Dye", "dyeRed"), YellowDye("Yellow Dye", "dyeYellow"), BlueDye("Blue Dye", "dyeBlue"), GreenDye("Green Dye", "dyeGreen"), WhiteDye("White Dye", "dyeWhite"), BlackDye("Black Dye", "dyeBlack"), BrownDye("Brown Dye", "dyeBrown"), ClayDust("Clay Dust", "clayDust"), YelloriumDust("Yellorium Grains", "yelloriumDust"), BlutoniumDust("Blutonium Grains", "blutoniumDust"), CyaniteDust("Cyanite Grains", "cyaniteDust");
-
- String name;
- String iconPath;
- IIcon icon;
-
- static
- {
- TinDust.setMetal("Tin");
- ZincDust.setMetal("Zinc");
- CopperDust.setMetal("Copper");
- IronDust.setMetal("Iron");
- NickelDust.setMetal("Nickel");
- LeadDust.setMetal("Lead");
- SilverDust.setMetal("Silver");
- GoldDust.setMetal("Gold");
- PlatinumDust.setMetal("Platinum");
- TungstenDust.setMetal("Tungsten");
- TitaniumDust.setMetal("Titanium");
- CoalDust.setMetal("Coal");
-
- YelloriumDust.setMetal("Yellorium");
- BlutoniumDust.setMetal("Blutonium");
- CyaniteDust.setMetal("Cyanite");
-
- DiamondShard.setGem("Diamond");
- EmeraldShard.setGem("Emerald");
- RubyShard.setGem("Ruby");
- SapphireShard.setGem("Sapphire");
- }
-
- public static void init()
- {
- OreDictionary.registerOre("dyeRed", RedDye.get(1));
- OreDictionary.registerOre("dyeYellow", YellowDye.get(1));
- OreDictionary.registerOre("dyeBlue", BlueDye.get(1));
- OreDictionary.registerOre("dyeGreen", GreenDye.get(1));
- OreDictionary.registerOre("dyeBlack", BlackDye.get(1));
- OreDictionary.registerOre("dyeWhite", WhiteDye.get(1));
- OreDictionary.registerOre("dyeBrown", BrownDye.get(1));
- }
-
- public static void postInit()
- {
- ItemStack lapisShard = LapisShard.get(1);
- GameRegistry.addShapelessRecipe(new ItemStack(Items.dye, 1, 4), new Object[] { lapisShard, lapisShard, lapisShard, lapisShard });
- for (ExtraBeeItems item : values()) {
- if (item.metalString != null)
- {
- ItemStack dust = null;
- ItemStack ingot = null;
- if (!OreDictionary.getOres("ingot" + item.metalString).isEmpty()) {
- ingot = ((ItemStack)OreDictionary.getOres("ingot" + item.metalString).get(0)).copy();
- }
- if (!OreDictionary.getOres("dust" + item.metalString).isEmpty()) {
- dust = ((ItemStack)OreDictionary.getOres("dust" + item.metalString).get(0)).copy();
- }
- ItemStack input = item.get(1);
- if (dust != null) {
- GameRegistry.addShapelessRecipe(dust, new Object[] { input, input, input, input });
- } else if (ingot != null) {
- GameRegistry.addShapelessRecipe(ingot, new Object[] { input, input, input, input, input, input, input, input, input });
- } else if (item == CoalDust) {
- GameRegistry.addShapelessRecipe(new ItemStack(Items.coal), new Object[] { input, input, input, input });
- }
- }
- else if (item.gemString != null)
- {
- ItemStack gem = null;
- if (!OreDictionary.getOres("gem" + item.gemString).isEmpty()) {
- gem = (ItemStack)OreDictionary.getOres("gem" + item.gemString).get(0);
- }
- ItemStack input = item.get(1);
- if (gem != null) {
- GameRegistry.addShapelessRecipe(gem.copy(), new Object[] { input, input, input, input, input, input, input, input, input });
- }
- }
- }
- Item woodGear = null;
- try
- {
- woodGear = (Item)Class.forName("buildcraft.BuildCraftCore").getField("woodenGearItem").get(null);
- }
- catch (Exception e) {}
- ItemStack gear = new ItemStack(Blocks.planks, 1);
- if (woodGear != null) {
- gear = new ItemStack(woodGear, 1);
- }
- RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("for.honey", 500), null, ScentedGear.get(1), new Object[] { " j ", "bgb", " p ", Character.valueOf('j'), Mods.Forestry.item("royalJelly"), Character.valueOf('b'), Mods.Forestry.item("beeswax"), Character.valueOf('p'), Mods.Forestry.item("pollen"), Character.valueOf('g'), gear });
- }
-
- String metalString = null;
- String gemString = null;
-
- private ExtraBeeItems(String name, String iconPath)
- {
- this.name = name;
- this.iconPath = iconPath;
- }
-
- private void setGem(String string)
- {
- this.gemString = string;
- }
-
- private void setMetal(String string)
- {
- this.metalString = string;
- }
-
- public boolean isActive()
- {
- if (this.metalString != null) {
- return (!OreDictionary.getOres("ingot" + this.metalString).isEmpty()) || (!OreDictionary.getOres("dust" + this.metalString).isEmpty()) || (this == CoalDust);
- }
- if (this.gemString != null) {
- return !OreDictionary.getOres("gem" + this.gemString).isEmpty();
- }
- return true;
- }
-
- public IIcon getIcon(ItemStack stack)
- {
- return this.icon;
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister register)
- {
- this.icon = ExtraBees.proxy.getIcon(register, "misc/" + this.iconPath);
- }
-
- public String getName(ItemStack stack)
- {
- return this.name;
- }
-
- public ItemStack get(int i)
- {
- return new ItemStack(ExtraBees.itemMisc, i, ordinal());
- }
-
- public void addInformation(List par3List) {}
-}
diff --git a/src/Java/binnie/extrabees/core/ExtraBeeTexture.java b/src/Java/binnie/extrabees/core/ExtraBeeTexture.java
deleted file mode 100644
index 6827b81144..0000000000
--- a/src/Java/binnie/extrabees/core/ExtraBeeTexture.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package binnie.extrabees.core;
-
-import binnie.Binnie;
-import binnie.core.resource.BinnieResource;
-import binnie.core.resource.IBinnieTexture;
-import binnie.core.resource.ManagerResource;
-import binnie.core.resource.ResourceType;
-import binnie.extrabees.ExtraBees;
-
-public enum ExtraBeeTexture
- implements IBinnieTexture
-{
- AlvearyMutator(ResourceType.Tile, "alveary/AlvearyMutator"), AlvearyNovaBlock(ResourceType.Tile, "alveary/AlvearyNovaBlock"), AlvearyFrame(ResourceType.Tile, "alveary/AlvearyFrame"), AlvearyLighting(ResourceType.Tile, "alveary/AlvearyLighting"), AlvearyRainShield(ResourceType.Tile, "alveary/AlvearyRainShield"), AlvearyStimulator(ResourceType.Tile, "alveary/AlvearyStimulator"), AlvearyHatchery(ResourceType.Tile, "alveary/AlvearyHatchery"), FX(ResourceType.FX, "fx"), GUIPunnett(ResourceType.GUI, "punnett"), GUIProgress(ResourceType.GUI, "processes"), GUIProgress2(ResourceType.GUI, "processes2"), AlvearyTransmission(ResourceType.Tile, "alveary/AlvearyTransmission");
-
- String texture;
- ResourceType type;
-
- private ExtraBeeTexture(ResourceType base, String texture)
- {
- this.texture = texture;
- this.type = base;
- }
-
- public BinnieResource getTexture()
- {
- return Binnie.Resource.getPNG(ExtraBees.instance, this.type, this.texture);
- }
-}
diff --git a/src/Java/binnie/extrabees/core/ModuleCore.java b/src/Java/binnie/extrabees/core/ModuleCore.java
deleted file mode 100644
index 14786ddc77..0000000000
--- a/src/Java/binnie/extrabees/core/ModuleCore.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package binnie.extrabees.core;
-
-import binnie.Binnie;
-import binnie.core.IInitializable;
-import binnie.core.item.ManagerItem;
-import forestry.api.core.Tabs;
-
-public class ModuleCore
- implements IInitializable
-{
- public void preInit()
- {
- binnie.extrabees.ExtraBees.itemMisc = Binnie.Item.registerMiscItems(ExtraBeeItems.values(), Tabs.tabApiculture);
- }
-
- public void init() {}
-
- public void postInit() {}
-}
diff --git a/src/Java/binnie/extrabees/gui/WindowAlvearyFrame.java b/src/Java/binnie/extrabees/gui/WindowAlvearyFrame.java
deleted file mode 100644
index a14d9a0a8f..0000000000
--- a/src/Java/binnie/extrabees/gui/WindowAlvearyFrame.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package binnie.extrabees.gui;
-
-import binnie.core.AbstractMod;
-import binnie.core.machines.Machine;
-import binnie.core.machines.TileEntityMachine;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.control.ControlPlayerInventory;
-import binnie.craftgui.minecraft.control.ControlSlot;
-import binnie.extrabees.ExtraBees;
-import cpw.mods.fml.relauncher.Side;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-
-public class WindowAlvearyFrame
- extends Window
-{
- Machine machine;
- ControlPlayerInventory playerInventory;
-
- public WindowAlvearyFrame(EntityPlayer player, IInventory inventory, Side side)
- {
- super(176.0F, 144.0F, player, inventory, side);
- this.machine = ((TileEntityMachine)inventory).getMachine();
- }
-
- public static Window create(EntityPlayer player, IInventory inventory, Side side)
- {
- if ((player == null) || (inventory == null)) {
- return null;
- }
- return new WindowAlvearyFrame(player, inventory, side);
- }
-
- public void initialiseClient()
- {
- setTitle("Frame Housing");
-
- this.playerInventory = new ControlPlayerInventory(this);
-
- ControlSlot slot = new ControlSlot(this, 79.0F, 30.0F);
- slot.assign(0);
- }
-
- public AbstractMod getMod()
- {
- return ExtraBees.instance;
- }
-
- public String getName()
- {
- return "AlvearyFrame";
- }
-}
diff --git a/src/Java/binnie/extrabees/gui/WindowAlvearyHatchery.java b/src/Java/binnie/extrabees/gui/WindowAlvearyHatchery.java
deleted file mode 100644
index 081425acf5..0000000000
--- a/src/Java/binnie/extrabees/gui/WindowAlvearyHatchery.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package binnie.extrabees.gui;
-
-import binnie.core.AbstractMod;
-import binnie.core.machines.Machine;
-import binnie.core.machines.TileEntityMachine;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.control.ControlPlayerInventory;
-import binnie.craftgui.minecraft.control.ControlSlotArray;
-import binnie.extrabees.ExtraBees;
-import binnie.extrabees.apiary.machine.AlvearyHatchery;
-import cpw.mods.fml.relauncher.Side;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-
-public class WindowAlvearyHatchery
- extends Window
-{
- Machine machine;
- ControlPlayerInventory playerInventory;
-
- public WindowAlvearyHatchery(EntityPlayer player, IInventory inventory, Side side)
- {
- super(176.0F, 144.0F, player, inventory, side);
- this.machine = ((TileEntityMachine)inventory).getMachine();
- }
-
- public static Window create(EntityPlayer player, IInventory inventory, Side side)
- {
- if ((player == null) || (inventory == null)) {
- return null;
- }
- return new WindowAlvearyHatchery(player, inventory, side);
- }
-
- public void initialiseClient()
- {
- setTitle("Hatchery");
-
- this.playerInventory = new ControlPlayerInventory(this);
-
- ControlSlotArray slot = new ControlSlotArray(this, 43, 30, 5, 1);
- slot.create(AlvearyHatchery.slotLarvae);
- }
-
- public AbstractMod getMod()
- {
- return ExtraBees.instance;
- }
-
- public String getName()
- {
- return "AlvearyHatchery";
- }
-}
diff --git a/src/Java/binnie/extrabees/gui/WindowAlvearyIndustrialFrame.java b/src/Java/binnie/extrabees/gui/WindowAlvearyIndustrialFrame.java
deleted file mode 100644
index 07b47f03c9..0000000000
--- a/src/Java/binnie/extrabees/gui/WindowAlvearyIndustrialFrame.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package binnie.extrabees.gui;
-
-import binnie.core.AbstractMod;
-import binnie.core.machines.Machine;
-import binnie.core.machines.TileEntityMachine;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.control.ControlPlayerInventory;
-import binnie.craftgui.minecraft.control.ControlSlot;
-import binnie.extrabees.ExtraBees;
-import cpw.mods.fml.relauncher.Side;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-
-public class WindowAlvearyIndustrialFrame
- extends Window
-{
- Machine machine;
- ControlPlayerInventory playerInventory;
-
- public WindowAlvearyIndustrialFrame(EntityPlayer player, IInventory inventory, Side side)
- {
- super(176.0F, 144.0F, player, inventory, side);
- this.machine = ((TileEntityMachine)inventory).getMachine();
- }
-
- public static Window create(EntityPlayer player, IInventory inventory, Side side)
- {
- if ((player == null) || (inventory == null)) {
- return null;
- }
- return new WindowAlvearyIndustrialFrame(player, inventory, side);
- }
-
- public void initialiseClient()
- {
- setTitle("Industrial Frame Housing");
-
- this.playerInventory = new ControlPlayerInventory(this);
-
- ControlSlot slot = new ControlSlot(this, 79.0F, 30.0F);
- slot.assign(0);
- }
-
- public AbstractMod getMod()
- {
- return ExtraBees.instance;
- }
-
- public String getName()
- {
- return "AlvearyIndustrialFrame";
- }
-}
diff --git a/src/Java/binnie/extrabees/gui/WindowAlvearyMutator.java b/src/Java/binnie/extrabees/gui/WindowAlvearyMutator.java
deleted file mode 100644
index f2cf458145..0000000000
--- a/src/Java/binnie/extrabees/gui/WindowAlvearyMutator.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package binnie.extrabees.gui;
-
-import binnie.core.AbstractMod;
-import binnie.core.machines.Machine;
-import binnie.core.machines.TileEntityMachine;
-import binnie.craftgui.controls.ControlText;
-import binnie.craftgui.core.geometry.IArea;
-import binnie.craftgui.core.geometry.TextJustification;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.control.ControlItemDisplay;
-import binnie.craftgui.minecraft.control.ControlPlayerInventory;
-import binnie.craftgui.minecraft.control.ControlSlot;
-import binnie.extrabees.ExtraBees;
-import binnie.extrabees.apiary.machine.AlvearyMutator;
-import cpw.mods.fml.relauncher.Side;
-import java.util.Collection;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-
-public class WindowAlvearyMutator
- extends Window
-{
- Machine machine;
- ControlPlayerInventory playerInventory;
-
- public WindowAlvearyMutator(EntityPlayer player, IInventory inventory, Side side)
- {
- super(176.0F, 176.0F, player, inventory, side);
- this.machine = ((TileEntityMachine)inventory).getMachine();
- }
-
- public static Window create(EntityPlayer player, IInventory inventory, Side side)
- {
- if ((player == null) || (inventory == null)) {
- return null;
- }
- return new WindowAlvearyMutator(player, inventory, side);
- }
-
- public void initialiseClient()
- {
- setTitle("Mutator");
-
- this.playerInventory = new ControlPlayerInventory(this);
-
- ControlSlot slot = new ControlSlot(this, 79.0F, 30.0F);
- slot.assign(0);
-
- new ControlText(this, new IArea(0.0F, 52.0F, w(), 16.0F), "Possible Mutagens:", TextJustification.MiddleCenter).setColour(5592405);
-
- int size = AlvearyMutator.getMutagens().size();
-
- int w = size * 18;
- float x;
- if (size > 0)
- {
- x = (w() - w) / 2.0F;
- for (ItemStack stack : AlvearyMutator.getMutagens())
- {
- ControlItemDisplay display = new ControlItemDisplay(this, x, 66.0F);
- display.setItemStack(stack);
- display.hastooltip = true;
- x += 18.0F;
- }
- }
- }
-
- public AbstractMod getMod()
- {
- return ExtraBees.instance;
- }
-
- public String getName()
- {
- return "AlvearyMutator";
- }
-}
diff --git a/src/Java/binnie/extrabees/gui/WindowAlvearyStimulator.java b/src/Java/binnie/extrabees/gui/WindowAlvearyStimulator.java
deleted file mode 100644
index 2e3b9736a5..0000000000
--- a/src/Java/binnie/extrabees/gui/WindowAlvearyStimulator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package binnie.extrabees.gui;
-
-import binnie.core.AbstractMod;
-import binnie.core.machines.Machine;
-import binnie.core.machines.TileEntityMachine;
-import binnie.craftgui.core.geometry.Position;
-import binnie.craftgui.minecraft.Window;
-import binnie.craftgui.minecraft.control.ControlEnergyBar;
-import binnie.craftgui.minecraft.control.ControlPlayerInventory;
-import binnie.craftgui.minecraft.control.ControlSlot;
-import binnie.extrabees.ExtraBees;
-import binnie.extrabees.apiary.machine.AlvearyStimulator;
-import cpw.mods.fml.relauncher.Side;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-
-public class WindowAlvearyStimulator
- extends Window
-{
- Machine machine;
- ControlPlayerInventory playerInventory;
-
- public WindowAlvearyStimulator(EntityPlayer player, IInventory inventory, Side side)
- {
- super(176.0F, 144.0F, player, inventory, side);
- this.machine = ((TileEntityMachine)inventory).getMachine();
- }
-
- public static Window create(EntityPlayer player, IInventory inventory, Side side)
- {
- if ((player == null) || (inventory == null)) {
- return null;
- }
- return new WindowAlvearyStimulator(player, inventory, side);
- }
-
- public void initialiseClient()
- {
- setTitle("Stimulator");
- new ControlEnergyBar(this, 75, 29, 60, 16, Position.Left);
- ControlSlot slot = new ControlSlot(this, 41.0F, 28.0F);
- slot.assign(AlvearyStimulator.slotCircuit);
-
- this.playerInventory = new ControlPlayerInventory(this);
- }
-
- public AbstractMod getMod()
- {
- return ExtraBees.instance;
- }
-
- public String getName()
- {
- return "AlvearyStimulator";
- }
-}
diff --git a/src/Java/binnie/extrabees/liquids/ExtraBeeLiquid.java b/src/Java/binnie/extrabees/liquids/ExtraBeeLiquid.java
deleted file mode 100644
index a7ed929fb7..0000000000
--- a/src/Java/binnie/extrabees/liquids/ExtraBeeLiquid.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package binnie.extrabees.liquids;
-
-import binnie.Binnie;
-import binnie.core.liquid.FluidContainer;
-import binnie.core.liquid.ILiquidType;
-import binnie.core.liquid.ManagerLiquid;
-import binnie.extrabees.ExtraBees;
-import binnie.extrabees.proxy.ExtraBeesProxy;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.util.IIcon;
-import net.minecraftforge.fluids.FluidStack;
-
-public enum ExtraBeeLiquid
- implements ILiquidType
-{
- ACID("acid", 11528985), POISON("poison", 15406315), GLACIAL("liquidnitrogen", 9881800);
-
- String ident;
- IIcon icon;
- int colour;
-
- private ExtraBeeLiquid(String ident, int colour)
- {
- this.ident = ident;
- this.colour = colour;
- }
-
- public IIcon getIcon()
- {
- return this.icon;
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcon(IIconRegister register)
- {
- this.icon = ExtraBees.proxy.getIcon(register, "liquids/" + getIdentifier());
- }
-
- public String getName()
- {
- return ExtraBees.proxy.localise(toString().toLowerCase());
- }
-
- public String getIdentifier()
- {
- return this.ident;
- }
-
- public int getColour()
- {
- return 16777215;
- }
-
- public FluidStack get(int amount)
- {
- return Binnie.Liquid.getLiquidStack(this.ident, amount);
- }
-
- public int getTransparency()
- {
- return 255;
- }
-
- public boolean canPlaceIn(FluidContainer container)
- {
- return true;
- }
-
- public boolean showInCreative(FluidContainer container)
- {
- return (container == FluidContainer.Bucket) || (container == FluidContainer.Can) || (container == FluidContainer.Capsule) || (container == FluidContainer.Refractory);
- }
-
- public int getContainerColour()
- {
- return this.colour;
- }
-}
diff --git a/src/Java/binnie/extrabees/liquids/ModuleLiquids.java b/src/Java/binnie/extrabees/liquids/ModuleLiquids.java
deleted file mode 100644
index 5db86e205a..0000000000
--- a/src/Java/binnie/extrabees/liquids/ModuleLiquids.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package binnie.extrabees.liquids;
-
-import binnie.Binnie;
-import binnie.core.IInitializable;
-import binnie.core.liquid.ItemFluidContainer;
-import binnie.core.liquid.ManagerLiquid;
-
-public class ModuleLiquids
- implements IInitializable
-{
- public void preInit()
- {
- Binnie.Liquid.createLiquids(ExtraBeeLiquid.values(), ItemFluidContainer.LiquidExtraBee);
- }
-
- public void init() {}
-
- public void postInit() {}
-}
diff --git a/src/Java/binnie/extrabees/proxy/ExtraBeesProxy.java b/src/Java/binnie/extrabees/proxy/ExtraBeesProxy.java
deleted file mode 100644
index 2b7499f94a..0000000000
--- a/src/Java/binnie/extrabees/proxy/ExtraBeesProxy.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package binnie.extrabees.proxy;
-
-import binnie.core.proxy.BinnieModProxy;
-import binnie.extrabees.ExtraBees;
-
-public class ExtraBeesProxy
- extends BinnieModProxy
-{
- public ExtraBeesProxy()
- {
- super(ExtraBees.instance);
- }
-}
diff --git a/src/Java/binnie/extrabees/proxy/ExtraBeesProxyClient.java b/src/Java/binnie/extrabees/proxy/ExtraBeesProxyClient.java
deleted file mode 100644
index 87198021d2..0000000000
--- a/src/Java/binnie/extrabees/proxy/ExtraBeesProxyClient.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package binnie.extrabees.proxy;
-
-public class ExtraBeesProxyClient
- extends ExtraBeesProxy
-{}
diff --git a/src/Java/binnie/extrabees/proxy/ExtraBeesProxyServer.java b/src/Java/binnie/extrabees/proxy/ExtraBeesProxyServer.java
deleted file mode 100644
index f8aae382a5..0000000000
--- a/src/Java/binnie/extrabees/proxy/ExtraBeesProxyServer.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package binnie.extrabees.proxy;
-
-public class ExtraBeesProxyServer
- extends ExtraBeesProxy
-{}
diff --git a/src/Java/miscutil/MiscUtils.java b/src/Java/miscutil/MiscUtils.java
index 518d570d67..662561fb57 100644
--- a/src/Java/miscutil/MiscUtils.java
+++ b/src/Java/miscutil/MiscUtils.java
@@ -2,13 +2,15 @@ package miscutil;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.lang.reflect.InvocationTargetException;
-import miscutil.core.CommonProxy;
import miscutil.core.commands.CommandMath;
-import miscutil.core.creativetabs.TMCreativeTabs;
+import miscutil.core.common.CommonProxy;
+import miscutil.core.creativetabs.AddToCreativeTab;
import miscutil.core.handler.CraftingManager;
import miscutil.core.lib.Strings;
import miscutil.core.util.Utils;
+import miscutil.gregtech.enums.MaterialsNew;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
@@ -26,8 +28,8 @@ implements ActionListener
{
//Vars
-
-
+ //EnumBuster EB = new EnumBuster(gregtech.api.enums.Materials, null);
+
@Mod.Instance(Strings.MODID)
public static MiscUtils instance;
@@ -39,9 +41,16 @@ implements ActionListener
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
-
+ try {
+ MaterialsNew.getGregMaterials();
+ } catch (IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException | NoSuchMethodException | SecurityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ //java.lang.reflect.Array.get(Materials, index)
Utils.LOG_INFO("Doing some house cleaning.");
- TMCreativeTabs.initialiseTabs();
+ AddToCreativeTab.initialiseTabs();
//TMEntity.mainRegistry();
CraftingManager.mainRegistry();
//TMWorld.mainRegistry();
diff --git a/src/Java/miscutil/core/CommonProxy.java b/src/Java/miscutil/core/CommonProxy.java
deleted file mode 100644
index 8b0f6c8b2a..0000000000
--- a/src/Java/miscutil/core/CommonProxy.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package miscutil.core;
-
-import miscutil.core.block.ModBlocks;
-import miscutil.core.gui.ModGUI;
-import miscutil.core.item.ModItems;
-import miscutil.core.lib.Strings;
-import miscutil.core.tileentities.ModTileEntities;
-import miscutil.core.util.Utils;
-import miscutil.gregtech.init.InitGregtech;
-import cpw.mods.fml.common.Loader;
-import cpw.mods.fml.common.event.FMLInitializationEvent;
-import cpw.mods.fml.common.event.FMLPostInitializationEvent;
-import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-
-public class CommonProxy {
-
- public void preInit(FMLPreInitializationEvent e) {
- ModItems.init();
- ModBlocks.init();
-
-
- //Register Gregtech related items
- if (Loader.isModLoaded("gregtech") == true) {
- Utils.LOG_INFO("Gregtech Found - Loading Resources.");
- Strings.GREGTECH = true;
- Utils.LOG_INFO("Begining registration & initialization of Gregtech related content.");
- // Init Gregtech
- InitGregtech.run();
-
- }
- else {
- Utils.LOG_WARNING("Gregtech not Found - Skipping Resources.");
- Strings.GREGTECH = false;
- }
-
- }
-
- public void init(FMLInitializationEvent e) {
-
-
-
- }
-
- public void postInit(FMLPostInitializationEvent e) {
-
- }
-
- public void registerNetworkStuff(){
- ModGUI.init();
- //NetworkRegistry.INSTANCE.registerGuiHandler(MiscUtils.instance, new BloodSteelFurnaceGuiHandler());
-
- }
-
- public void registerTileEntities(){
- ModTileEntities.init();
- //GameRegistry.registerTileEntity(TileEntityBloodSteelChest.class, "tileEntityBloodSteelChest");
- //GameRegistry.registerTileEntity(TileEntityBloodSteelFurnace.class, "tileEntityBloodSteelFurnace");
- //GameRegistry.registerTileEntity(TileEntityBloodSteelChest.class, Strings.MODID);
- //GameRegistry.registerTileEntity(TileEntityArcaneInfuser.class, "TileEntityArcaneInfuser");
- }
-
- public void registerRenderThings() {
-
- }
-
- public int addArmor(String armor) {
- return 0;
- }
-
-}
diff --git a/src/Java/miscutil/core/block/BasicBlock.java b/src/Java/miscutil/core/block/BasicBlock.java
index 63c1044b03..25009e77ba 100644
--- a/src/Java/miscutil/core/block/BasicBlock.java
+++ b/src/Java/miscutil/core/block/BasicBlock.java
@@ -1,6 +1,6 @@
package miscutil.core.block;
-import miscutil.core.creativetabs.TMCreativeTabs;
+import miscutil.core.creativetabs.AddToCreativeTab;
import miscutil.core.lib.Strings;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -11,7 +11,7 @@ public class BasicBlock extends Block {
super(material);
this.setBlockName(unlocalizedName);
this.setBlockTextureName(Strings.MODID + ":" + unlocalizedName);
- this.setCreativeTab(TMCreativeTabs.tabBlock);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
this.setHardness(2.0F);
this.setResistance(6.0F);
this.setLightLevel(0.0F);
diff --git a/src/Java/miscutil/core/block/ModBlocks.java b/src/Java/miscutil/core/block/ModBlocks.java
index 7f1df843be..86f36a6b9e 100644
--- a/src/Java/miscutil/core/block/ModBlocks.java
+++ b/src/Java/miscutil/core/block/ModBlocks.java
@@ -1,5 +1,6 @@
package miscutil.core.block;
+import static miscutil.core.creativetabs.AddToCreativeTab.tabBlock;
import miscutil.core.util.Utils;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -11,6 +12,7 @@ public final class ModBlocks {
public static Block blockBloodSteel;
public static Block blockStaballoy;
public static Block blockToolBuilder;
+ public static Block blockGriefSaver;
//public static Block blockBloodSteelChest;
//BloodSteelorial Furnace
@@ -85,6 +87,10 @@ public final class ModBlocks {
//Block Storage
//GameRegistry.registerBlock(emxBlockStorage, emxBlockStorage.getUnlocalizedName());
+
+ //blockGriefSaver Block
+ GameRegistry.registerBlock(blockGriefSaver = new AdvancedBlock("blockGriefSaver", Material.circuits, tabBlock, 2.0F, 10.0F, 0, "axe", 2, Block.soundTypeMetal), "blockGriefSaver");
+
}
} \ No newline at end of file
diff --git a/src/Java/miscutil/core/commands/CommandMath.java b/src/Java/miscutil/core/commands/CommandMath.java
index 933684d277..bf5e52ad94 100644
--- a/src/Java/miscutil/core/commands/CommandMath.java
+++ b/src/Java/miscutil/core/commands/CommandMath.java
@@ -15,14 +15,14 @@ import net.minecraft.world.World;
public class CommandMath implements ICommand
{
- private final List aliases;
+ private final List<String> aliases;
protected String fullEntityName;
protected Entity conjuredEntity;
public CommandMath()
{
- aliases = new ArrayList();
+ aliases = new ArrayList<String>();
aliases.add("hometele");
@@ -52,7 +52,7 @@ public class CommandMath implements ICommand
}
@Override
- public List getCommandAliases()
+ public List<String> getCommandAliases()
{
return this.aliases;
@@ -167,7 +167,7 @@ public class CommandMath implements ICommand
}
@Override
- public List addTabCompletionOptions(ICommandSender var1, String[] var2)
+ public List<?> addTabCompletionOptions(ICommandSender var1, String[] var2)
{
// TODO Auto-generated method stub
diff --git a/src/Java/miscutil/core/creativetabs/TMCreativeTabs.java b/src/Java/miscutil/core/creativetabs/AddToCreativeTab.java
index 05d170d6e1..2cde6be1ad 100644
--- a/src/Java/miscutil/core/creativetabs/TMCreativeTabs.java
+++ b/src/Java/miscutil/core/creativetabs/AddToCreativeTab.java
@@ -2,7 +2,7 @@ package miscutil.core.creativetabs;
import net.minecraft.creativetab.CreativeTabs;
-public class TMCreativeTabs {
+public class AddToCreativeTab {
public static CreativeTabs tabBlock;
public static CreativeTabs tabMisc;
diff --git a/src/Java/miscutil/core/item/ModItems.java b/src/Java/miscutil/core/item/ModItems.java
index 7b84f3c589..5ccc7be942 100644
--- a/src/Java/miscutil/core/item/ModItems.java
+++ b/src/Java/miscutil/core/item/ModItems.java
@@ -1,6 +1,7 @@
package miscutil.core.item;
-import miscutil.core.creativetabs.TMCreativeTabs;
+import static miscutil.core.creativetabs.AddToCreativeTab.tabMisc;
+import miscutil.core.creativetabs.AddToCreativeTab;
import miscutil.core.item.effects.RarityUncommon;
import miscutil.core.item.tool.staballoy.StaballoyPickaxe;
import miscutil.core.lib.Strings;
@@ -13,7 +14,7 @@ import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
public final class ModItems {
-/* A name for the material. This should be the same as the name of the variable we use to store the material (in this case "TUTORIAL").
+ /* A name for the material. This should be the same as the name of the variable we use to store the material (in this case "TUTORIAL").
A harvest level for pickaxes. This is a value between 0 and 3 and defines which blocks can be mined with this tool. Its also possible to create blocks which need a higher harvest level than 3, but then you are not able to mine them with vanilla tools.
Common values for the harvest level are:
Wood/Gold Tool: 0
@@ -103,17 +104,16 @@ public final class ModItems {
//Misc Items
public static Item itemIngotBloodSteel;
public static Item itemPlateBloodSteel;
-
+
//Staballoy
public static Item itemStaballoyPickaxe;
public static Item itemPlateStaballoy;
public static Item itemIngotStaballoy;
-
+
//@SuppressWarnings("unused")
- @SuppressWarnings("unused")
public static final void init(){
/*
@@ -170,14 +170,14 @@ public final class ModItems {
if (Loader.isModLoaded("EnderIO") == true || Strings.LOAD_ALL_CONTENT){
Utils.LOG_INFO("EnderIO Found - Loading Resources.");
//Item Init
- itemPlateSoularium = new Item().setUnlocalizedName("itemPlateSoularium").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateSoularium");;
- itemPlateRedstoneAlloy = new Item().setUnlocalizedName("itemPlateRedstoneAlloy").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateRedstoneAlloy");;
- itemPlateElectricalSteel = new Item().setUnlocalizedName("itemPlateElectricalSteel").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateElectricalSteel");;
- itemPlatePulsatingIron = new Item().setUnlocalizedName("itemPlatePulsatingIron").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlatePulsatingIron");;
- itemPlateEnergeticAlloy = new Item().setUnlocalizedName("itemPlateEnergeticAlloy").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateEnergeticAlloy");;
- itemPlateVibrantAlloy = new Item().setUnlocalizedName("itemPlateVibrantAlloy").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateVibrantAlloy");;
- itemPlateConductiveIron = new Item().setUnlocalizedName("itemPlateConductiveIron").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateConductiveIron");;
- itemPlateDarkSteel = new Item().setUnlocalizedName("itemPlateDarkSteel").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateDarkSteel");;
+ itemPlateSoularium = new Item().setUnlocalizedName("itemPlateSoularium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateSoularium");;
+ itemPlateRedstoneAlloy = new Item().setUnlocalizedName("itemPlateRedstoneAlloy").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateRedstoneAlloy");;
+ itemPlateElectricalSteel = new Item().setUnlocalizedName("itemPlateElectricalSteel").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateElectricalSteel");;
+ itemPlatePulsatingIron = new Item().setUnlocalizedName("itemPlatePulsatingIron").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlatePulsatingIron");;
+ itemPlateEnergeticAlloy = new Item().setUnlocalizedName("itemPlateEnergeticAlloy").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateEnergeticAlloy");;
+ itemPlateVibrantAlloy = new Item().setUnlocalizedName("itemPlateVibrantAlloy").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateVibrantAlloy");;
+ itemPlateConductiveIron = new Item().setUnlocalizedName("itemPlateConductiveIron").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateConductiveIron");;
+ itemPlateDarkSteel = new Item().setUnlocalizedName("itemPlateDarkSteel").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateDarkSteel");;
//Registry
@@ -198,9 +198,9 @@ public final class ModItems {
if (Loader.isModLoaded("BigReactors") == true || Strings.LOAD_ALL_CONTENT){
Utils.LOG_INFO("BigReactors Found - Loading Resources.");
//Item Init
- itemPlateBlutonium = new Item().setUnlocalizedName("itemPlateBlutonium").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateBlutonium");;
- itemPlateCyanite = new Item().setUnlocalizedName("itemPlateCyanite").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateCyanite");;
- itemPlateLudicrite = new Item().setUnlocalizedName("itemPlateLudicrite").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateLudicrite");;
+ itemPlateBlutonium = new Item().setUnlocalizedName("itemPlateBlutonium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateBlutonium");;
+ itemPlateCyanite = new Item().setUnlocalizedName("itemPlateCyanite").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateCyanite");;
+ itemPlateLudicrite = new Item().setUnlocalizedName("itemPlateLudicrite").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateLudicrite");;
//Registry
GameRegistry.registerItem(itemPlateBlutonium, "itemPlateBlutonium");
@@ -216,7 +216,7 @@ public final class ModItems {
if (Loader.isModLoaded("Thaumcraft") == true || Strings.LOAD_ALL_CONTENT){
Utils.LOG_INFO("Thaumcraft Found - Loading Resources.");
//Item Init
- itemPlateVoidMetal = new Item().setUnlocalizedName("itemPlateVoidMetal").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateVoidMetal");;
+ itemPlateVoidMetal = new Item().setUnlocalizedName("itemPlateVoidMetal").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateVoidMetal");;
//Registry
GameRegistry.registerItem(itemPlateVoidMetal, "itemPlateVoidMetal");
@@ -230,7 +230,7 @@ public final class ModItems {
if (Loader.isModLoaded("ExtraUtilities") == true || Strings.LOAD_ALL_CONTENT){
Utils.LOG_INFO("ExtraUtilities Found - Loading Resources.");
//Item Init
- itemPlateBedrockium = new Item().setUnlocalizedName("itemPlateBedrockium").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateBedrockium");;
+ itemPlateBedrockium = new Item().setUnlocalizedName("itemPlateBedrockium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateBedrockium");;
//Registry
GameRegistry.registerItem(itemPlateBedrockium, "itemPlateBedrockium");
@@ -244,7 +244,7 @@ public final class ModItems {
if (Loader.isModLoaded("PneumaticCraft") == true || Strings.LOAD_ALL_CONTENT){
Utils.LOG_INFO("PneumaticCraft Found - Loading Resources.");
//Item Init
- itemPlateCompressedIron = new Item().setUnlocalizedName("itemPlateCompressedIron").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateCompressedIron");;
+ itemPlateCompressedIron = new Item().setUnlocalizedName("itemPlateCompressedIron").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateCompressedIron");;
//Registry
GameRegistry.registerItem(itemPlateCompressedIron, "itemPlateCompressedIron");
@@ -258,7 +258,7 @@ public final class ModItems {
if (Loader.isModLoaded("simplyjetpacks") == true || Strings.LOAD_ALL_CONTENT){
Utils.LOG_INFO("SimplyJetpacks Found - Loading Resources.");
//Item Init
- itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateSoularium");;
+ itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateSoularium");;
//Registry
GameRegistry.registerItem(itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium");
@@ -273,7 +273,7 @@ public final class ModItems {
if (Loader.isModLoaded("rftools") == true || Strings.LOAD_ALL_CONTENT){
Utils.LOG_INFO("rfTools Found - Loading Resources.");
//Item Init
- itemPlateDimensionShard = new Item().setUnlocalizedName("itemPlateDimensionShard").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateDimensionShard");;
+ itemPlateDimensionShard = new Item().setUnlocalizedName("itemPlateDimensionShard").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemPlateDimensionShard");;
//Registry
GameRegistry.registerItem(itemPlateDimensionShard, "itemPlateDimensionShard");
@@ -290,20 +290,22 @@ public final class ModItems {
//Staballoy Equipment
Utils.LOG_INFO("Interest in Stablloy Found - Loading Resources.");
//Pickaxe
- itemStaballoyPickaxe = new StaballoyPickaxe("itemStaballoyPickaxe", STABALLOY).setCreativeTab(TMCreativeTabs.tabTools);
+ itemStaballoyPickaxe = new StaballoyPickaxe("itemStaballoyPickaxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools);
GameRegistry.registerItem(itemStaballoyPickaxe, itemStaballoyPickaxe.getUnlocalizedName());
//Staballoy Ingot/Plate
- itemIngotStaballoy = new Item().setUnlocalizedName("itemIngotStaballoy").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemIngotStaballoy");;
+ itemIngotStaballoy = new Item().setUnlocalizedName("itemIngotStaballoy").setCreativeTab(tabMisc).setTextureName(Strings.MODID + ":itemIngotStaballoy");;
GameRegistry.registerItem(itemIngotStaballoy, "itemIngotStaballoy");
- itemPlateStaballoy = new Item().setUnlocalizedName("itemPlateStaballoy").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemPlateStaballoy");;
+ itemPlateStaballoy = new Item().setUnlocalizedName("itemPlateStaballoy").setCreativeTab(tabMisc).setTextureName(Strings.MODID + ":itemPlateStaballoy");;
GameRegistry.registerItem(itemPlateStaballoy, "itemPlateStaballoy");
//GregTech_API.sRecipeAdder.addAlloySmelterRecipe(, aInput2, aOutput1, aDuration, aEUt)
-
-
-
+
+
//Blood Steel Ingot
- itemIngotBloodSteel = new Item().setUnlocalizedName("itemIngotBloodSteel").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemIngotBloodSteel");;
+ itemIngotBloodSteel = new Item().setUnlocalizedName("itemIngotBloodSteel").setCreativeTab(tabMisc).setTextureName(Strings.MODID + ":itemIngotBloodSteel");;
GameRegistry.registerItem(itemIngotBloodSteel, "itemIngotBloodSteel");
+ //Blood Steel Plate
+ itemPlateBloodSteel = new Item().setUnlocalizedName("itemPlateBloodSteel").setCreativeTab(tabMisc).setTextureName(Strings.MODID + ":itemPlateBloodSteel");;
+ GameRegistry.registerItem(itemPlateBloodSteel, "itemPlateBloodSteel");
}
diff --git a/src/Java/miscutil/core/item/materials/MaterialHandler.java b/src/Java/miscutil/core/item/materials/MaterialHandler.java
index 3c57d21f90..7a4f8aba05 100644
--- a/src/Java/miscutil/core/item/materials/MaterialHandler.java
+++ b/src/Java/miscutil/core/item/materials/MaterialHandler.java
@@ -2,6 +2,7 @@ package miscutil.core.item.materials;
public class MaterialHandler {
+ @SuppressWarnings("unused")
private String Staballoy;
diff --git a/src/Java/miscutil/core/lib/Strings.java b/src/Java/miscutil/core/lib/Strings.java
index 1213dc56ef..032d169c46 100644
--- a/src/Java/miscutil/core/lib/Strings.java
+++ b/src/Java/miscutil/core/lib/Strings.java
@@ -1,5 +1,7 @@
package miscutil.core.lib;
+import miscutil.core.creativetabs.AddToCreativeTab;
+
public class Strings {
public static final String name = "Misc. Utils";
@@ -10,6 +12,9 @@ public class Strings {
public static final boolean LOAD_ALL_CONTENT = false;
public static final int GREG_FIRST_ID = 760;
+
+ public static final Class<AddToCreativeTab> TAB = AddToCreativeTab.class;
+
//GUIS
public enum GUI_ENUM
{
diff --git a/src/Java/miscutil/core/proxy/ClientProxy.java b/src/Java/miscutil/core/proxy/ClientProxy.java
index f0f21549e8..2e754b9bf0 100644
--- a/src/Java/miscutil/core/proxy/ClientProxy.java
+++ b/src/Java/miscutil/core/proxy/ClientProxy.java
@@ -1,6 +1,6 @@
package miscutil.core.proxy;
-import miscutil.core.CommonProxy;
+import miscutil.core.common.CommonProxy;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
diff --git a/src/Java/miscutil/core/proxy/ServerProxy.java b/src/Java/miscutil/core/proxy/ServerProxy.java
index 59e625eaed..358436084d 100644
--- a/src/Java/miscutil/core/proxy/ServerProxy.java
+++ b/src/Java/miscutil/core/proxy/ServerProxy.java
@@ -1,6 +1,6 @@
package miscutil.core.proxy;
-import miscutil.core.CommonProxy;
+import miscutil.core.common.CommonProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
diff --git a/src/Java/miscutil/gregtech/init/machines/GregtechEnergyBuffer.java b/src/Java/miscutil/gregtech/init/machines/GregtechEnergyBuffer.java
index 8f74f71b69..5d2917da1b 100644
--- a/src/Java/miscutil/gregtech/init/machines/GregtechEnergyBuffer.java
+++ b/src/Java/miscutil/gregtech/init/machines/GregtechEnergyBuffer.java
@@ -4,7 +4,7 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
-import miscutil.core.creativetabs.TMCreativeTabs;
+import miscutil.core.creativetabs.AddToCreativeTab;
import miscutil.core.lib.Strings;
import miscutil.gregtech.enums.ExtraOreDictNames;
import miscutil.gregtech.enums.GregtechItemList;
@@ -34,7 +34,7 @@ public class GregtechEnergyBuffer
private static void run1()
{
- itemBufferCore = new Item().setUnlocalizedName("itemBufferCore").setCreativeTab(TMCreativeTabs.tabMisc).setTextureName(Strings.MODID + ":itemBufferCore");;
+ itemBufferCore = new Item().setUnlocalizedName("itemBufferCore").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(Strings.MODID + ":itemBufferCore");;
//Registry
GameRegistry.registerItem(itemBufferCore, "itemBufferCore");