Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add steam mixer #14

Merged
merged 3 commits into from
Apr 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/supersymmetry/api/gui/SusyGuiTextures.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package supersymmetry.api.gui;

import gregtech.api.gui.resources.SteamTexture;

public class SusyGuiTextures {
public static final SteamTexture PROGRESS_BAR_MIXER_STEAM = SteamTexture.fullImage("textures/gui/progress_bar/progress_bar_mixer_%s.png");

public static final SteamTexture FLUID_SLOT_STEAM = SteamTexture.fullImage("textures/gui/base/fluid_slot_%s.png");

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public class SusyTextures {
public static OrientedOverlayRenderer VULCANIZING_PRESS_OVERLAY;
public static OrientedOverlayRenderer LATEX_COLLECTOR_OVERLAY;
public static OrientedOverlayRenderer ROASTER_OVERLAY;
public static OrientedOverlayRenderer MIXER_OVERLAY_STEAM;

public SusyTextures(){
}

Expand All @@ -20,6 +22,6 @@ public static void preInit(){
VULCANIZING_PRESS_OVERLAY = new OrientedOverlayRenderer("machines/vulcanizing_press",new OrientedOverlayRenderer.OverlayFace[]{OrientedOverlayRenderer.OverlayFace.FRONT, OrientedOverlayRenderer.OverlayFace.SIDE, OrientedOverlayRenderer.OverlayFace.TOP});
LATEX_COLLECTOR_OVERLAY = new OrientedOverlayRenderer("machines/latex_collector");
ROASTER_OVERLAY = new OrientedOverlayRenderer("machines/roaster");
MIXER_OVERLAY_STEAM = new OrientedOverlayRenderer("machines/mixer_steam");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import supersymmetry.common.metatileentities.multi.electric.MetaTileEntitySinteringOven;
import supersymmetry.common.metatileentities.single.electric.MetaTileEntityLatexCollector;
import supersymmetry.common.metatileentities.single.steam.MetaTileEntitySteamLatexCollector;
import supersymmetry.common.metatileentities.single.steam.MetaTileEntitySteamMixer;
import supersymmetry.common.metatileentities.single.steam.MetaTileEntitySteamRoaster;
import supersymmetry.common.metatileentities.single.steam.MetaTileEntitySteamVulcanizingPress;

Expand All @@ -31,6 +32,8 @@ public class SuSyMetaTileEntities {
public static MetaTileEntitySteamRoaster ROASTER_BRONZE;
public static MetaTileEntitySinteringOven SINTERING_OVEN;

public static MetaTileEntitySteamMixer MIXER_BRONZE;

public static void init() {
MAGNETIC_REFRIGERATOR = registerMetaTileEntity(14500, new MetaTileEntityMagneticRefrigerator(susyId("magnetic_refrigerator")));
COAGULATION_TANK = registerMetaTileEntity(14501, new MetaTileEntityCoagulationTank(susyId("coagulation_tank")));
Expand Down Expand Up @@ -67,6 +70,9 @@ public static void init() {
ROASTER[11] = registerMetaTileEntity(14534, new SimpleMachineMetaTileEntity(susyId("roaster.uxv"), SuSyRecipeMaps.ROASTER_RECIPES, SusyTextures.ROASTER_OVERLAY, 12, true));
ROASTER[12] = registerMetaTileEntity(14535, new SimpleMachineMetaTileEntity(susyId("roaster.opv"), SuSyRecipeMaps.ROASTER_RECIPES, SusyTextures.ROASTER_OVERLAY, 13, true));

MIXER_BRONZE = registerMetaTileEntity(14536, new MetaTileEntitySteamMixer(susyId("mixer.steam"), false));


}

private static @NotNull ResourceLocation susyId(@NotNull String name) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package supersymmetry.common.metatileentities.single.steam;

import gregtech.api.capability.impl.FluidTankList;
import gregtech.api.capability.impl.NotifiableItemStackHandler;
import gregtech.api.gui.GuiTextures;
import gregtech.api.gui.ModularUI;
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.SteamMetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.recipes.RecipeMaps;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.IFluidTank;
import net.minecraftforge.items.IItemHandlerModifiable;
import supersymmetry.api.gui.SusyGuiTextures;
import supersymmetry.client.renderer.textures.SusyTextures;


public class MetaTileEntitySteamMixer extends SteamMetaTileEntity{
public MetaTileEntitySteamMixer(ResourceLocation metaTileEntityId, boolean isHighPressure) {
super(metaTileEntityId, RecipeMaps.MIXER_RECIPES, SusyTextures.MIXER_OVERLAY_STEAM, isHighPressure);
}

public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
return new MetaTileEntitySteamMixer(this.metaTileEntityId, this.isHighPressure);
}

protected boolean isBrickedCasing() {
return false;
}

protected IItemHandlerModifiable createImportItemHandler() {
return new NotifiableItemStackHandler(6, this, false);
}
protected IItemHandlerModifiable createExportItemHandler() {
return new NotifiableItemStackHandler(1, this, true);
}

public FluidTankList createImportFluidHandler() {
super.createImportFluidHandler();
return new FluidTankList(false, new IFluidTank[]{this.steamFluidTank, new FluidTank(16000), new FluidTank(16000)});
}
protected FluidTankList createExportFluidHandler() {
return new FluidTankList(false, new IFluidTank[]{new FluidTank(16000)});
}

public ModularUI createUI(EntityPlayer player) {
ModularUI.Builder builder = super.createUITemplate(player);

builder.widget(new RecipeProgressWidget(this.workableHandler::getProgressPercent, 78, 39, 20, 20, SusyGuiTextures.PROGRESS_BAR_MIXER_STEAM.get(false), ProgressWidget.MoveType.CIRCULAR, RecipeMaps.MIXER_RECIPES));

builder.widget((new SlotWidget(this.importItems, 0, 12, 21, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new SlotWidget(this.importItems, 1, 30, 21, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new SlotWidget(this.importItems, 2, 48, 21, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new SlotWidget(this.importItems, 3, 12, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new SlotWidget(this.importItems, 4, 30, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new SlotWidget(this.importItems, 5, 48, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new TankWidget(this.importFluids.getTankAt(1), 30, 57, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(SusyGuiTextures.FLUID_SLOT_STEAM.get(false)).setContainerClicking(true, true))
.widget((new TankWidget(this.importFluids.getTankAt(2), 48, 57, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(SusyGuiTextures.FLUID_SLOT_STEAM.get(false)).setContainerClicking(true, true))
.widget((new SlotWidget(this.exportItems, 0, 106, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new TankWidget(this.exportFluids.getTankAt(0),124, 39, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(SusyGuiTextures.FLUID_SLOT_STEAM.get(false)).setContainerClicking(false, true));

return builder.build(this.getHolder(),player);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.IItemHandlerModifiable;
import supersymmetry.api.gui.SusyGuiTextures;
import supersymmetry.api.recipes.SuSyRecipeMaps;
import supersymmetry.client.renderer.textures.SusyTextures;

Expand Down Expand Up @@ -57,9 +58,9 @@ public ModularUI createUI(EntityPlayer player) {
.widget((new SlotWidget(this.importItems, 1, 30, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new SlotWidget(this.exportItems, 0, 88, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new SlotWidget(this.exportItems, 1, 106, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new TankWidget(this.exportFluids.getTankAt(0),88, 57, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(GuiTextures.FLUID_SLOT).setContainerClicking(false, true))
.widget((new TankWidget(this.exportFluids.getTankAt(1),106, 57, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(GuiTextures.FLUID_SLOT).setContainerClicking(false, true))
.widget((new TankWidget(this.exportFluids.getTankAt(2),124, 57, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(GuiTextures.FLUID_SLOT).setContainerClicking(false, true));
.widget((new TankWidget(this.exportFluids.getTankAt(0),88, 57, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(SusyGuiTextures.FLUID_SLOT_STEAM.get(false)).setContainerClicking(false, true))
.widget((new TankWidget(this.exportFluids.getTankAt(1),106, 57, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(SusyGuiTextures.FLUID_SLOT_STEAM.get(false)).setContainerClicking(false, true))
.widget((new TankWidget(this.exportFluids.getTankAt(2),124, 57, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(SusyGuiTextures.FLUID_SLOT_STEAM.get(false)).setContainerClicking(false, true));

return builder.build(this.getHolder(),player);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.IItemHandlerModifiable;
import supersymmetry.api.gui.SusyGuiTextures;
import supersymmetry.api.recipes.SuSyRecipeMaps;
import supersymmetry.client.renderer.textures.SusyTextures;

Expand Down Expand Up @@ -58,10 +59,10 @@ public ModularUI createUI(EntityPlayer player) {
builder.widget((new SlotWidget(this.importItems, 0, 12, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new SlotWidget(this.importItems, 1, 30, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new SlotWidget(this.importItems, 2, 48, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new TankWidget(this.importFluids.getTankAt(1), 48, 57, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(GuiTextures.FLUID_SLOT).setContainerClicking(true, true))
.widget((new TankWidget(this.importFluids.getTankAt(1), 48, 57, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(SusyGuiTextures.FLUID_SLOT_STEAM.get(false)).setContainerClicking(true, true))
.widget((new SlotWidget(this.exportItems, 0, 106, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new SlotWidget(this.exportItems, 1, 124, 39, true, true).setBackgroundTexture(GuiTextures.SLOT_STEAM.get(false))))
.widget((new TankWidget(this.exportFluids.getTankAt(0),142, 39, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(GuiTextures.FLUID_SLOT).setContainerClicking(false, true));
.widget((new TankWidget(this.exportFluids.getTankAt(0),142, 39, 18, 18)).setAlwaysShowFull(true).setBackgroundTexture(SusyGuiTextures.FLUID_SLOT_STEAM.get(false)).setContainerClicking(false, true));

return builder.build(this.getHolder(),player);
}
Expand Down
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"animation":{
"frametime":2
}
}
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"animation":{
"frametime":2
}
}
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"animation":{
"frametime":2
}
}
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"animation":{
"frametime":2
}
}
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.
3 changes: 3 additions & 0 deletions src/main/resources/assets/susy/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ gregtech.machine.vulcanizing_press.mv.name=Advanced Vulcanizing Press
gregtech.machine.vulcanizing_press.hv.name=Advanced Vulcanizing Press II
gregtech.machine.vulcanizing_press.ev.name=Advanced Vulcanizing Press III

# Steam Mixer
gregtech.machine.mixer.steam.name=Steam Mixer

# Roaster
gregtech.machine.roaster.steam.name=Steam Roaster
gregtech.machine.roaster.lv.name=Basic Roaster
Expand Down