Skip to content

Commit

Permalink
Merge pull request #344 from MCTian-mi/plastic-cans
Browse files Browse the repository at this point in the history
Implement plastic cans
  • Loading branch information
bruberu authored Dec 4, 2024
2 parents aab318a + 93e5d52 commit f274268
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 74 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
import gregtech.client.renderer.texture.cube.SimpleCubeRenderer;
import gregtech.client.renderer.texture.cube.SimpleOverlayRenderer;
import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer;
import gregtech.client.renderer.texture.custom.DrumRenderer;

public class SusyTextures {

public SusyTextures(){
}

public static final SimpleSidedCubeRenderer WOODEN_COAGULATION_TANK_WALL = new SimpleSidedCubeRenderer("casings/wooden_coagulation_tank_wall");
public static final SimpleSidedCubeRenderer PLASTIC_CAN_OVERLAY = new SimpleSidedCubeRenderer("storage/drums/plastic_can_top");

public static final OrientedOverlayRenderer VULCANIZING_PRESS_OVERLAY = new OrientedOverlayRenderer("machines/vulcanizing_press");
public static final OrientedOverlayRenderer LATEX_COLLECTOR_OVERLAY = new OrientedOverlayRenderer("machines/latex_collector");
public static final OrientedOverlayRenderer ROASTER_OVERLAY = new OrientedOverlayRenderer("machines/roaster");
Expand Down Expand Up @@ -73,4 +76,6 @@ public SusyTextures(){
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");

public static final DrumRenderer PLASTIC_CAN = new DrumRenderer("storage/drums/plastic_can");
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import supersymmetry.common.metatileentities.single.electric.MetaTileEntityPhaseSeparator;
import supersymmetry.common.metatileentities.single.steam.MetaTileEntitySteamLatexCollector;
import supersymmetry.common.metatileentities.single.steam.SuSySimpleSteamMetaTileEntity;
import supersymmetry.common.metatileentities.storage.MetaTileEntityPlasticCan;

import java.util.function.Function;

Expand Down Expand Up @@ -69,6 +70,10 @@ public class SuSyMetaTileEntities {

public static MetaTileEntityDrum LEAD_DRUM;
public static MetaTileEntityDrum BRASS_DRUM;
public static MetaTileEntityPlasticCan PE_CAN;
public static MetaTileEntityPlasticCan PP_CAN;
public static MetaTileEntityPlasticCan PMMA_CAN;
public static MetaTileEntityPlasticCan PTFE_CAN;

//Machines for chem overhaul
public static ContinuousMachineMetaTileEntity[] CONTINUOUS_STIRRED_TANK_REACTOR;
Expand Down Expand Up @@ -174,9 +179,15 @@ public static void init() {
LATEX_COLLECTOR[3] = registerMetaTileEntity(14505, new MetaTileEntityLatexCollector(susyId("latex_collector.ev"), 4));
SIEVE_DISTILLATION_TOWER = registerMetaTileEntity(14506, new MetaTileEntitySieveDistillationTower(susyId("sieve_distillation_tower")));

PE_CAN = registerMetaTileEntity(14507, new MetaTileEntityPlasticCan(susyId("drum.pe"), Materials.Polyethylene, 64_000));
PP_CAN = registerMetaTileEntity(14508, new MetaTileEntityPlasticCan(susyId("drum.pp"), new PropertyFluidFilter(444, true, true, false, false), 0xdfe39a, 128_000));
PMMA_CAN = registerMetaTileEntity(14509, new MetaTileEntityPlasticCan(susyId("drum.pmma"), new PropertyFluidFilter(438, true, true, false, false), 0x72e0c9, 256_000));

STEAM_LATEX_COLLECTOR[0] = registerMetaTileEntity(14510, new MetaTileEntitySteamLatexCollector(susyId("latex_collector.bronze"), false));
STEAM_LATEX_COLLECTOR[1] = registerMetaTileEntity(14511, new MetaTileEntitySteamLatexCollector(susyId("latex_collector.steel"), true));

PTFE_CAN = registerMetaTileEntity(14512, new MetaTileEntityPlasticCan(susyId("drum.ptfe"), Materials.Polytetrafluoroethylene, 512_000)); // sadly I have to put it here

SINTERING_OVEN = registerMetaTileEntity(14521, new MetaTileEntitySinteringOven(susyId("sintering_oven")));

registerSimpleSteamMTE(STEAM_VULCANIZING_PRESS, 14515, "vulcanizing_press", SuSyRecipeMaps.VULCANIZATION_RECIPES, SuSySteamProgressIndicators.COMPRESS, SusyTextures.VULCANIZING_PRESS_OVERLAY, true);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package supersymmetry.common.metatileentities.storage;

import codechicken.lib.colour.ColourRGBA;
import codechicken.lib.render.CCRenderState;
import codechicken.lib.render.pipeline.ColourMultiplier;
import codechicken.lib.render.pipeline.IVertexOperation;
import codechicken.lib.vec.Matrix4;
import gregtech.api.capability.IPropertyFluidFilter;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.unification.material.Material;
import gregtech.api.util.GTUtility;
import gregtech.client.renderer.texture.Textures;
import gregtech.common.metatileentities.storage.MetaTileEntityDrum;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import org.apache.commons.lang3.ArrayUtils;
import org.jetbrains.annotations.NotNull;
import supersymmetry.client.renderer.textures.SusyTextures;
import supersymmetry.mixins.gregtech.MetaTileEntityDrumAccessor;

public class MetaTileEntityPlasticCan extends MetaTileEntityDrum {

private final MetaTileEntityDrumAccessor self;

public MetaTileEntityPlasticCan(ResourceLocation metaTileEntityId, @NotNull Material material, int tankSize) {
super(metaTileEntityId, material, tankSize);
this.self = (MetaTileEntityDrumAccessor) this;
}

public MetaTileEntityPlasticCan(ResourceLocation metaTileEntityId, @NotNull IPropertyFluidFilter fluidFilter, int color, int tankSize) {
super(metaTileEntityId, fluidFilter, false, color, tankSize);
this.self = (MetaTileEntityDrumAccessor) this;
}

@Override
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
return new MetaTileEntityPlasticCan(this.metaTileEntityId, self.getFluidFilter(), self.getColor(), self.getTankSize());
}

@Override
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) {
ColourMultiplier multiplier = new ColourMultiplier(
ColourRGBA.multiply(GTUtility.convertRGBtoOpaqueRGBA_CL(self.getColor()),
GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering())));
SusyTextures.PLASTIC_CAN.render(renderState, translation, ArrayUtils.add(pipeline, multiplier), getFrontFacing());
SusyTextures.PLASTIC_CAN_OVERLAY.render(renderState, translation, pipeline);
if (self.isAutoOutput()) {
Textures.STEAM_VENT_OVERLAY.renderSided(EnumFacing.DOWN, renderState, translation, pipeline);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package supersymmetry.mixins.gregtech;

import gregtech.api.capability.IPropertyFluidFilter;
import gregtech.common.metatileentities.storage.MetaTileEntityDrum;
import org.jetbrains.annotations.ApiStatus.ScheduledForRemoval;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Deprecated
@ScheduledForRemoval(inVersion = "Next CEu update")
@Mixin(value = MetaTileEntityDrum.class, remap = false)
public interface MetaTileEntityDrumAccessor {

@Accessor("fluidFilter")
IPropertyFluidFilter getFluidFilter();

@Accessor("color")
int getColor();

@Accessor("tankSize")
int getTankSize();

@Accessor("isAutoOutput")
boolean isAutoOutput();
}
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.
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.
4 changes: 4 additions & 0 deletions src/main/resources/assets/susy/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ gregtech.machine.coagulation_tank.tooltip=Can't be used to stop bleeding.
gregtech.machine.coagulation_tank.tooltip.1=Gains one parallel per block longer
gregtech.machine.drum.lead.name=Lead Drum
gregtech.machine.drum.brass.name=Brass Drum
gregtech.machine.drum.pe.name=Polyethylene (PE) Can
gregtech.machine.drum.pp.name=Polypropylene (PP) Can
gregtech.machine.drum.pmma.name=Polymethylmethacrylate (PMMA) Can
gregtech.machine.drum.ptfe.name=Polytetrafluoroethylene (PTFE) Can

gregtech.machine.polymerization_tank.name=Polymerization Tank
gregtech.machine.fluidized_bed_reactor.name=Fluidized Bed Reactor
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/mixins.susy.gregtech.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"compatibilityLevel" : "JAVA_8",
"mixins" : [
"BlockMachineMixin",
"MetaTileEntityDrumAccessor",
"MetaTileEntityFluidDrillMixin",
"MetaTileEntityLargeMinerMixin",
"MetaTileEntityMinerMixin",
Expand Down

0 comments on commit f274268

Please sign in to comment.