Skip to content

Commit

Permalink
some polish
Browse files Browse the repository at this point in the history
  • Loading branch information
MCTian-mi committed Sep 6, 2024
1 parent 94a601c commit 065af2e
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import gregtech.api.recipes.builders.FuelRecipeBuilder;
import gregtech.api.recipes.builders.PrimitiveRecipeBuilder;
import gregtech.api.recipes.builders.SimpleRecipeBuilder;
import gregtech.api.unification.material.Materials;
import gregtech.api.recipes.ingredients.GTRecipeInput;
import gregtech.api.unification.material.Materials;
import gregtech.core.sound.GTSoundEvents;
import gregtechfoodoption.recipe.GTFORecipeMaps;
import supersymmetry.api.gui.SusyGuiTextures;
Expand Down Expand Up @@ -318,7 +318,7 @@ public class SuSyRecipeMaps {
.setSound(GTSoundEvents.TURBINE)
.allowEmptyOutput();

public static final RecipeMap<PrimitiveRecipeBuilder> PRIMITIVE_SMELTER = new RecipeMap<>("primitive_smelter", 3, 1, 0, 0, new PrimitiveRecipeBuilder(), false)
public static final RecipeMap<PrimitiveRecipeBuilder> PRIMITIVE_SMELTER = new RecipeMap<>("primitive_smelter", 3, 2, 0, 0, new PrimitiveRecipeBuilder(), false)
.setSlotOverlay(false, false, GuiTextures.FURNACE_OVERLAY_1)
.setSlotOverlay(true, false, GuiTextures.FURNACE_OVERLAY_2)
.setSound(GTSoundEvents.FURNACE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ public SusyTextures(){
public static final OrientedOverlayRenderer ROTARY_KILN_OVERLAY = new OrientedOverlayRenderer("machines/multiblocks/rotary_kiln");
public static final OrientedOverlayRenderer SINTERING_OVERLAY = new OrientedOverlayRenderer("machines/multiblocks/sintering");
public static final OrientedOverlayRenderer SMOKE_STACK_OVERLAY = new OrientedOverlayRenderer("machines/multiblocks/smoke_stack");
public static final OrientedOverlayRenderer PRIMITIVE_SMELTER_OVERLAY = new OrientedOverlayRenderer("machines/multiblocks/primitive_smelter");

public static final SimpleOverlayRenderer SILICON_CARBIDE_CASING = new SimpleOverlayRenderer("multiblock_casing/silicon_carbide_casing");
public static final SimpleOverlayRenderer ULV_STRUCTURAL_CASING = new SimpleOverlayRenderer("multiblock_casing/ulv_structural_casing");
public static final SimpleOverlayRenderer SLAG_HOT = new SimpleOverlayRenderer("resource/slag_hot");

public static final SimpleCubeRenderer MASONRY_BRICK = new SimpleCubeRenderer("gregtech:blocks/multiblock_casing/masonry_brick");
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
package supersymmetry.common.metatileentities.multi.primitive;

import codechicken.lib.render.CCRenderState;
import codechicken.lib.render.pipeline.IVertexOperation;
import codechicken.lib.vec.Matrix4;
import com.codetaylor.mc.pyrotech.modules.core.ModuleCore;
import gregtech.api.gui.ModularUI;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.metatileentity.multiblock.IMultiblockPart;
import gregtech.api.metatileentity.multiblock.RecipeMapPrimitiveMultiblockController;
import gregtech.api.pattern.BlockPattern;
import gregtech.api.pattern.FactoryBlockPattern;
import gregtech.api.pattern.TraceabilityPredicate;
import gregtech.client.renderer.CubeRendererState;
import gregtech.client.renderer.ICubeRenderer;
import gregtech.client.renderer.cclop.ColourOperation;
import gregtech.client.renderer.cclop.LightMapOperation;
import gregtech.client.renderer.texture.Textures;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.ArrayUtils;
import org.jetbrains.annotations.NotNull;
import supersymmetry.api.metatileentity.multiblock.SuSyMultiblockAbilities;
import supersymmetry.api.recipes.SuSyRecipeMaps;
Expand All @@ -20,23 +33,23 @@ public MetaTileEntityPrimitiveSmelter(ResourceLocation metaTileEntityId) {
super(metaTileEntityId, SuSyRecipeMaps.PRIMITIVE_SMELTER);
}

public static TraceabilityPredicate casingPredicate() {
return states(ModuleCore.Blocks.MASONRY_BRICK.getDefaultState());
}

@Override
protected @NotNull BlockPattern createStructurePattern() {
return FactoryBlockPattern.start()
.aisle("OOO", "III", "SIS")
.aisle("OOO", "I I", "III")
.aisle("OOO", "I I", "I I")
.aisle("OOO", "ICI", "SIS")
.where('I', casingPredicate().or(abilities(SuSyMultiblockAbilities.PRIMITIVE_IMPORT_ITEMS).setMaxGlobalLimited(3)))
.where('C', selfPredicate())
.where('O', casingPredicate().or(abilities(SuSyMultiblockAbilities.PRIMITIVE_EXPORT_ITEMS).setMaxGlobalLimited(1)))
.where('O', casingPredicate().or(abilities(SuSyMultiblockAbilities.PRIMITIVE_EXPORT_ITEMS).setMaxGlobalLimited(2)))
.where('S', states(ModuleCore.Blocks.MASONRY_BRICK_SLAB.getDefaultState()))
.build();
}

public TraceabilityPredicate casingPredicate() {
return states(ModuleCore.Blocks.MASONRY_BRICK.getDefaultState());
}

@Override
public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) {
return SusyTextures.MASONRY_BRICK;
Expand All @@ -47,5 +60,39 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEnti
return new MetaTileEntityPrimitiveSmelter(this.metaTileEntityId);
}

@SideOnly(Side.CLIENT)
protected @NotNull ICubeRenderer getFrontOverlay() {
return SusyTextures.PRIMITIVE_SMELTER_OVERLAY;
}

@Override
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) {
super.renderMetaTileEntity(renderState, translation, pipeline);
this.getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(),
recipeMapWorkable.isActive(), recipeMapWorkable.isWorkingEnabled());
if (recipeMapWorkable.isActive() && isStructureFormed()) {
EnumFacing back = getFrontFacing().getOpposite();
Matrix4 offset = translation.copy().translate(back.getXOffset(), 0.2, back.getZOffset());
CubeRendererState op = Textures.RENDER_STATE.get();
Textures.RENDER_STATE.set(new CubeRendererState(op.layer, CubeRendererState.PASS_MASK, op.world));
SusyTextures.SLAG_HOT.renderSided(EnumFacing.UP, renderState, offset,
ArrayUtils.addAll(pipeline, new LightMapOperation(240, 240), new ColourOperation(0xFFFFFFFF)));
Textures.RENDER_STATE.set(op);
}
}

@Override
public boolean hasMaintenanceMechanics() {
return false;
}

@Override
protected ModularUI createUI(EntityPlayer entityPlayer) {
return null;
}

@Override
protected boolean openGUIOnRightClick() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.List;

public class MetaTileEntityPrimitiveItemBus extends MetaTileEntityItemBus {

public MetaTileEntityPrimitiveItemBus(ResourceLocation metaTileEntityId, boolean isExportHatch) {
super(metaTileEntityId, 0, isExportHatch);
}
Expand All @@ -36,4 +37,9 @@ public MultiblockAbility<IItemHandlerModifiable> getAbility() {
public void registerAbilities(List<IItemHandlerModifiable> abilityList) {
abilityList.add(isExportHatch ? this.exportItems : this.importItems);
}

@Override
public int getDefaultPaintingColor() {
return 0xFFFFFF;
}
}
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 065af2e

Please sign in to comment.