4440c2f305
# Conflicts: # build.gradle # src/main/java/techreborn/TechReborn.java # src/main/java/techreborn/blocks/BlockNuke.java # src/main/java/techreborn/blocks/BlockOre.java # src/main/java/techreborn/blocks/BlockRubberLog.java # src/main/java/techreborn/blocks/generator/BlockSolarPanel.java # src/main/java/techreborn/client/RegisterItemJsons.java # src/main/java/techreborn/client/container/builder/BuiltContainer.java # src/main/java/techreborn/client/container/builder/ContainerBuilder.java # src/main/java/techreborn/client/container/builder/ContainerPlayerInventoryBuilder.java # src/main/java/techreborn/client/container/builder/ContainerTileInventoryBuilder.java # src/main/java/techreborn/client/container/builder/slot/FilteredSlot.java # src/main/java/techreborn/client/container/builder/slot/SpriteSlot.java # src/main/java/techreborn/client/container/builder/slot/UpgradeSlot.java # src/main/java/techreborn/client/gui/GuiAESU.java # src/main/java/techreborn/client/gui/GuiAlloySmelter.java # src/main/java/techreborn/client/gui/GuiAssemblingMachine.java # src/main/java/techreborn/client/gui/GuiBase.java # src/main/java/techreborn/client/gui/GuiBlastFurnace.java # src/main/java/techreborn/client/gui/GuiChemicalReactor.java # src/main/java/techreborn/client/gui/GuiCompressor.java # src/main/java/techreborn/client/gui/GuiDieselGenerator.java # src/main/java/techreborn/client/gui/GuiDigitalChest.java # src/main/java/techreborn/client/gui/GuiDistillationTower.java # src/main/java/techreborn/client/gui/GuiElectricFurnace.java # src/main/java/techreborn/client/gui/GuiExtractor.java # src/main/java/techreborn/client/gui/GuiFluidReplicator.java # src/main/java/techreborn/client/gui/GuiFusionReactor.java # src/main/java/techreborn/client/gui/GuiGasTurbine.java # src/main/java/techreborn/client/gui/GuiGenerator.java # src/main/java/techreborn/client/gui/GuiGrinder.java # src/main/java/techreborn/client/gui/GuiImplosionCompressor.java # src/main/java/techreborn/client/gui/GuiIndustrialElectrolyzer.java # src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java # src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java # src/main/java/techreborn/client/gui/GuiIronFurnace.java # src/main/java/techreborn/client/gui/GuiManual.java # src/main/java/techreborn/client/gui/GuiQuantumChest.java # src/main/java/techreborn/client/gui/GuiRecycler.java # src/main/java/techreborn/client/gui/GuiScrapboxinator.java # src/main/java/techreborn/client/gui/GuiSemifluidGenerator.java # src/main/java/techreborn/client/gui/GuiThermalGenerator.java # src/main/java/techreborn/client/gui/GuiVacuumFreezer.java # src/main/java/techreborn/client/gui/TRBuilder.java # src/main/java/techreborn/client/gui/slot/GuiFluidConfiguration.java # src/main/java/techreborn/client/gui/slot/GuiSlotConfiguration.java # src/main/java/techreborn/client/gui/slot/elements/CheckBoxElement.java # src/main/java/techreborn/client/gui/slot/elements/ConfigSlotElement.java # src/main/java/techreborn/client/gui/slot/elements/ElementBase.java # src/main/java/techreborn/client/gui/slot/elements/FluidConfigPopupElement.java # src/main/java/techreborn/client/gui/slot/elements/ISprite.java # src/main/java/techreborn/client/gui/slot/elements/OffsetSprite.java # src/main/java/techreborn/client/gui/slot/elements/SlotConfigPopupElement.java # src/main/java/techreborn/client/gui/slot/elements/Sprite.java # src/main/java/techreborn/compat/CompatManager.java # src/main/java/techreborn/compat/ICompatModule.java # src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java # src/main/java/techreborn/compat/jei/BuiltContainerTransferInfo.java # src/main/java/techreborn/compat/jei/RecipeUtil.java # src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java # src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeWrapper.java # src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeCategory.java # src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeWrapper.java # src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeWrapper.java # src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeWrapper.java # src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeWrapper.java # src/main/java/techreborn/compat/jei/compressor/CompressorRecipeWrapper.java # src/main/java/techreborn/compat/jei/distillationTower/DistillationTowerRecipeWrapper.java # src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeWrapper.java # src/main/java/techreborn/compat/jei/fluidReplicator/FluidReplicatorRecipeWrapper.java # src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeCategory.java # src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeWrapper.java # src/main/java/techreborn/compat/jei/generators/fluid/FluidGeneratorRecipeWrapper.java # src/main/java/techreborn/compat/jei/grinder/GrinderRecipeWrapper.java # src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeWrapper.java # src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeWrapper.java # src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java # src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeCategory.java # src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeCategory.java # src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeWrapper.java # src/main/java/techreborn/events/BlockBreakHandler.java # src/main/java/techreborn/events/StackToolTipEvent.java # src/main/java/techreborn/init/IC2Duplicates.java # src/main/java/techreborn/init/ModItems.java # src/main/java/techreborn/init/ModRecipes.java # src/main/java/techreborn/init/OreDict.java # src/main/java/techreborn/init/recipes/AlloySmelterRecipes.java # src/main/java/techreborn/init/recipes/ChemicalReactorRecipes.java # src/main/java/techreborn/init/recipes/CraftingTableRecipes.java # src/main/java/techreborn/init/recipes/FusionReactorRecipes.java # src/main/java/techreborn/init/recipes/IndustrialCentrifugeRecipes.java # src/main/java/techreborn/init/recipes/IndustrialSawmillRecipes.java # src/main/java/techreborn/init/recipes/RollingMachineRecipes.java # src/main/java/techreborn/init/recipes/ScrapboxRecipes.java # src/main/java/techreborn/items/ItemDestructopack.java # src/main/java/techreborn/items/ItemFrequencyTransmitter.java # src/main/java/techreborn/items/ItemManual.java # src/main/java/techreborn/items/ItemMissingRecipe.java # src/main/java/techreborn/items/ItemScrapBox.java # src/main/java/techreborn/items/ItemTechManual.java # src/main/java/techreborn/items/ItemUUmatter.java # src/main/java/techreborn/items/ItemUpgrade.java # src/main/java/techreborn/items/ItemUpgrades.java # src/main/java/techreborn/items/armor/ItemCloakingDevice.java # src/main/java/techreborn/items/ingredients/ItemDusts.java # src/main/java/techreborn/items/ingredients/ItemDustsSmall.java # src/main/java/techreborn/items/ingredients/ItemGems.java # src/main/java/techreborn/items/ingredients/ItemIngots.java # src/main/java/techreborn/items/ingredients/ItemNuggets.java # src/main/java/techreborn/items/ingredients/ItemParts.java # src/main/java/techreborn/items/ingredients/ItemPlates.java # src/main/java/techreborn/items/ingredients/ItemUUmatter.java # src/main/java/techreborn/items/tool/ItemDebugTool.java # src/main/java/techreborn/items/tool/ItemTreeTap.java # src/main/java/techreborn/items/tool/basic/ItemElectricTreetap.java # src/main/java/techreborn/items/tools/ItemTechManual.java # src/main/java/techreborn/items/tools/ItemTreeTap.java # src/main/java/techreborn/items/tools/ItemWrench.java # src/main/java/techreborn/lib/ModInfo.java # src/main/java/techreborn/proxies/ClientProxy.java # src/main/java/techreborn/tiles/TileChargeOMat.java # src/main/java/techreborn/tiles/TileChunkLoader.java # src/main/java/techreborn/tiles/TileDigitalChest.java # src/main/java/techreborn/tiles/TileIndustrialCentrifuge.java # src/main/java/techreborn/tiles/TileMatterFabricator.java # src/main/java/techreborn/tiles/TileQuantumChest.java # src/main/java/techreborn/tiles/TileQuantumTank.java # src/main/java/techreborn/tiles/cable/TileCable.java # src/main/java/techreborn/tiles/fusionReactor/TileFusionControlComputer.java # src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java # src/main/java/techreborn/tiles/generator/TilePlasmaGenerator.java # src/main/java/techreborn/tiles/generator/advanced/TileDieselGenerator.java # src/main/java/techreborn/tiles/generator/advanced/TileGasTurbine.java # src/main/java/techreborn/tiles/generator/advanced/TileSemiFluidGenerator.java # src/main/java/techreborn/tiles/generator/advanced/TileThermalGenerator.java # src/main/java/techreborn/tiles/generator/basic/TileSolidFuelGenerator.java # src/main/java/techreborn/tiles/machine/iron/TileIronAlloyFurnace.java # src/main/java/techreborn/tiles/machine/multiblock/TileDistillationTower.java # src/main/java/techreborn/tiles/machine/multiblock/TileFluidReplicator.java # src/main/java/techreborn/tiles/machine/multiblock/TileImplosionCompressor.java # src/main/java/techreborn/tiles/machine/multiblock/TileIndustrialBlastFurnace.java # src/main/java/techreborn/tiles/machine/multiblock/TileIndustrialGrinder.java # src/main/java/techreborn/tiles/machine/multiblock/TileIndustrialSawmill.java # src/main/java/techreborn/tiles/machine/multiblock/TileVacuumFreezer.java # src/main/java/techreborn/tiles/machine/tier1/TileAlloySmelter.java # src/main/java/techreborn/tiles/machine/tier1/TileAssemblingMachine.java # src/main/java/techreborn/tiles/machine/tier1/TileAutoCraftingTable.java # src/main/java/techreborn/tiles/machine/tier1/TileChemicalReactor.java # src/main/java/techreborn/tiles/machine/tier1/TileCompressor.java # src/main/java/techreborn/tiles/machine/tier1/TileElectricFurnace.java # src/main/java/techreborn/tiles/machine/tier1/TileExtractor.java # src/main/java/techreborn/tiles/machine/tier1/TileGrinder.java # src/main/java/techreborn/tiles/machine/tier1/TileIndustrialElectrolyzer.java # src/main/java/techreborn/tiles/machine/tier1/TileRecycler.java # src/main/java/techreborn/tiles/machine/tier1/TileRollingMachine.java # src/main/java/techreborn/tiles/machine/tier1/TileScrapboxinator.java # src/main/java/techreborn/tiles/storage/TileAdjustableSU.java # src/main/java/techreborn/tiles/storage/TileEnergyStorage.java # src/main/java/techreborn/tiles/storage/TileHighVoltageSU.java # src/main/java/techreborn/tiles/storage/TileLowVoltageSU.java # src/main/java/techreborn/tiles/storage/TileMediumVoltageSU.java # src/main/java/techreborn/tiles/storage/idsu/TileInterdimensionalSU.java # src/main/java/techreborn/tiles/storage/lesu/TileLapotronicSU.java # src/main/java/techreborn/utils/StackWIPHandler.java # src/main/java/techreborn/world/TechRebornRetroGen.java # src/main/resources/assets/techreborn/textures/items/armor/lithium_batpack.png
175 lines
7.3 KiB
Java
175 lines
7.3 KiB
Java
/*
|
|
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
|
*
|
|
* Copyright (c) 2018 TechReborn
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
* in the Software without restriction, including without limitation the rights
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
* furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
* copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
* SOFTWARE.
|
|
*/
|
|
|
|
package techreborn.client;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.tileentity.TileEntity;
|
|
import net.minecraft.util.math.BlockPos;
|
|
import net.minecraft.world.World;
|
|
import net.minecraftforge.fml.common.network.IGuiHandler;
|
|
import techreborn.client.container.ContainerDestructoPack;
|
|
import reborncore.client.containerBuilder.IContainerProvider;
|
|
import techreborn.client.gui.*;
|
|
import techreborn.client.gui.GuiAutoCrafting;
|
|
import techreborn.tiles.*;
|
|
import techreborn.tiles.fusionReactor.TileFusionControlComputer;
|
|
import techreborn.tiles.generator.*;
|
|
import techreborn.tiles.generator.advanced.TileDieselGenerator;
|
|
import techreborn.tiles.generator.advanced.TileGasTurbine;
|
|
import techreborn.tiles.generator.advanced.TileSemiFluidGenerator;
|
|
import techreborn.tiles.generator.advanced.TileThermalGenerator;
|
|
import techreborn.tiles.generator.basic.TileSolidFuelGenerator;
|
|
import techreborn.tiles.storage.idsu.TileInterdimensionalSU;
|
|
import techreborn.tiles.storage.lesu.TileLapotronicSU;
|
|
import techreborn.tiles.machine.multiblock.*;
|
|
import techreborn.tiles.storage.TileAdjustableSU;
|
|
import techreborn.tiles.storage.TileHighVoltageSU;
|
|
import techreborn.tiles.storage.TileLowVoltageSU;
|
|
import techreborn.tiles.storage.TileMediumVoltageSU;
|
|
import techreborn.tiles.machine.iron.TileIronAlloyFurnace;
|
|
import techreborn.tiles.machine.iron.TileIronFurnace;
|
|
import techreborn.tiles.machine.tier1.*;
|
|
|
|
public class GuiHandler implements IGuiHandler {
|
|
|
|
@Override
|
|
public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
|
|
final int y, final int z) {
|
|
|
|
final EGui gui = EGui.values()[ID];
|
|
final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
|
|
|
|
if (gui.useContainerBuilder() && tile != null)
|
|
return ((IContainerProvider) tile).createContainer(player);
|
|
|
|
switch (gui) {
|
|
case DESTRUCTOPACK:
|
|
return new ContainerDestructoPack(player);
|
|
default:
|
|
break;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
|
|
final int y, final int z) {
|
|
final EGui gui = EGui.values()[ID];
|
|
final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
|
|
|
|
switch (gui) {
|
|
case AESU:
|
|
return new GuiAESU(player, (TileAdjustableSU) tile);
|
|
case ALLOY_FURNACE:
|
|
return new GuiAlloyFurnace(player, (TileIronAlloyFurnace) tile);
|
|
case ALLOY_SMELTER:
|
|
return new GuiAlloySmelter(player, (TileAlloySmelter) tile);
|
|
case ASSEMBLING_MACHINE:
|
|
return new GuiAssemblingMachine(player, (TileAssemblingMachine) tile);
|
|
case LOW_VOLTAGE_SU:
|
|
return new GuiBatbox(player, (TileLowVoltageSU) tile);
|
|
case BLAST_FURNACE:
|
|
return new GuiBlastFurnace(player, (TileIndustrialBlastFurnace) tile);
|
|
case CENTRIFUGE:
|
|
return new GuiCentrifuge(player, (TileIndustrialCentrifuge) tile);
|
|
case CHARGEBENCH:
|
|
return new GuiChargeBench(player, (TileChargeOMat) tile);
|
|
case CHEMICAL_REACTOR:
|
|
return new GuiChemicalReactor(player, (TileChemicalReactor) tile);
|
|
case CHUNK_LOADER:
|
|
return new GuiChunkLoader(player, (TileChunkLoader) tile);
|
|
case COMPRESSOR:
|
|
return new GuiCompressor(player, (TileCompressor) tile);
|
|
case DESTRUCTOPACK:
|
|
return new GuiDestructoPack(new ContainerDestructoPack(player));
|
|
case DIESEL_GENERATOR:
|
|
return new GuiDieselGenerator(player, (TileDieselGenerator) tile);
|
|
case DIGITAL_CHEST:
|
|
return new GuiDigitalChest(player, (TileDigitalChest) tile);
|
|
case ELECTRIC_FURNACE:
|
|
return new GuiElectricFurnace(player, (TileElectricFurnace) tile);
|
|
case EXTRACTOR:
|
|
return new GuiExtractor(player, (TileExtractor) tile);
|
|
case FUSION_CONTROLLER:
|
|
return new GuiFusionReactor(player, (TileFusionControlComputer) tile);
|
|
case GAS_TURBINE:
|
|
return new GuiGasTurbine(player, (TileGasTurbine) tile);
|
|
case GENERATOR:
|
|
return new GuiGenerator(player, (TileSolidFuelGenerator) tile);
|
|
case GRINDER:
|
|
return new GuiGrinder(player, (TileGrinder) tile);
|
|
case IDSU:
|
|
return new GuiIDSU(player, (TileInterdimensionalSU) tile);
|
|
case IMPLOSION_COMPRESSOR:
|
|
return new GuiImplosionCompressor(player, (TileImplosionCompressor) tile);
|
|
case INDUSTRIAL_ELECTROLYZER:
|
|
return new GuiIndustrialElectrolyzer(player, (TileIndustrialElectrolyzer) tile);
|
|
case INDUSTRIAL_GRINDER:
|
|
return new GuiIndustrialGrinder(player, (TileIndustrialGrinder) tile);
|
|
case IRON_FURNACE:
|
|
return new GuiIronFurnace(player, (TileIronFurnace) tile);
|
|
case LESU:
|
|
return new GuiLESU(player, (TileLapotronicSU) tile);
|
|
case MATTER_FABRICATOR:
|
|
return new GuiMatterFabricator(player, (TileMatterFabricator) tile);
|
|
case MEDIUM_VOLTAGE_SU:
|
|
return new GuiMFE(player, (TileMediumVoltageSU) tile);
|
|
case HIGH_VOLTAGE_SU:
|
|
return new GuiMFSU(player, (TileHighVoltageSU) tile);
|
|
case QUANTUM_CHEST:
|
|
return new GuiQuantumChest(player, (TileQuantumChest) tile);
|
|
case QUANTUM_TANK:
|
|
return new GuiQuantumTank(player, (TileQuantumTank) tile);
|
|
case RECYCLER:
|
|
return new GuiRecycler(player, (TileRecycler) tile);
|
|
case ROLLING_MACHINE:
|
|
return new GuiRollingMachine(player, (TileRollingMachine) tile);
|
|
case SAWMILL:
|
|
return new GuiIndustrialSawmill(player, (TileIndustrialSawmill) tile);
|
|
case SCRAPBOXINATOR:
|
|
return new GuiScrapboxinator(player, (TileScrapboxinator) tile);
|
|
case SEMIFLUID_GENERATOR:
|
|
return new GuiSemifluidGenerator(player, (TileSemiFluidGenerator) tile);
|
|
case THERMAL_GENERATOR:
|
|
return new GuiThermalGenerator(player, (TileThermalGenerator) tile);
|
|
case VACUUM_FREEZER:
|
|
return new GuiVacuumFreezer(player, (TileVacuumFreezer) tile);
|
|
case AUTO_CRAFTING_TABLE:
|
|
return new GuiAutoCrafting(player, (TileAutoCraftingTable) tile);
|
|
case PLASMA_GENERATOR:
|
|
return new GuiPlasmaGenerator(player, (TilePlasmaGenerator) tile);
|
|
case DISTILLATION_TOWER:
|
|
return new GuiDistillationTower(player, (TileDistillationTower) tile);
|
|
case MANUAL:
|
|
return new GuiManual(player);
|
|
case FLUID_REPLICATOR:
|
|
return new GuiFluidReplicator(player, (TileFluidReplicator) tile);
|
|
default:
|
|
break;
|
|
|
|
}
|
|
return null;
|
|
}
|
|
}
|