Skip to content

Commit

Permalink
Added gas centrifuge multiblock
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalgo239 authored and serenibyss committed Dec 7, 2023
1 parent b56ae31 commit dcefad5
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/java/gregtech/api/recipes/RecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,9 @@ public class RecipeMaps {
public static final RecipeMap<SimpleRecipeBuilder> SPENT_FUEL_POOL_RECIPES = new RecipeMap<>("spent_fuel_pool", 1, 1, 1, 1, new SimpleRecipeBuilder(), false)
.setProgressBar(GuiTextures.PROGRESS_BAR_BATH, MoveType.HORIZONTAL);

public static final RecipeMap<SimpleRecipeBuilder> GAS_CENTRIFUGE_RECIPES = new RecipeMap<>("gas_centrifuge", 0, 0, 1, 2, new SimpleRecipeBuilder(), false)
.setProgressBar(GuiTextures.CENTRIFUGE_OVERLAY, MoveType.CIRCULAR);

//////////////////////////////////////
// Fuel Recipe Maps //
//////////////////////////////////////
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/gregtech/common/blocks/BlockNuclearCasing.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public BlockNuclearCasing() {
}

public enum NuclearCasingType implements IStringSerializable, IStateHarvestLevel {
SPENT_FUEL_CASING("spent_fuel_casing", 2);
SPENT_FUEL_CASING("spent_fuel_casing", 2),
GAS_CENTRIFUGE_HEATER("gas_centrifuge_heater", 1);

NuclearCasingType(String name, int harvestLevel) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ public class MetaTileEntities {
public static MetaTileEntityCoolantExportHatch COOLANT_OUTPUT;
public static MetaTileEntityControlRodPort CONTROL_ROD;
public static MetaTileEntitySpentFuelPool SPENT_FUEL_POOL;
public static MetaTileEntityGasCentrifuge GAS_CENTRIFUGE;

//STORAGE SECTION
public static MetaTileEntityLockedSafe LOCKED_SAFE;
Expand Down Expand Up @@ -745,6 +746,7 @@ public static void init() {
FISSION_REACTOR = registerMetaTileEntity(1043, new MetaTileEntityFissionReactor(gregtechId("fission_reactor")));
SPENT_FUEL_POOL = registerMetaTileEntity(1044, new MetaTileEntitySpentFuelPool(gregtechId("spent_fuel_pool")));
HEAT_EXCHANGER = registerMetaTileEntity(1045, new MetaTileEntityHeatExchanger(gregtechId("heat_exchanger")));
GAS_CENTRIFUGE = registerMetaTileEntity(1046, new MetaTileEntityGasCentrifuge(gregtechId("gas_centrifuge")));

// MISC MTE's START: IDs 1150-2000

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package gregtech.common.metatileentities.multi.electric;

import gregtech.api.capability.impl.MultiblockRecipeLogic;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.metatileentity.multiblock.IMultiblockPart;
import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController;
import gregtech.api.pattern.BlockPattern;
import gregtech.api.pattern.FactoryBlockPattern;
import gregtech.api.recipes.RecipeMaps;
import gregtech.client.renderer.ICubeRenderer;
import gregtech.client.renderer.texture.Textures;
import gregtech.common.blocks.BlockBoilerCasing;
import gregtech.common.blocks.BlockGasCentrifugeCasing;
import gregtech.common.blocks.BlockNuclearCasing;
import gregtech.common.blocks.MetaBlocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.ResourceLocation;
import org.jetbrains.annotations.NotNull;

import static gregtech.api.util.RelativeDirection.*;

public class MetaTileEntityGasCentrifuge extends RecipeMapMultiblockController {

public MetaTileEntityGasCentrifuge(ResourceLocation metaTileEntityId) {
super(metaTileEntityId, RecipeMaps.GAS_CENTRIFUGE_RECIPES);
this.recipeMapWorkable = new MultiblockRecipeLogic(this);
}

@NotNull
@Override
protected BlockPattern createStructurePattern() {
return FactoryBlockPattern.start(FRONT, UP, RIGHT)
.aisle("SI", "HH", "CC", "CC", "CC", "CC", "CC")
.aisle("EE", "HH", "CC", "CC", "CC", "CC", "CC").setRepeatable(1, 14)
.aisle("OO", "HH", "CC", "CC", "CC", "CC", "CC")
.where('S', selfPredicate())
.where('P', states(getPipeState()))
.where('H', states(getHeaterState()))
.where('C', states(getCentrifugeState()))
.where('I', states(getPipeState()).or(autoAbilities(false, false, false, false, true, false, false)))
.where('E', states(getPipeState()).or(autoAbilities(true, true, false, false, false, false, false)))
.where('O', states(getPipeState()).or(autoAbilities(false, false, false, false, false, true, false)))
.build();
}

@Override
public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.INERT_PTFE_CASING;
}

@Override
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
return new MetaTileEntityGasCentrifuge(metaTileEntityId);
}

private IBlockState getPipeState() {
return MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.POLYTETRAFLUOROETHYLENE_PIPE);
}

private IBlockState getHeaterState() {
return MetaBlocks.NUCLEAR_CASING.getState(BlockNuclearCasing.NuclearCasingType.GAS_CENTRIFUGE_HEATER);
}

private IBlockState getCentrifugeState() {
return MetaBlocks.GAS_CENTRIFUGE_CASING.getState(BlockGasCentrifugeCasing.GasCentrifugeCasingType.GAS_CENTRIFUGE_COLUMN);
}
}
18 changes: 18 additions & 0 deletions src/main/resources/assets/gregtech/blockstates/nuclear_casing.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
"top_bottom" : "gregtech:blocks/casings/nuclear/spent_fuel_casing_top_bloom",
"top_top" : "gregtech:blocks/casings/nuclear/spent_fuel_casing_top_bloom"
}
},
"active=false,variant=gas_centrifuge_heater" : {
"model" : "minecraft:cube_column",
"textures" : {
"end" : "gregtech:blocks/casings/nuclear/gas_centrifuge_heater_top",
"side" : "gregtech:blocks/casings/nuclear/gas_centrifuge_heater_side"
}
},
"active=true,variant=gas_centrifuge_heater" : {
"model" : "gregtech:cube_2_layer_bottom_top",
"textures" : {
"bot_side" : "gregtech:blocks/casings/nuclear/gas_centrifuge_heater_side",
"bot_bottom" : "gregtech:blocks/casings/nuclear/gas_centrifuge_heater_top",
"bot_top" : "gregtech:blocks/casings/nuclear/gas_centrifuge_heater_top",
"top_side" : "gregtech:blocks/casings/nuclear/gas_centrifuge_heater_side_bloom",
"top_bottom" : "gregtech:blocks/casings/nuclear/gas_centrifuge_heater_top_bloom",
"top_top" : "gregtech:blocks/casings/nuclear/gas_centrifuge_heater_top_bloom"
}
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dcefad5

Please sign in to comment.