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

Fix various issues with coag tank and latex collector. #43

Merged
merged 1 commit into from
Apr 24, 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
1 change: 1 addition & 0 deletions src/main/java/supersymmetry/Supersymmetry.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void onModConstruction(FMLConstructionEvent event) {
@Mod.EventHandler
public void onPreInit(@NotNull FMLPreInitializationEvent event) {
proxy.preLoad();

SuSyMetaItems.initMetaItems();
SuSyBlocks.init();

Expand Down
1 change: 0 additions & 1 deletion src/main/java/supersymmetry/api/gui/SusyGuiTextures.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ 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");
public static final SteamTexture MOLD_OVERLAY_STEAM = SteamTexture.fullImage("textures/gui/overlay/mold_overlay_%s.png");

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

import gregtech.api.gui.GuiTextures;
import gregtech.api.gui.widgets.ProgressWidget;
import supersymmetry.api.gui.SusyGuiTextures;

public class SuSySteamProgressIndicators {

public static final SuSySteamProgressIndicator COMPRESS = new SuSySteamProgressIndicator(GuiTextures.PROGRESS_BAR_COMPRESS_STEAM, ProgressWidget.MoveType.HORIZONTAL, 20, 15);
public static final SuSySteamProgressIndicator ARROW = new SuSySteamProgressIndicator(GuiTextures.PROGRESS_BAR_ARROW_STEAM, ProgressWidget.MoveType.HORIZONTAL, 20, 15);
public static final SuSySteamProgressIndicator MIXER = new SuSySteamProgressIndicator(SusyGuiTextures.PROGRESS_BAR_MIXER_STEAM, ProgressWidget.MoveType.CIRCULAR, 20, 20);


}
13 changes: 9 additions & 4 deletions src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class SuSyRecipeMaps {

public static final RecipeMap<PrimitiveRecipeBuilder> COAGULATION_RECIPES = new RecipeMap<>("coagulation_tank", 0, 2, 1, 1, 1, 2, 0, 0, new PrimitiveRecipeBuilder(), false);

public static final RecipeMap<SimpleRecipeBuilder> VULCANIZATION_RECIPES = new RecipeMap<>("vulcanizing_press", 1, 4, 1, 2, 0, 2, 0, 1, new SimpleRecipeBuilder(), false)
public static final RecipeMap<SimpleRecipeBuilder> VULCANIZATION_RECIPES = new RecipeMap<>("vulcanizing_press", 4, 2, 2, 1, new SimpleRecipeBuilder(), false)
.setSlotOverlay(false, false, true, GuiTextures.MOLD_OVERLAY)
.setSound(GTSoundEvents.COMBUSTION);

Expand All @@ -43,22 +43,27 @@ public class SuSyRecipeMaps {

public static final RecipeMap<SimpleRecipeBuilder> CRYSTALLIZER_RECIPES = new RecipeMap<>("crystallizer",1, 1, 1, 1, new SimpleRecipeBuilder(), false);

public static final RecipeMap<SimpleRecipeBuilder> BUBBLE_COLUMN_REACTOR_RECIPES = new RecipeMap<>("bubble_column_reactor", 0, 0, 3, 2, new SimpleRecipeBuilder(), false)
public static final RecipeMap<SimpleRecipeBuilder> BUBBLE_COLUMN_REACTOR_RECIPES = new RecipeMap<>("bubble_column_reactor", 1, 0, 3, 2, new SimpleRecipeBuilder(), false)
.setSound(GTSoundEvents.CHEMICAL_REACTOR);

public static final RecipeMap<SimpleRecipeBuilder> DRYER = new RecipeMap<>("dryer", 1, 1, 1, 1, new SimpleRecipeBuilder(), false)
.setSound(GTSoundEvents.CHEMICAL_REACTOR);

public static final RecipeMap<SimpleRecipeBuilder> FLUIDIZED_BED_REACTOR_RECIPES = new RecipeMap<>("fluidized_bed_reactor", 1, 0, 3, 2, new SimpleRecipeBuilder(), false)
public static final RecipeMap<SimpleRecipeBuilder> FLUIDIZED_BED_REACTOR_RECIPES = new RecipeMap<>("fluidized_bed_reactor", 2, 1, 3, 2, new SimpleRecipeBuilder(), false)
.setSound(GTSoundEvents.CHEMICAL_REACTOR);

public static final RecipeMap<SimpleRecipeBuilder> POLYMERIZATION_RECIPES = new RecipeMap<>("polymerization_tank", 1, 1, 2, 1, new SimpleRecipeBuilder(), false)
public static final RecipeMap<SimpleRecipeBuilder> POLYMERIZATION_RECIPES = new RecipeMap<>("polymerization_tank", 2, 1, 2, 1, new SimpleRecipeBuilder(), false)
.setSound(GTSoundEvents.CHEMICAL_REACTOR);


public static void init(){
RecipeMaps.SIFTER_RECIPES.setMaxFluidInputs(1);
RecipeMaps.SIFTER_RECIPES.setMaxFluidOutputs(1);
RecipeMaps.SIFTER_RECIPES.setMaxInputs(2);
RecipeMaps.CENTRIFUGE_RECIPES.setMaxFluidInputs(2);
RecipeMaps.CENTRIFUGE_RECIPES.setSlotOverlay(false, true, false, GuiTextures.CENTRIFUGE_OVERLAY);
RecipeMaps.MIXER_RECIPES.setMaxFluidInputs(3);
RecipeMaps.MIXER_RECIPES.setMaxFluidOutputs(2);
RecipeMaps.ARC_FURNACE_RECIPES.setMaxInputs(2);
}
}
1 change: 0 additions & 1 deletion src/main/java/supersymmetry/common/blocks/SuSyBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public class SuSyBlocks {
public static BlockAlternatorCoil ALTERNATOR_COIL;
public static BlockTurbineRotor TURBINE_ROTOR;


public static void init() {
COOLING_COIL = new BlockCoolingCoil();
COOLING_COIL.setRegistryName("cooling_coil");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static void init() {
registerSimpleSteamMTE(STEAM_ROASTER, 14722, "roaster", SuSyRecipeMaps.ROASTER_RECIPES, SuSySteamProgressIndicators.ARROW, SusyTextures.ROASTER_OVERLAY, true);
registerSimpleMTE(ROASTER, 12, 14523, "roaster", SuSyRecipeMaps.ROASTER_RECIPES, SusyTextures.ROASTER_OVERLAY, true);

registerSimpleSteamMTE(STEAM_MIXER, 14536, "mixer", RecipeMaps.MIXER_RECIPES, SuSySteamProgressIndicators.ARROW, SusyTextures.MIXER_OVERLAY_STEAM, false);
registerSimpleSteamMTE(STEAM_MIXER, 14536, "mixer", RecipeMaps.MIXER_RECIPES, SuSySteamProgressIndicators.MIXER, SusyTextures.MIXER_OVERLAY_STEAM, false);

registerSimpleSteamMTE(STEAM_VACUUM_CHAMBER, 14538, "vacuum_chamber", SuSyRecipeMaps.VACUUM_CHAMBER, SuSySteamProgressIndicators.COMPRESS, Textures.GAS_COLLECTOR_OVERLAY, false);
registerSimpleMTE(VACUUM_CHAMBER, 12, 14540, "vacuum_chamber", SuSyRecipeMaps.VACUUM_CHAMBER, Textures.GAS_COLLECTOR_OVERLAY, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ public void update() {

protected void formStructure(PatternMatchContext context) {
super.formStructure(context);
this.initializeAbilities();
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));
}
Expand All @@ -124,6 +128,7 @@ protected void initializeAbilities() {
protected ICubeRenderer getFrontOverlay() {
return Textures.PRIMITIVE_PUMP_OVERLAY;
}
@Override

public boolean hasMaintenanceMechanics() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected IItemHandlerModifiable createExportItemHandler() {
@SideOnly(Side.CLIENT)
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) {
ColourMultiplier multiplier = new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(this.getPaintingColorForRendering()));
IVertexOperation[] coloredPipeline = (IVertexOperation[])ArrayUtils.add(pipeline, multiplier);
IVertexOperation[] coloredPipeline = ArrayUtils.add(pipeline, multiplier);
Textures.STEAM_CASING_BRONZE.render(renderState, translation, coloredPipeline);

SusyTextures.LATEX_COLLECTOR_OVERLAY.renderOrientedState(renderState, translation, coloredPipeline, this.getFrontFacing(), this.isActive(), true);
Expand All @@ -105,14 +105,14 @@ protected ModularUI createUI(EntityPlayer entityPlayer) {
builder.label(11, 20, "gregtech.gui.fluid_amount", 16777215);
builder.dynamicLabel(11, 30, tankWidget::getFormattedFluidAmount, 16777215);
builder.dynamicLabel(11, 40, tankWidget::getFluidLocalizedName, 16777215);
builder.widget((new AdvancedTextWidget(10, 19, this::addDisplayText, 16777215)).setMaxWidthLimit(84));
builder.widget((new AdvancedTextWidget(11, 50, this::addDisplayText, 16777215)).setMaxWidthLimit(84));
return builder.label(6, 6, this.getMetaFullName()).widget((new FluidContainerSlotWidget(this.importItems, 0, 90, 17, false)).setBackgroundTexture(new IGuiTexture[]{GuiTextures.SLOT_STEAM.get(false), GuiTextures.IN_SLOT_OVERLAY})).widget(new ImageWidget(91, 36, 14, 15, GuiTextures.TANK_ICON)).widget((new SlotWidget(this.exportItems, 0, 90, 54, true, false)).setBackgroundTexture(new IGuiTexture[]{GuiTextures.SLOT_STEAM.get(false), GuiTextures.OUT_SLOT_OVERLAY})).bindPlayerInventory(entityPlayer.inventory, GuiTextures.SLOT_STEAM.get(false), 10).build(this.getHolder(), entityPlayer);

}

void addDisplayText(List<ITextComponent> textList) {
if (!this.drainEnergy(true)) {
textList.add((new TextComponentTranslation("gregtech.multiblock.large_miner.steam", new Object[0])).setStyle((new Style()).setColor(TextFormatting.RED)));
textList.add((new TextComponentTranslation("gregtech.machine.latex_collector.steam", new Object[0])).setStyle((new Style()).setColor(TextFormatting.RED)));
}
}

Expand All @@ -126,7 +126,6 @@ public boolean drainEnergy(boolean simulate) {
if (!simulate) {
this.importFluids.getTankAt(0).drain(this.energyPerTick, true);
}

return true;
} else {
return false;
Expand Down Expand Up @@ -156,6 +155,17 @@ public void update() {
}

}
@Override
public void onLoad() {
super.onLoad();
this.checkAdjacentBlocks();
}

@Override
public void onPlacement() {
super.onPlacement();
this.checkAdjacentBlocks();
}

public void onNeighborChanged() {
super.onNeighborChanged();
Expand All @@ -166,9 +176,6 @@ public void checkAdjacentBlocks(){
if(this.getWorld() != null){
this.hasRubberLog = false;
if(!this.getWorld().isRemote) {
EnumFacing[] facings = EnumFacing.VALUES;
int numFacings = facings.length;

EnumFacing back = this.getFrontFacing().getOpposite();

Block block = this.getWorld().getBlockState(this.getPos().offset(back)).getBlock();
Expand All @@ -193,7 +200,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound data) {

public void readFromNBT(NBTTagCompound data) {
super.readFromNBT(data);
if (data.hasKey("numberRubberLogs")) {
if (data.hasKey("hasRubberLogs")) {
this.hasRubberLog = data.getBoolean("hasRubberLogs");
}
if (data.hasKey("OutputFacingF")) {
Expand Down Expand Up @@ -229,11 +236,13 @@ public boolean onWrenchClick(EntityPlayer playerIn, EnumHand hand, EnumFacing fa
if (!this.getWorld().isRemote) {
this.setOutputFacingFluids(facing);
}

return true;
}
} else {
return super.onWrenchClick(playerIn, hand, facing, hitResult);
boolean wrenchClickResult = false;
if (this.getOutputFacingFluids() != facing.getOpposite() && this.getOutputFacingFluids() != facing) wrenchClickResult = super.onWrenchClick(playerIn, hand, facing, hitResult);
this.checkAdjacentBlocks();
return wrenchClickResult;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package supersymmetry.loaders.recipes;

import gregtech.api.recipes.ModHandler;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.Materials;
import gregtech.common.blocks.MetaBlocks;
import gregtech.common.blocks.StoneVariantBlock;
import net.minecraft.item.ItemStack;
import supersymmetry.api.recipes.SuSyRecipeMaps;
import supersymmetry.common.blocks.SuSyBlocks;
import supersymmetry.common.blocks.SusyStoneVariantBlock;
import supersymmetry.common.materials.SusyMaterials;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/susy/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ gregtech.machine.fluidized_bed_reactor.name=Fluidized Bed Reactor
gregtech.recipe.plasma_requirement=Requires plasma: %s

# Latex Collector
gregtech.machine.latex_collector.steam=Needs Steam!
gregtech.machine.latex_collector.tooltip=Collects latex from adjacent rubber tree log. Yields %d mL of latex per tick.
gregtech.machine.latex_collector.bronze.name=Steam Latex Collector
gregtech.machine.latex_collector.lv.name=Basic Latex Collector
Expand Down