Skip to content
This repository was archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Fixed Tooltips & GUI for TT Replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
bartimaeusnek committed Dec 31, 2020
1 parent e3398db commit 74d4e6d
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class BW_Tooltip_Reference {
public static final Supplier<String> ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.1.name") + " " + BW;
public static final Supplier<String> ADDED_BY_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.0.name") + " " + BW;
public static final String ADV_STR_CHECK = "Uses an advanced "+ TT +" structure check, due to "+ BW;
public static final String TT_BLUEPRINT = "To see the structure, use a "+ TT + " Blueprint on the Controller!";

public static String[] getTranslatedBrandedTooltip(String key){
String[] dsc = StatCollector.translateToLocal(key).split(";");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void init(FMLInitializationEvent init) {
GalacticraftProxy.init(init);
//Base GT -> TT Replacement
if (LoaderReference.tectech) {
new TT_VaccuumFreezer(null,null);
new TT_VacuumFreezer(null,null);
new TT_OilCrackingUnit(null,null);
new TT_ImplosionCompressor(null,null);
new TT_ElectronicBlastFurnace(null,null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@

package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement;

import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference;
import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder;
import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils;
import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
import com.github.technus.tectech.mechanics.structure.StructureDefinition;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -56,6 +59,7 @@
import java.util.Set;

import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK;
import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT;
import static com.github.technus.tectech.mechanics.structure.StructureUtility.*;
import static gregtech.api.enums.GT_Values.V;

Expand Down Expand Up @@ -120,11 +124,14 @@ protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemS
this.mHeatingCapacity = 0;
this.setCoilHeat(HeatingCoilLevel.None);
boolean ret = this.structureCheck_EM("main", 1, 3, 0) && this.getCoilHeat() != HeatingCoilLevel.None;
this.mMufflerHatches.forEach(x -> x.setInValidFacings(this.getExtendedFacing().getRelativeUpInWorld().getOpposite()));

if (this.mMufflerHatches.stream()
.map(MetaTileEntity::getBaseMetaTileEntity)
.mapToInt(ITurnable::getFrontFacing)
.noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal()))
return false;

this.mHeatingCapacity = (int) this.getCoilHeat().getHeat();
this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2);
return ret;
Expand Down Expand Up @@ -218,36 +225,18 @@ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti)

@Override
public String[] getDescription() {
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Blast Furnace")
.addInfo("Controller block for the Electric Blast Furnace")
.addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus")
.addInfo("Each 900K over the min. Heat required multiplies EU/t by 0.95")
.addInfo("Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal")
.addInfo("Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%")
.addInfo("Additionally gives +100K for every tier past MV")
.addPollutionAmount(20 * getPollutionPerTick(null))
.addInfo(ADV_STR_CHECK)
.addSeparator()
.beginStructureBlock(3, 4, 3, true)
.addController("Front bottom")
.addCasingInfo("Heat Proof Machine Casing", 0)
.addOtherStructurePart("Heating Coils", "Two middle Layers")
.addEnergyHatch("Any bottom layer casing")
.addMaintenanceHatch("Any bottom layer casing")
.addMufflerHatch("Top middle")
.addInputBus("Any bottom layer casing")
.addInputHatch("Any bottom layer casing")
.addOutputBus("Any bottom layer casing")
.addOutputHatch("CO/CO2/SO2, Any top layer casing")
.addStructureInfo("Recovery amount scales with Muffler Hatch tier")
.addOutputHatch("Fluids, Any bottom layer casing")
.toolTipFinisher("Gregtech");
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
return tt.getInformation();
} else {
return tt.getStructureInformation();
}
return new String[]{
"Blast Furnace",
"Controller block for the Electric Blast Furnace",
"You can use some fluids to reduce recipe time. Place the circuit in the Input Bus",
"Each 900K over the min. Heat required multiplies EU/t by 0.95",
"Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal",
"Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%",
"Additionally gives +100K for every tier past MV",
"Creates up to: " + 20 * getPollutionPerTick(null) + " Pollution per Second",
ADV_STR_CHECK,
TT_BLUEPRINT
};
}

@Override
Expand All @@ -260,12 +249,12 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide

@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png");
return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true);
}

@Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@

package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement;

