From c9df7ad3da60cc46e84d33846a0c5e651689f709 Mon Sep 17 00:00:00 2001 From: TechLord22 <37029404+techlord22@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:39:38 -0500 Subject: [PATCH 1/3] dedicated large steam turbine recipemap --- .../supersymmetry/api/recipes/SuSyRecipeMaps.java | 11 ++++++++--- .../common/metatileentities/SuSyMetaTileEntities.java | 6 ++---- src/main/resources/assets/susy/lang/en_us.lang | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java b/src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java index 15ee59532..bfa086b26 100644 --- a/src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java +++ b/src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java @@ -12,9 +12,10 @@ import gregtechfoodoption.recipe.GTFORecipeMaps; import supersymmetry.api.gui.SusyGuiTextures; import supersymmetry.api.recipes.builders.*; -import static gregtech.api.recipes.RecipeMaps.MIXER_RECIPES; + import static gregtech.api.GTValues.LV; import static gregtech.api.GTValues.VA; +import static gregtech.api.recipes.RecipeMaps.MIXER_RECIPES; public class SuSyRecipeMaps { @@ -321,6 +322,12 @@ public class SuSyRecipeMaps { .setSound(GTSoundEvents.CHEMICAL_REACTOR) .setSmallRecipeMap(MIXER_RECIPES); + public static final RecipeMap LARGE_STEAM_TURBINE = new RecipeMap<>("large_steam_turbine", 1, 0, 2, 1, new FuelRecipeBuilder(), false) + .setSlotOverlay(false, true, GuiTextures.CENTRIFUGE_OVERLAY) + .setProgressBar(GuiTextures.PROGRESS_BAR_GAS_COLLECTOR, ProgressWidget.MoveType.HORIZONTAL) + .setSound(GTSoundEvents.TURBINE) + .allowEmptyOutput(); + public static void init(){ RecipeMaps.SIFTER_RECIPES.setMaxFluidInputs(1); RecipeMaps.SIFTER_RECIPES.setMaxFluidOutputs(1); @@ -347,8 +354,6 @@ public static void init(){ RecipeMaps.GAS_TURBINE_FUELS.setMaxFluidInputs(3); RecipeMaps.GAS_TURBINE_FUELS.setMaxFluidOutputs(1); RecipeMaps.GAS_TURBINE_FUELS.setMaxInputs(1); - RecipeMaps.STEAM_TURBINE_FUELS.setMaxFluidInputs(2); - RecipeMaps.STEAM_TURBINE_FUELS.setMaxInputs(1); RecipeMaps.AUTOCLAVE_RECIPES.setMaxFluidInputs(2); RecipeMaps.AUTOCLAVE_RECIPES.setMaxFluidOutputs(2); RecipeMaps.CHEMICAL_BATH_RECIPES.setMaxFluidInputs(3); diff --git a/src/main/java/supersymmetry/common/metatileentities/SuSyMetaTileEntities.java b/src/main/java/supersymmetry/common/metatileentities/SuSyMetaTileEntities.java index 14a4801cb..3f6e237ee 100644 --- a/src/main/java/supersymmetry/common/metatileentities/SuSyMetaTileEntities.java +++ b/src/main/java/supersymmetry/common/metatileentities/SuSyMetaTileEntities.java @@ -28,10 +28,8 @@ import supersymmetry.common.metatileentities.multi.primitive.MetaTileEntityPrimitiveMudPump; import supersymmetry.common.metatileentities.multiblockpart.SusyMetaTileEntityDumpingHatch; import supersymmetry.common.metatileentities.multiblockpart.SusyMetaTileEntityEnergyHatch; -import supersymmetry.common.metatileentities.single.storage.MetaTileEntityCryoDrum; import supersymmetry.common.metatileentities.single.steam.SuSySimpleSteamMetaTileEntity; -import supersymmetry.common.metatileentities.multi.electric.MetaTileEntityReverberatoryFurnace; -import supersymmetry.common.metatileentities.multi.electric.MetaTileEntityHighTemperatureDistillationTower; +import supersymmetry.common.metatileentities.single.storage.MetaTileEntityCryoDrum; import java.util.function.Function; @@ -238,7 +236,7 @@ public static void init() { NEW_ENERGY_OUTPUT_HATCH_16A[2] = registerMetaTileEntity(16005, new SusyMetaTileEntityEnergyHatch(susyId("energy_hatch.output_16a.hv"), 3, 16, true)); NEW_ENERGY_OUTPUT_HATCH_16A[3] = registerMetaTileEntity(16006, new SusyMetaTileEntityEnergyHatch(susyId("energy_hatch.output_16a.ev"), 4, 16, true)); - BASIC_STEAM_TURBINE = registerMetaTileEntity(17000, new MetaTileEntitySUSYLargeTurbine(susyId("basic_steam_turbine"), RecipeMaps.STEAM_TURBINE_FUELS, 1, MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.STEEL_TURBINE_CASING), Textures.SOLID_STEEL_CASING, SusyTextures.LARGE_STEAM_TURBINE_OVERLAY)); + BASIC_STEAM_TURBINE = registerMetaTileEntity(17000, new MetaTileEntitySUSYLargeTurbine(susyId("basic_steam_turbine"), SuSyRecipeMaps.LARGE_STEAM_TURBINE, 1, MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.STEEL_TURBINE_CASING), Textures.SOLID_STEEL_CASING, SusyTextures.LARGE_STEAM_TURBINE_OVERLAY)); BASIC_GAS_TURBINE = registerMetaTileEntity(17001, new MetaTileEntitySUSYLargeTurbine(susyId("basic_gas_turbine"), RecipeMaps.GAS_TURBINE_FUELS, 2, MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.STEEL_TURBINE_CASING), Textures.SOLID_STEEL_CASING, SusyTextures.LARGE_GAS_TURBINE_OVERLAY)); ADVANCED_ARC_FURNACE = registerMetaTileEntity(17003, new MetaTileEntityAdvancedArcFurnace(susyId("advanced_arc_furnace"))); diff --git a/src/main/resources/assets/susy/lang/en_us.lang b/src/main/resources/assets/susy/lang/en_us.lang index 336aabfd2..d62767c6b 100644 --- a/src/main/resources/assets/susy/lang/en_us.lang +++ b/src/main/resources/assets/susy/lang/en_us.lang @@ -653,6 +653,7 @@ recipemap.drone_pad.name=Drone Pad recipemap.polishing_machine=Polishing recipemap.gravity_separator=Gravity Separation recipemap.spinning.name=Textile Spinning +recipemap.large_steam_turbine.name=Large Steam Turbine gregtech.multiblock.primitive_mud_pump.description=The Primitive Mud Pump is a Steam Era multiblock that collects mud once per second, but only if it is in a river biome, and when the controller is between Y = 64 and Y = 80 (Inclusive). It can use a Pump, ULV, or LV Output Hatch. gregtech.multiblock.ocean_pumper.description=The Ocean Pumper is an electrically powered multiblock that collects a base amount of 8,000 L Seawater per second (at MV), but only if it is in an ocean biome, and when the controller is between Y = 70 and Y = 75 (Inclusive). It needs an output hatch, a maintenance hatch, and an energy input hatch. From 4d61a6a78f0f257f1ed7d122e36eb489e1a8c09f Mon Sep 17 00:00:00 2001 From: MCTian-mi <35869948+MCTian-mi@users.noreply.github.com> Date: Thu, 11 Jan 2024 21:26:47 +0800 Subject: [PATCH 2/3] update --- .../resources/assets/susy/lang/en_us.lang | 2 +- .../resources/assets/susy/lang/zh_cn.lang | 115 ++++++++++++------ 2 files changed, 79 insertions(+), 38 deletions(-) diff --git a/src/main/resources/assets/susy/lang/en_us.lang b/src/main/resources/assets/susy/lang/en_us.lang index 336aabfd2..efe354ef5 100644 --- a/src/main/resources/assets/susy/lang/en_us.lang +++ b/src/main/resources/assets/susy/lang/en_us.lang @@ -650,7 +650,7 @@ recipemap.blender.name=Blender recipemap.phase_separator.name=Phase Separation recipemap.bath_condenser.name=Bath Condenser recipemap.drone_pad.name=Drone Pad -recipemap.polishing_machine=Polishing +recipemap.polishing_machine.name=Polishing recipemap.gravity_separator=Gravity Separation recipemap.spinning.name=Textile Spinning diff --git a/src/main/resources/assets/susy/lang/zh_cn.lang b/src/main/resources/assets/susy/lang/zh_cn.lang index 3b95ac7e2..3e4a0a2fb 100644 --- a/src/main/resources/assets/susy/lang/zh_cn.lang +++ b/src/main/resources/assets/susy/lang/zh_cn.lang @@ -17,7 +17,7 @@ tile.drill_head.steel.name=钢制钻头 tile.susy_multiblock_casing.silicon_carbide_casing.name=坚固碳化硅外壳 tile.susy_multiblock_casing.sieve_tray.name=筛孔塔盘 -tile.susy_multiblock_casing.structural_packing.name=填料塔等板 +tile.susy_multiblock_casing.structural_packing.name=蒸馏塔塔板 tile.susy_multiblock_casing.ulv_structural_casing.name=基础结构外壳 tile.susy_multiblock_casing.drone_pad.name=停机坪方块 @@ -53,7 +53,7 @@ tile.structural_block_1.structural_block_vent_broken.name=损坏通风口结构 tile.deposit_block.orthomagmatic.name=正岩浆岩矿床方块 tile.deposit_block.metamorphic.name=变质岩矿床方块 tile.deposit_block.sedimentary.name=沉积岩矿床方块 -tile.deposit_block.hydrothermal.name=沉积岩矿床方块 +tile.deposit_block.hydrothermal.name=热液岩矿床方块 tile.deposit_block.alluvial.name=冲积岩矿床方块 tile.deposit_block.magmatic_hydrothermal.name=岩浆热液岩矿床方块 @@ -68,12 +68,13 @@ tile.resource_block.bastnasite_alluvial.name=冲积氟碳镧铈矿床 tile.resource_block.euxenite_alluvial.name=冲积黑稀金矿床 tile.resource_block.xenotime_alluvial.name=冲积磷钇矿床 tile.resource_block.gold_alluvial.name=冲积金矿床 -tile.resource_block.platinum_placer.name=铂砂矿床 +tile.resource_block.platinum_placer.name=砂铂矿床 tile.resource_block.phosphorite.name=磷块岩矿床 tile.resource_block.potash.name=钾盐矿床 +tile.resource_block.sulfur.name=硫矿床 -tile.multiblock_tank.clarifier.name=澄清池 -tile.multiblock_tank.flotation.name=浮选机 +tile.multiblock_tank.clarifier.name=沉淀槽体 +tile.multiblock_tank.flotation.name=浮选槽体 tile.evaporation_bed.dirt.name=蒸发池 @@ -171,20 +172,23 @@ item.material.oreprefix.oreSoapstone=皂石%s矿石 item.material.oreprefix.oreKimberlite=金伯利岩%s矿石 item.material.oreprefix.catalystBed=%s催化床 item.material.oreprefix.catalystPellet=%s催化剂颗粒 -item.material.oreprefix.flotated=浮选%s矿石 -item.material.oreprefix.concentrate=%s精矿 -item.material.oreprefix.sifted=筛选%s矿石 -item.material.oreprefix.sheetedFrame=%s板箱框 +item.material.oreprefix.dustFlotated=浮选%s粉 +item.material.oreprefix.dustConcentrate=%s精矿粉 +item.material.oreprefix.dustSifted=筛选%s粉 +item.material.oreprefix.sheetedFrame=%s板框箱 +item.material.oreprefix.fiber=%s纤维 +item.material.oreprefix.fiberWet=湿%s纤维 +item.material.oreprefix.thread=%s纱线 fluid.slurry.impure=含杂%s浆液 -fluid.slurry.pure=纯净%s浆液 +fluid.slurry.pure=%s浆液 # Machines/Multiblocks gregtech.machine.magnetic_refrigerator.name=磁制冷机 gregtech.multiblock.magnetic_refrigerator.min_temperature=§b最低温度:%s gregtech.machine.sintering_oven.name=烧结炉 -gregtech.multiblock.sintering_oven.can_use_plasma=允许使用等离子体:%s +gregtech.multiblock.sintering_oven.can_use_plasma=使用等离子体:%s gregtech.multiblocks.sintering_oven.use_plasma.affirmative=是 gregtech.multiblocks.sintering_oven.use_plasma.negative=否 @@ -228,7 +232,7 @@ gregtech.machine.clarifier.name=澄清池 gregtech.machine.dumper.name=废液排放机 gregtech.machine.evaporation_pool.name=蒸发池 gregtech.machine.flare_stack.name=火炬塔 -gregtech.machine.froth_flotation_tank.name=浮选机 +gregtech.machine.froth_flotation_tank.name=泡沫浮选机 gregtech.machine.multi_stage_flash_distiller.name=多级闪蒸室 gregtech.machine.high_temperature_distillation_tower.name=高温蒸馏塔 gregtech.machine.rotary_kiln.name=回转炉 @@ -236,6 +240,7 @@ gregtech.machine.low_pressure_cryogenic_distillation_plant.name=低压低温蒸 gregtech.machine.high_pressure_cryogenic_distillation_plant.name=高压低温蒸馏厂 gregtech.machine.single_column_cryogenic_distillation_plant.name=单塔式低温蒸馏厂 gregtech.machine.reverberatory_furnace.name=反射炉 +gregtech.machine.blender.name=搅拌器 gregtech.machine.drone_pad.name=无人机坪 @@ -246,7 +251,7 @@ gregtech.recipe.blocks=有效方块:%s # Latex Collector gregtech.machine.latex_collector.steam=需要蒸汽! -gregtech.machine.latex_collector.tooltip=以每tick%dL的速率从相邻的橡胶木中收集乳胶, +gregtech.machine.latex_collector.tooltip=以每tick%dL的速率从相邻的橡胶木中收集乳胶。 gregtech.machine.latex_collector.bronze.name=蒸汽胶乳收集器 gregtech.machine.latex_collector.steel.name=高压蒸汽胶乳收集器 gregtech.machine.latex_collector.lv.name=基础胶乳收集器 @@ -361,19 +366,19 @@ gregtech.machine.bubble_column_reactor.uxv.name=史诗鼓泡反应器 IV gregtech.machine.bubble_column_reactor.opv.name=传说鼓泡反应器 # Batch Reactor -gregtech.machine.batch_reactor.lv.name=基础间歇式反应器 -gregtech.machine.batch_reactor.mv.name=进阶间歇式反应器 -gregtech.machine.batch_reactor.hv.name=进阶间歇式反应器 II -gregtech.machine.batch_reactor.ev.name=进阶间歇式反应器 III -gregtech.machine.batch_reactor.iv.name=精英间歇式反应器 -gregtech.machine.batch_reactor.luv.name=精英间歇式反应器 II -gregtech.machine.batch_reactor.zpm.name=精英间歇式反应器 III -gregtech.machine.batch_reactor.uv.name=终极间歇式反应器 -gregtech.machine.batch_reactor.uhv.name=史诗间歇式反应器 -gregtech.machine.batch_reactor.uev.name=史诗间歇式反应器 II -gregtech.machine.batch_reactor.uiv.name=史诗间歇式反应器 III -gregtech.machine.batch_reactor.uxv.name=史诗间歇式反应器 IV -gregtech.machine.batch_reactor.opv.name=传说间歇式反应器 +gregtech.machine.batch_reactor.lv.name=基础间歇式反应釜 +gregtech.machine.batch_reactor.mv.name=进阶间歇式反应釜 +gregtech.machine.batch_reactor.hv.name=进阶间歇式反应釜 II +gregtech.machine.batch_reactor.ev.name=进阶间歇式反应釜 III +gregtech.machine.batch_reactor.iv.name=精英间歇式反应釜 +gregtech.machine.batch_reactor.luv.name=精英间歇式反应釜 II +gregtech.machine.batch_reactor.zpm.name=精英间歇式反应釜 III +gregtech.machine.batch_reactor.uv.name=终极间歇式反应釜 +gregtech.machine.batch_reactor.uhv.name=史诗间歇式反应釜 +gregtech.machine.batch_reactor.uev.name=史诗间歇式反应釜 II +gregtech.machine.batch_reactor.uiv.name=史诗间歇式反应釜 III +gregtech.machine.batch_reactor.uxv.name=史诗间歇式反应釜 IV +gregtech.machine.batch_reactor.opv.name=传说间歇式反应釜 # Crystallizer gregtech.machine.crystallizer.lv.name=基础结晶器 @@ -558,8 +563,38 @@ gregtech.machine.electrostatic_separator.uiv.name=史诗静电分离器 III gregtech.machine.electrostatic_separator.uxv.name=史诗静电分离器 IV gregtech.machine.electrostatic_separator.opv.name=传说静电分离器 +# Textile Spinner +gregtech.machine.textile_spinner.lv.name=基础纺线机 +gregtech.machine.textile_spinner.mv.name=进阶纺线机 +gregtech.machine.textile_spinner.hv.name=进阶纺线机 II +gregtech.machine.textile_spinner.ev.name=进阶纺线机 III +gregtech.machine.textile_spinner.iv.name=精英纺线机 +gregtech.machine.textile_spinner.luv.name=精英纺线机 II +gregtech.machine.textile_spinner.zpm.name=精英纺线机 III +gregtech.machine.textile_spinner.uv.name=终极纺线机 +gregtech.machine.textile_spinner.uhv.name=史诗纺线机 +gregtech.machine.textile_spinner.uev.name=史诗纺线机 II +gregtech.machine.textile_spinner.uiv.name=史诗纺线机 III +gregtech.machine.textile_spinner.uxv.name=史诗纺线机 IV +gregtech.machine.textile_spinner.opv.name=传说纺线机 + +# Polishing Machine +gregtech.machine.polishing_machine.lv.name=基础 +gregtech.machine.polishing_machine.mv.name=进阶抛光机 +gregtech.machine.polishing_machine.hv.name=进阶抛光机 II +gregtech.machine.polishing_machine.ev.name=进阶抛光机 III +gregtech.machine.polishing_machine.iv.name=精英抛光机 +gregtech.machine.polishing_machine.luv.name=精英抛光机 II +gregtech.machine.polishing_machine.zpm.name=精英抛光机 III +gregtech.machine.polishing_machine.uv.name=终极抛光机 +gregtech.machine.polishing_machine.uhv.name=史诗抛光机 +gregtech.machine.polishing_machine.uev.name=史诗抛光机 II +gregtech.machine.polishing_machine.uiv.name=史诗抛光机 III +gregtech.machine.polishing_machine.uxv.name=史诗抛光机 IV +gregtech.machine.polishing_machine.opv.name=传说抛光机 + gregtech.machine.bath_condenser.lv.name=浴式冷凝器 -gregtech.machine.bath_condenser.lv.tooltip=仅在低温蒸馏塔中工作 +gregtech.machine.bath_condenser.lv.tooltip=仅在低温蒸馏厂中工作 # Recipemaps recipemap.coagulation_tank.name=凝固 @@ -606,27 +641,31 @@ recipemap.clarifier.name=澄清池 recipemap.multi_stage_flash_distillation.name=多级闪蒸 recipemap.flare_stack.name=尾气燃烧 recipemap.dumping.name=废液排放 -recipemap.froth_flotation.name=浮选 +recipemap.froth_flotation.name=泡沫浮选 recipemap.rotary_kiln.name=回转炉 recipemap.low_pressure_cryogenic_distillation.name=低压低温蒸馏 recipemap.high_pressure_cryogenic_distillation.name=高压低温蒸馏 recipemap.reverberatory_furnace.name=反射炉 +recipemap.blender.name=混合搅拌 recipemap.phase_separator.name=相分离 recipemap.bath_condenser.name=浴式冷凝 recipemap.drone_pad.name=无人机坪 +recipemap.polishing_machine.name=抛光 +recipemap.gravity_separator=重力分离 +recipemap.spinning.name=纺线 -gregtech.multiblock.primitive_mud_pump.description=简易泥泵是一台蒸汽时代的多方块机器。当它的控制器方块被放置在河流生物群系中,且高度介于Y = 64与Y = 80(含)之间时将每秒收集一次泥。它可以使用ULV、LV输出仓或水泵输出仓。 -gregtech.multiblock.ocean_pumper.description=海水泵机是一台电力时代的多方块机器。当它的控制器方块被放置在海洋生物群系中,且高度介于Y = 70与Y = 75(含)之间时将每秒收集8,000 L海水。他需要输出总线、维修仓、能源仓各一。 +gregtech.multiblock.primitive_mud_pump.description=简易泥泵是一台蒸汽时代的多方块机器。当它的控制器方块处于河流生物群系,且高度介于 Y = 64 与 Y = 80 (含)之间时将每秒收集一次泥。它可以使用 ULV、LV 输出仓或水泵输出仓。 +gregtech.multiblock.ocean_pumper.description=海水泵机是一台电力时代的多方块机器。当它的控制器方块处于海洋生物群系,且高度介于 Y = 70 与 Y = 75 (含)之间时将每秒收集 8,000 L 海水。他需要输出总线、维修仓、能源仓各一。 # Energy Hatches -gregtech.machine.energy_hatch.output_4a.lv.name=4 安发电仓(LV) -gregtech.machine.energy_hatch.output_16a.lv.name=16 安发电仓(LV) -gregtech.machine.energy_hatch.output_4a.mv.name=4 安发电仓(MV) -gregtech.machine.energy_hatch.output_16a.mv.name=16 安发电仓(MV) -gregtech.machine.energy_hatch.output_4a.hv.name=4 安发电仓(HV) -gregtech.machine.energy_hatch.output_16a.hv.name=16 安发电仓(HV) -gregtech.machine.energy_hatch.output_16a.ev.name=16 安发电仓(EV) +gregtech.machine.energy_hatch.output_4a.lv.name=4 安动力仓(LV) +gregtech.machine.energy_hatch.output_16a.lv.name=16 安动力仓(LV) +gregtech.machine.energy_hatch.output_4a.mv.name=4 安动力仓(MV) +gregtech.machine.energy_hatch.output_16a.mv.name=16 安动力仓(MV) +gregtech.machine.energy_hatch.output_4a.hv.name=4 安动力仓(HV) +gregtech.machine.energy_hatch.output_16a.hv.name=16 安动力仓(HV) +gregtech.machine.energy_hatch.output_16a.ev.name=16 安动力仓(EV) # Other multiblock parts @@ -637,6 +676,8 @@ gregtech.machine.dumping_hatch.lv.name=销毁仓 metaitem.catalyst_bed_support_grid.name=催化床载体网格 metaitem.conveyor.steam.name=蒸汽传送带 metaitem.pump.steam.name=蒸汽泵 +metaitem.air_vent.name=进气扇 +metaitem.air_vent.tooltip=当面向空气时,为机器收集所处维度的空气 # Catalysts gregtech.universal.catalysts.tooltip.tier=§e最高电压:§f%,d EU/t(%s§f) From af705b01269bfac926df030ad15028900176ab61 Mon Sep 17 00:00:00 2001 From: mtbo <111296252+loxoDev@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:09:51 +0100 Subject: [PATCH 3/3] Fix coagulation tank (#185) * Fix coagulation tank * Put the max limit back in --- .../MetaTileEntityCoagulationTank.java | 76 ++++++++++--------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/primitive/MetaTileEntityCoagulationTank.java b/src/main/java/supersymmetry/common/metatileentities/multi/primitive/MetaTileEntityCoagulationTank.java index 9cbf270d9..abe26a8ba 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/primitive/MetaTileEntityCoagulationTank.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/primitive/MetaTileEntityCoagulationTank.java @@ -3,12 +3,13 @@ import codechicken.lib.render.CCRenderState; import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Matrix4; -import gregtech.api.capability.IMultipleTankHandler; -import gregtech.api.capability.impl.FluidTankList; import gregtech.api.capability.impl.ItemHandlerList; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; -import gregtech.api.gui.widgets.*; +import gregtech.api.gui.widgets.ProgressWidget; +import gregtech.api.gui.widgets.RecipeProgressWidget; +import gregtech.api.gui.widgets.SlotWidget; +import gregtech.api.gui.widgets.TankWidget; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; @@ -27,17 +28,14 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidTank; -import net.minecraftforge.items.IItemHandlerModifiable; -import supersymmetry.common.blocks.BlockCoagulationTankWall; import supersymmetry.api.recipes.SuSyRecipeMaps; import supersymmetry.client.renderer.textures.SusyTextures; +import supersymmetry.common.blocks.BlockCoagulationTankWall; import supersymmetry.common.blocks.SuSyBlocks; import javax.annotation.Nonnull; public class MetaTileEntityCoagulationTank extends RecipeMapPrimitiveMultiblockController { - protected IItemHandlerModifiable outputInventory; - protected IMultipleTankHandler inputFluidInventory; public MetaTileEntityCoagulationTank(ResourceLocation metaTileEntityId) { super(metaTileEntityId, SuSyRecipeMaps.COAGULATION_RECIPES); } @@ -50,15 +48,16 @@ protected BlockPattern createStructurePattern() { return FactoryBlockPattern.start() .aisle(new String[]{"XXX", "XXX", "XXX"}) .aisle(new String[]{"XXX", "X#X", "X#X"}).setRepeatable(1, 4) - .aisle(new String[]{"XXX", "XYX", "XXX"}) - .where('X', states(new IBlockState[]{SuSyBlocks.COAGULATION_TANK_WALL.getState(BlockCoagulationTankWall.CoagulationTankWallType.WOODEN_COAGULATION_TANK_WALL)}).or(abilities(new MultiblockAbility[]{MultiblockAbility.EXPORT_ITEMS}).setMinGlobalLimited(0).setMaxGlobalLimited(1)).or(abilities(new MultiblockAbility[]{MultiblockAbility.IMPORT_FLUIDS}).setMinGlobalLimited(0).setMaxGlobalLimited(1))) + .aisle(new String[]{"XXX", "XSX", "XXX"}) + .where('X', + states(new IBlockState[]{SuSyBlocks.COAGULATION_TANK_WALL + .getState(BlockCoagulationTankWall.CoagulationTankWallType.WOODEN_COAGULATION_TANK_WALL)}) + .or(abilities(MultiblockAbility.EXPORT_ITEMS) + .setMaxGlobalLimited(1)) + .or(abilities(MultiblockAbility.IMPORT_FLUIDS) + .setMaxGlobalLimited(1))) .where('#', air()) - .where('Y', this.selfPredicate()).build(); - } - - @Override - public void checkStructurePattern() { - super.checkStructurePattern(); + .where('S', this.selfPredicate()).build(); } public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { @@ -68,13 +67,22 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { protected ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) { ModularUI.Builder builder = ModularUI.builder(GuiTextures.PRIMITIVE_BACKGROUND, 176,166); builder.label(6, 6, this.getMetaFullName()); - builder.widget(new RecipeProgressWidget(this.recipeMapWorkable::getProgressPercent, 76, 41, 20, 15, GuiTextures.PRIMITIVE_BLAST_FURNACE_PROGRESS_BAR, ProgressWidget.MoveType.HORIZONTAL, SuSyRecipeMaps.COAGULATION_RECIPES)); - - builder.widget((new SlotWidget(this.importItems, 0, 30, 30, true, true).setBackgroundTexture(GuiTextures.PRIMITIVE_SLOT))); - builder.widget((new SlotWidget(this.importItems, 1, 48, 30, true, true).setBackgroundTexture(GuiTextures.PRIMITIVE_SLOT))); - builder.widget((new TankWidget(this.importFluids.getTankAt(1), 30, 48, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(GuiTextures.FLUID_SLOT).setContainerClicking(true, true)); - builder.widget((new TankWidget(this.importFluids.getTankAt(0), 48, 48, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(GuiTextures.FLUID_SLOT).setContainerClicking(true, true)); - builder.widget((new SlotWidget(this.exportItems, 0, 106, 39, true, false).setBackgroundTexture(GuiTextures.PRIMITIVE_SLOT))); + builder.widget(new RecipeProgressWidget(this.recipeMapWorkable::getProgressPercent, 76, 41, 20, 15, + GuiTextures.PRIMITIVE_BLAST_FURNACE_PROGRESS_BAR, ProgressWidget.MoveType.HORIZONTAL, SuSyRecipeMaps.COAGULATION_RECIPES)); + + builder.widget((new SlotWidget(this.importItems, 0, 30, 30, true, true) + .setBackgroundTexture(GuiTextures.PRIMITIVE_SLOT))); + builder.widget((new SlotWidget(this.importItems, 1, 48, 30, true, true) + .setBackgroundTexture(GuiTextures.PRIMITIVE_SLOT))); + builder.widget((new TankWidget(this.importFluids.getTankAt(1), 30, 48, 18, 18)) + .setAlwaysShowFull(true) + .setBackgroundTexture(GuiTextures.FLUID_SLOT) + .setContainerClicking(true, true)); + builder.widget((new TankWidget(this.importFluids.getTankAt(0), 48, 48, 18, 18)) + .setAlwaysShowFull(true).setBackgroundTexture(GuiTextures.FLUID_SLOT) + .setContainerClicking(true, true)); + builder.widget((new SlotWidget(this.exportItems, 0, 106, 39, true, false) + .setBackgroundTexture(GuiTextures.PRIMITIVE_SLOT))); return builder.bindPlayerInventory(entityPlayer.inventory, GuiTextures.PRIMITIVE_SLOT, 0); @@ -82,27 +90,28 @@ protected ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) { public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { super.renderMetaTileEntity(renderState, translation, pipeline); - this.getFrontOverlay().renderOrientedState(renderState, translation, pipeline, this.getFrontFacing(), this.recipeMapWorkable.isActive(), this.recipeMapWorkable.isWorkingEnabled()); + this.getFrontOverlay().renderOrientedState(renderState, translation, pipeline, this.getFrontFacing(), + this.recipeMapWorkable.isActive(), this.recipeMapWorkable.isWorkingEnabled()); } public void update() { super.update(); - if (this.getOffsetTimer() % 5 == 0){ - for (IFluidTank iFluidTank : this.inputFluidInventory.getFluidTanks()) { - if(iFluidTank.getFluid() != null){ + if (this.getOffsetTimer() % 5 == 0 && this.isStructureFormed()){ + for (IFluidTank tank : getAbilities(MultiblockAbility.IMPORT_FLUIDS)) { + if(tank.getFluid() != null){ NonNullList fluidStacks = NonNullList.create(); int toFill = (this.importFluids.getTankAt(0).getCapacity() - this.importFluids.getTankAt(0).getFluidAmount()); - int amount = Math.min(iFluidTank.getFluidAmount(), toFill); - fluidStacks.add(new FluidStack(iFluidTank.getFluid().getFluid(),amount)); + int amount = Math.min(tank.getFluidAmount(), toFill); + fluidStacks.add(new FluidStack(tank.getFluid().getFluid(),amount)); if(GTTransferUtils.addFluidsToFluidHandler(this.importFluids,true, fluidStacks)) { GTTransferUtils.addFluidsToFluidHandler(this.importFluids,false, fluidStacks); - iFluidTank.drain(amount, true); + tank.drain(amount, true); } } } for (int i = 0; i < this.exportItems.getSlots(); i++) { ItemStack stack = this.exportItems.getStackInSlot(i); - this.exportItems.setStackInSlot(i,GTTransferUtils.insertItem(this.outputInventory, stack,false)); + this.exportItems.setStackInSlot(i,GTTransferUtils.insertItem(new ItemHandlerList(this.getAbilities(MultiblockAbility.EXPORT_ITEMS)), stack,false)); } this.fillInternalTankFromFluidContainer(); } @@ -111,18 +120,11 @@ public void update() { @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); - this.reinitializeAbilities(); } @Override protected void initializeAbilities() { super.initializeAbilities(); - this.reinitializeAbilities(); - } - - private void reinitializeAbilities() { - this.outputInventory = new ItemHandlerList(this.getAbilities(MultiblockAbility.EXPORT_ITEMS)); - this.inputFluidInventory = new FluidTankList(false, this.getAbilities(MultiblockAbility.IMPORT_FLUIDS)); } @Nonnull