import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference;
import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions;
import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
import com.github.technus.tectech.mechanics.structure.StructureDefinition;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.google.common.collect.ArrayListMultimap;
Expand All @@ -38,6 +41,8 @@
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.ITurnable;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.*;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
Expand Down Expand Up @@ -131,8 +136,17 @@ else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler)
@Override
protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
this.blocks = 0;
return this.structureCheck_EM("main", 1,1,0)
boolean ret = this.structureCheck_EM("main", 1,1,0)
&& this.blocks >= 16;
this.mMufflerHatches.forEach(x -> x.setInValidFacings(this.getExtendedFacing().getRelativeUpInWorld().getOpposite()));

if (this.mMufflerHatches.stream()
.map(MetaTileEntity::getBaseMetaTileEntity)
.mapToInt(ITurnable::getFrontFacing)
.noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal()))
return false;

return ret;
}

@Override
Expand All @@ -152,28 +166,14 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {

@Override
public String[] getDescription() {
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Implosion Compressor")
.addInfo("Explosions are fun")
.addInfo("Controller block for the Implosion Compressor")
.addPollutionAmount(20 * getPollutionPerTick(null))
.addInfo(ADV_STR_CHECK)
.addSeparator()
.beginStructureBlock(3, 3, 3, true)
.addController("Front center")
.addCasingInfo("Solid Steel Machine Casing", 16)
.addStructureInfo("Casings can be replaced with Explosion Warning Signs")
.addEnergyHatch("Any casing")
.addMaintenanceHatch("Any casing")
.addMufflerHatch("Any casing")
.addInputBus("Any casing")
.addOutputBus("Any casing")
.toolTipFinisher("Gregtech");
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
return tt.getInformation();
} else {
return tt.getStructureInformation();
}
return new String[]{
"Implosion Compressor",
"Explosions are fun",
"Controller block for the Implosion Compressor",
"Creates up to: " + 20 * getPollutionPerTick(null) + " Pollution per Second",
ADV_STR_CHECK,
TT_BLUEPRINT
};
}

@Override
Expand All @@ -185,13 +185,13 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide
}

@Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true);
}

@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png");
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true);
}

@Override
Expand Down Expand Up @@ -248,8 +248,6 @@ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
}
}



@Override
public int getMaxEfficiency(ItemStack aStack) {
return 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@

package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement;

import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference;
import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder;
import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils;
import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
import com.github.technus.tectech.mechanics.structure.StructureDefinition;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import gregtech.api.GregTech_API;
Expand All @@ -52,6 +55,7 @@
import java.util.ArrayList;

import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK;
import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT;
import static com.github.technus.tectech.mechanics.structure.StructureUtility.*;

public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM implements IHasCoils, IConstructable {
Expand Down Expand Up @@ -143,6 +147,9 @@ protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemS
this.mCostDiscount = 1;
this.setCoilHeat(HeatingCoilLevel.None);
boolean ret = this.structureCheck_EM("main", 1, 2, 0) && this.getCoilHeat() != HeatingCoilLevel.None;

this.mMufflerHatches.forEach(x -> x.setInValidFacings(this.getExtendedFacing().getRelativeUpInWorld().getOpposite()));

if (this.mMufflerHatches.stream()
.map(MetaTileEntity::getBaseMetaTileEntity)
.mapToInt(ITurnable::getFrontFacing)
Expand All @@ -166,27 +173,15 @@ protected boolean cyclicUpdate_EM() {

@Override
public String[] getDescription() {
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Furnace")
.addInfo("Controller Block for the Multi Smelter")
.addInfo("Smelts up to 8-128 items at once")
.addInfo("Items smelted increases with coil tier")
.addPollutionAmount(20 * getPollutionPerTick(null))
.addInfo(ADV_STR_CHECK)
.addSeparator()
.beginStructureBlock(3, 3, 3, true)
.addController("Front bottom")
.addCasingInfo("Heat Proof Machine Casing", 8)
.addOtherStructurePart("Heating Coils", "Middle layer")
.addEnergyHatch("Any bottom casing")
.addMaintenanceHatch("Any bottom casing")
.addMufflerHatch("Top Middle")
.addInputBus("Any bottom casing")
.addOutputBus("Any bottom casing")
.toolTipFinisher("Gregtech");
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
return tt.getInformation();
return tt.getStructureInformation();
return new String[]{
"Furnace",
"Controller Block for the Multi Smelter",
"Smelts up to 8-128 items at once",
"Items smelted increases with coil tier",
"Creates up to: " + 20 * getPollutionPerTick(null) + " Pollution per Second",
ADV_STR_CHECK,
TT_BLUEPRINT
};
}

@Override
Expand All @@ -199,12 +194,12 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide

@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png");
return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true);
}

@Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true);
}

@Override
Expand Down
Loading

0 comments on commit 74d4e6d

Please sign in to comment.