Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
264 commits
Select commit Hold shift + click to select a range
83f55eb
fix args properly
ghzdude Nov 22, 2024
42c4f33
update large boiler
ghzdude Nov 22, 2024
8193f8c
create ui factory at build instead of constructor
ghzdude Nov 22, 2024
c41fe44
update large combustion
ghzdude Nov 22, 2024
996acc2
pass in builder instead of list
ghzdude Nov 22, 2024
14fe244
improve blinking logo a bit
ghzdude Nov 22, 2024
de9c22b
switch to builder instead of list for warning/error
ghzdude Nov 22, 2024
c87f253
add/improve javadocs
ghzdude Nov 23, 2024
0d78a12
remove reset and make internal methods private
ghzdude Nov 24, 2024
fcc0e74
sync fuel needed and rotor stats
ghzdude Nov 24, 2024
f1617a7
rename and reorganize KeyUtil methods
ghzdude Nov 25, 2024
23dba36
always return cache for client and default for server
ghzdude Nov 26, 2024
65e5ee4
make display text dynamically updated
ghzdude Nov 26, 2024
b1b0b26
comments, use margin instead of padding, align
ghzdude Nov 26, 2024
c1c11bc
make and use builder methods instead of anonynous classes
ghzdude Nov 28, 2024
7c86910
move builder from MultiblockDisplayTextPort into MultiblockUIFactory
ghzdude Nov 28, 2024
c22b0dc
make builder static again
ghzdude Nov 28, 2024
8803336
simplify compound consumer
ghzdude Nov 28, 2024
94d0951
fix water for boiler
ghzdude Nov 28, 2024
53fd162
fix lubricant for LCE
ghzdude Nov 28, 2024
daa1fc0
fix large turbine
ghzdude Nov 28, 2024
d54cc48
fix maint and obstruction
ghzdude Nov 28, 2024
8661985
improve int array sync value
ghzdude Nov 28, 2024
4a03e9d
improve compound consumers
ghzdude Nov 28, 2024
0a494b8
start work on fixing display
ghzdude Nov 28, 2024
b24f559
fix display tooltips
ghzdude Nov 28, 2024
b68b68a
use dynamic keys again
ghzdude Nov 28, 2024
1c5bdc4
simplify display checking
ghzdude Nov 29, 2024
2742b45
add tooltip for no flex
ghzdude Nov 29, 2024
1848e1c
improve value syncing greatly
ghzdude Nov 29, 2024
aa560fe
fix LCE fuel name + spotless
ghzdude Nov 29, 2024
e7aa34f
remove unused datacode
ghzdude Nov 29, 2024
340aac0
no need to sync temp
ghzdude Nov 29, 2024
79e0da3
rework builder to use IDrawables
ghzdude Nov 29, 2024
fbc08cf
simplify ifs
ghzdude Nov 29, 2024
ba0001a
move tooltip setting to right method
ghzdude Nov 29, 2024
061e716
fix packages
ghzdude Nov 29, 2024
262d37d
make fluid drill lang colored
ghzdude Nov 29, 2024
187575f
port Fusion Reactor + textures
ghzdude Dec 2, 2024
5aafea0
sync harder
ghzdude Dec 2, 2024
80447a0
improve EBF `formStructure()` a bit
ghzdude Dec 2, 2024
cd1b3fe
remove unused datacode
ghzdude Dec 3, 2024
9bd0ebd
create new class for display that behaves similar to AdvancedTextWidget
ghzdude Dec 5, 2024
a6e74a7
add new case for status
ghzdude Dec 5, 2024
806f859
improve drawing a bit
ghzdude Dec 5, 2024
3e74e8a
add change listener
ghzdude Dec 5, 2024
8eb88aa
fix rebase
ghzdude Jan 8, 2025
6a9cd2e
only construct key array if lengths are different
ghzdude Jan 8, 2025
b00e034
try to utilize new key methods
ghzdude Jan 8, 2025
f66276a
improve key util methods some more
ghzdude Jan 8, 2025
7f480da
simplify status keys
ghzdude Jan 8, 2025
be3c08c
forgor flow
ghzdude Jan 8, 2025
85ca3e9
port to rich text
ghzdude Jan 9, 2025
d80871d
fix npe
ghzdude Jan 9, 2025
ca60a76
fix indicator tooltips
ghzdude Jan 10, 2025
9ff112c
fix energy container line
ghzdude Jan 10, 2025
69b6f10
port pyrolyse and multismelter
ghzdude Jan 10, 2025
58e97fb
fix potential npe when fixing args
ghzdude Jan 10, 2025
b397c4c
add mixin to set cache in constructor
ghzdude Jan 10, 2025
a1af7cc
no longer need to call this
ghzdude Jan 10, 2025
31f4468
cleanup
ghzdude Jan 10, 2025
d9cf1dd
make adding status keys actually translate
ghzdude Jan 10, 2025
223a29d
port HPCA, research station, cracking unit
ghzdude Jan 10, 2025
c03d5a9
port processing array
ghzdude Jan 10, 2025
65544c9
go back to drawable list
ghzdude Jan 14, 2025
ab3ed15
update note
ghzdude Jan 14, 2025
144fefe
merge text related mixins under one class
ghzdude Jan 17, 2025
ac83cd2
create better impl for keys with tooltips
ghzdude Jan 17, 2025
90c5257
implement key serialization
ghzdude Jan 17, 2025
8bfe42c
remove note
ghzdude Jan 17, 2025
fc84db6
remove most dynamic keys
ghzdude Jan 17, 2025
bfa5084
fix npe when serializing null arrays
ghzdude Jan 17, 2025
3afcb00
no need to sync energy container
ghzdude Jan 17, 2025
6baba7f
add helper method for array access
ghzdude Jan 17, 2025
cb0a3a2
address todo for dynamic color tooltip
ghzdude Jan 18, 2025
266d2eb
this class is no longer necessary
ghzdude Jan 18, 2025
7a10656
add method overload
ghzdude Jan 29, 2025
854c2f8
simplify DrawableSerializer
ghzdude Jan 29, 2025
00e95c4
add method for additional children to the screen
ghzdude Jan 29, 2025
b4803a1
remove custom screen
ghzdude Jan 29, 2025
988e502
remove unused method
ghzdude Jan 29, 2025
25a60d8
Move the PSS to the new MUI2 display text methods
Zorbatron Jan 30, 2025
2c9d5f9
simplify progress bars a bit
ghzdude Jan 30, 2025
52da701
add extra space to lines
ghzdude Jan 30, 2025
caf48e9
Pass guiData to `MultiblockUIFactory#createFlexButton`
Zorbatron Jan 30, 2025
85b46d4
move trifunction back to bifunction and remove panel parameter
ghzdude Jan 30, 2025
11b3f62
fix rebase
ghzdude Feb 2, 2025
7ee7ca5
fix formatting
ghzdude Feb 2, 2025
51db1e7
add note
ghzdude Feb 2, 2025
9d51988
fix prev duration being zero
ghzdude Feb 2, 2025
c77ab0e
add string with formatting and number method to KeyUtil
ghzdude Feb 2, 2025
e96dbdd
spotless
ghzdude Feb 2, 2025
d51c5db
cleanup and new voltage key methods
ghzdude Feb 2, 2025
a41ee0f
add status tooltip for fusion reactor
ghzdude Feb 2, 2025
2d23857
fix format number with precision
ghzdude Feb 3, 2025
4077310
add runnable to update structure formed for error/warning builders
ghzdude Feb 3, 2025
ed38cb8
more cleanup 2.0
ghzdude Feb 3, 2025
603b65d
simplify item bus grid construction
ghzdude Feb 3, 2025
a359a10
actually mark dirty on change
ghzdude Feb 3, 2025
d7536e2
add hpca grid to screen
ghzdude Feb 3, 2025
390a15d
Mostly working multi miner port
Zorbatron Feb 3, 2025
577153b
fix mine pos for large miner
ghzdude Feb 4, 2025
1cbe50e
Finish off the large miner.
Zorbatron Feb 4, 2025
27ace53
Remove MUI0 methods from FuelMultiblockController, MetaTileEntityCrac…
Zorbatron Feb 4, 2025
bdc92b3
spotless
Zorbatron Feb 4, 2025
a0bd838
Move RecipeMapSteamMultiblockController to the MUI2 methods.
Zorbatron Feb 4, 2025
2f1da36
AT to MUI2
Zorbatron Feb 4, 2025
b4990cd
Cleanroom mui2-ified + move the order of some text around to make mor…
Zorbatron Feb 4, 2025
ccaa333
data bank
Zorbatron Feb 4, 2025
308a6c7
network switch
Zorbatron Feb 4, 2025
10ace8d
remove old mui0 methods from HPCA
Zorbatron Feb 4, 2025
8708aa9
Fluid Drill multiblock
Zorbatron Feb 4, 2025
c45549e
Mark handleDisplayClick as deprecated
Zorbatron Feb 4, 2025
c0be81a
Central Monitor kinda ish not really
Zorbatron Feb 4, 2025
8492eb3
spotless
Zorbatron Feb 4, 2025
f7b61c5
move `getFluidIKey` to KeyUtil and rename
ghzdude Feb 4, 2025
d727985
use number method and add note
ghzdude Feb 4, 2025
6b8fbb3
Move the status line to be more consistent with other multiblocks and…
Zorbatron Feb 5, 2025
728c2dc
fix BigIntegerSyncValue
ghzdude Feb 8, 2025
947bac6
add Operations
ghzdude Feb 14, 2025
d69b9aa
move classes/interfaces out of MultiblockUIFactory
ghzdude Feb 14, 2025
0738983
fix hpca componant grid size
ghzdude Feb 14, 2025
6573b38
HPCA component widget tooltips and remove old MUI0 methods
Zorbatron Feb 14, 2025
1d4e00e
fully implement HPCA's tooltips
ghzdude Feb 14, 2025
377203d
improve tooltip a bit more
ghzdude Feb 15, 2025
7858b83
Allow `GTFluidSyncHandler`s to control showing the amount in the tool…
Zorbatron Feb 17, 2025
a3ff38a
`GTFluidSlot`s can now render the fluid as taking up a percentage of …
Zorbatron Feb 17, 2025
d645602
Convert the multiblock tank to MUI2
Zorbatron Feb 17, 2025
81b266a
spotless
Zorbatron Feb 17, 2025
de02b2b
Rework MUI2 Multi Syncing (#2734)
ghzdude Feb 22, 2025
f9e6995
spotless pls
ghzdude Feb 22, 2025
7bc76c9
move key manager and sync handler to internal classes
ghzdude Feb 23, 2025
ee7ae8f
add ScrollableTextWidget
ghzdude Feb 24, 2025
4c4c4c4
Add machine mode to the GUI of MultiMapControllers - MUI2 (#2713)
Zorbatron Feb 26, 2025
bc7a3f1
fix getting hovered element
ghzdude Feb 26, 2025
cbae953
fix background and simplify
ghzdude Feb 26, 2025
9b9fa3b
add method for syncing objects
ghzdude Feb 26, 2025
336ad3a
fix issues with ScrollableTextWidget
ghzdude Feb 26, 2025
f529705
add overload for syncObject
ghzdude Feb 26, 2025
d13e666
rework adding screen widgets
ghzdude Feb 26, 2025
4c162c0
add methods for syncing collections
ghzdude Feb 26, 2025
6a507d8
add generic return for collection
ghzdude Feb 26, 2025
e4905c9
fix fusion reactor tooltip(?)
ghzdude Feb 26, 2025
f95cf78
add javadocs/comments + method rename
ghzdude Feb 26, 2025
7607e6d
add screen widgets after display
ghzdude Feb 26, 2025
8a95a68
make steam multis use bronze theme
ghzdude Feb 26, 2025
734fe6c
mark item and fluid outputs as notnull
ghzdude Feb 27, 2025
ef385d4
make new list for syncing
ghzdude Mar 1, 2025
069f788
add supplier methods to UISyncer to avoid potential client NPEs
ghzdude Mar 1, 2025
7071eee
add javadoc
ghzdude Mar 1, 2025
b21914b
add extra fluid methods
ghzdude Mar 2, 2025
063307c
nvm don't make copy
ghzdude Mar 2, 2025
9d07fb7
Display recipe outputs in multiblocks - MUI2 (#2714)
Zorbatron Mar 4, 2025
8e346b6
simplify internal syncer
ghzdude Mar 4, 2025
4b7a5b3
move IconAcessor out of mixin
ghzdude Mar 4, 2025
39e65ba
fix javadoc comments
ghzdude Mar 4, 2025
08a3933
fix getting the hovered element when scrolling
ghzdude Mar 6, 2025
548f440
make FluidStackHashStrategy mimic ItemStackHashStrategy better
ghzdude Mar 8, 2025
7e23b44
simplify hash builder names
ghzdude Mar 8, 2025
40827a1
optimize copy for new map keys
ghzdude Mar 9, 2025
c0425e8
utilize new empty method
ghzdude Mar 9, 2025
87a0f90
fix tests
ghzdude Mar 10, 2025
69a6a6d
i need to replace this too
ghzdude Mar 10, 2025
d9e2595
add builder overload for sync
ghzdude Mar 11, 2025
e71d50e
add display to theme
ghzdude Mar 27, 2025
d051496
fix small issue with GTFluidSyncHandler
ghzdude Mar 27, 2025
f9006bb
move build ui method down closer to other ui methods
ghzdude Mar 27, 2025
6835465
rebuild instead of mark dirty
ghzdude Mar 28, 2025
7fbb12f
remove unnecessary KeyUtil methods
ghzdude Mar 28, 2025
c195292
address lang todo
ghzdude Mar 28, 2025
36253f5
delete old ui code
ghzdude Mar 28, 2025
5126579
mixin to fix backgrounds and overlays for cycle widgets
ghzdude Mar 29, 2025
7155d6d
convert flex and void into overlays
ghzdude Mar 29, 2025
bb5f7a5
improve getting parallel recipe
ghzdude Mar 30, 2025
7898f35
make power into overlay
ghzdude Mar 30, 2025
9737223
rework gear texture + correct size
ghzdude Mar 30, 2025
141355a
fix bars for fusion reactor
ghzdude Mar 31, 2025
04b9506
sync coil tier for pyrolyse
ghzdude Mar 31, 2025
f8386b7
actually use the tank capacity for LCE
ghzdude Mar 31, 2025
5fdf7d0
update panel height on screen height change
ghzdude Mar 31, 2025
d0b7582
fix format error for fusion energy info
ghzdude Apr 1, 2025
bcdf203
with four hours of sleep, i fixed fusion tooltips
ghzdude Apr 1, 2025
edfcecb
show invalid structure on error indicator
ghzdude Apr 1, 2025
debdace
add color to theme
ghzdude Apr 1, 2025
a680fc4
add themed fluid slot
ghzdude Apr 2, 2025
adbc94b
make more textures un-theme-able
ghzdude Apr 2, 2025
50f65e7
make GTObjectDrawable prefer slot from theme
ghzdude Apr 3, 2025
2a229d7
rework ProgressBarMultiblock interface and bar registration
ghzdude Apr 5, 2025
721892e
remove unused default methods
ghzdude Apr 5, 2025
5bddfae
actually theme object drawawble + misc fixes
ghzdude Apr 9, 2025
491e872
show fluid amount when no fluid
ghzdude Apr 10, 2025
d8e9c6c
add researching line
ghzdude Apr 10, 2025
b1d77a0
try caching data about recipes 2.0
ghzdude Apr 11, 2025
c1012d7
improve research line
ghzdude Apr 11, 2025
5e2d17b
add coolant needed for hpca
ghzdude Apr 12, 2025
245397c
rename paramater
ghzdude Apr 12, 2025
6dde3cd
add dynamo full to warning
ghzdude Apr 12, 2025
2b57c9a
add default impl for `getTileName()` to use mte's `getMetaFullName()`…
ghzdude Apr 13, 2025
b652867
add debug names to several widgets
ghzdude Apr 13, 2025
e31e018
rename key method and simplify slightly
ghzdude Apr 13, 2025
bc41c27
sync height, width, and drain energy
ghzdude Apr 16, 2025
a680c70
fix cleanroom sync
ghzdude Apr 17, 2025
b8e4b92
fix drain energy npe for low power
ghzdude Apr 17, 2025
a643a5b
add check for if working enabled for sound
ghzdude Apr 19, 2025
7bb38ef
switch to anonymous class for dynamic textures
ghzdude Apr 25, 2025
75bdbbd
use ticks when max duration is small enough
ghzdude Apr 25, 2025
3caffd5
trim recipe output
ghzdude Apr 27, 2025
a484e58
make get syncer package-private
ghzdude May 17, 2025
22ec7a8
fix duplicate warnings for FuelMultiblockController
ghzdude May 17, 2025
48bae65
move maint and muffler lines out of MultiblockUIFactory
ghzdude May 17, 2025
3fd07f1
make full maint cause error
ghzdude May 17, 2025
6c0af2c
make full maint cause error
ghzdude May 17, 2025
1dba284
Operations are no longer checked and registered
ghzdude May 23, 2025
ea30e65
add representative item stacks for maintanence lines
ghzdude May 23, 2025
5b00ad8
addKey -> addOperation
ghzdude May 23, 2025
63e9162
make IEquals notnull
ghzdude May 23, 2025
98532af
clarify todo
ghzdude May 23, 2025
866b619
fix warning icon in fuel multiblocks
ghzdude May 23, 2025
e8ee7a3
improve flex button javadoc
ghzdude May 24, 2025
528cdbd
fix small oopsie
ghzdude May 24, 2025
c5cf9fd
add value to TemplateBarBuilder
ghzdude May 24, 2025
9884981
replace reference to deleted method
ghzdude May 24, 2025
b0320bd
fix research line
ghzdude May 25, 2025
5cb8e65
spotless
ghzdude May 27, 2025
0d9516d
only sync to client if front face free changes
ghzdude May 28, 2025
bbc4c30
address todo
ghzdude May 30, 2025
5dce8a1
do lang TODO
Zorbatron Jun 13, 2025
cd44002
Do the createPowerButton TODO
Zorbatron Jun 13, 2025
1648489
Do 'show % sign' TODO
Zorbatron Jun 14, 2025
dabcb3f
Wrong text color in addProgressLine
Zorbatron Jun 14, 2025
d8f9845
Fix empty text in the multiblock drilling rig as the drilled fluid wa…
Zorbatron Jun 14, 2025
e694005
Do 'working dynamic color substitutions into IKey.lang' TODO
Zorbatron Jun 14, 2025
58a6e40
Remove item and fluid syncers from UISyncer and use syncObject instead
Zorbatron Jun 14, 2025
8ccec39
Undo the removal of the UISyncer methods but delegate to syncObject i…
Zorbatron Jun 14, 2025
f4a52e3
Use `KeyUtil.fluid()` in the tooltip of `GTFluidSlot`s instead of `ge…
Zorbatron Jun 16, 2025
e5f5e5b
Fix input hatches having locking behavior (out of scope ig, but I'm l…
Zorbatron Jun 16, 2025
884cf32
Don't use `getLocalizedName()` pt2
Zorbatron Jun 16, 2025
6d3236c
hasFluid doesn't work with locked fluids
Zorbatron Jun 16, 2025
02565a6
Don't register `GTFluidSlot`s as JEI targets if it's not phantom or l…
Zorbatron Jun 16, 2025
e2f6922
Fix NPE I caused and clean up code
Zorbatron Jun 16, 2025
b95a817
Fix locked fluid not being synced to client on load
Zorbatron Jun 16, 2025
10c9cf2
Fix large combustion engines saying "Running Perfectly" when the dyna…
Zorbatron Jun 16, 2025
ff511cb
Remove old MUI0 code from the fusion reactor class
Zorbatron Jun 16, 2025
feae98e
Remove old multiblock display text manager impl
Zorbatron Jun 16, 2025
4a52f9e
Moce TimedProgressSupplier out of ProgressWidget (MUI0)
Zorbatron Jun 16, 2025
40066c3
Remove the MUI0 `getComponentIcon` of `IHPCAComponentHatch` instead o…
Zorbatron Jun 16, 2025
bc41372
spotless
Zorbatron Jun 16, 2025
adfd9dc
Add supplier version of `addLowPowerLine` for the multiblock fluid drill
Zorbatron Jun 16, 2025
f30f0cb
Suppress unchecked cast on `PatternMatchContext#getOrDefault`
Zorbatron Jun 16, 2025
cbc1e2b
simplify hpca temperature lang
ghzdude Jun 17, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public static int assignId() {
public static final int UPDATE_UPWARDS_FACING = assignId();
public static final int UPDATE_FLIP = assignId();
public static final int LOCK_FILL = assignId();
public static final int MUFFLER_OBSTRUCTED = assignId();

// Item Bus Item Stack Auto Collapsing
public static final int TOGGLE_COLLAPSE_ITEMS = assignId();
Expand Down
19 changes: 17 additions & 2 deletions src/main/java/gregtech/api/capability/IHPCAComponentHatch.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package gregtech.api.capability;

import gregtech.api.gui.resources.TextureArea;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.mui.GTGuiTextures;

import com.cleanroommc.modularui.drawable.UITexture;

public interface IHPCAComponentHatch {

Expand Down Expand Up @@ -46,5 +49,17 @@ default void setDamaged(boolean damaged) {}
/**
* The icon for this component in the HPCA's UI. Should be a 13x13 px sprite.
*/
TextureArea getComponentIcon();
default UITexture getComponentIcon() {
return GTGuiTextures.HPCA_ICON_EMPTY_COMPONENT;
}

/**
* The untranslated name of the tile implementing an HPCA component
*/
default String getTileName() {
if (this instanceof MetaTileEntity mte) {
return mte.getMetaFullName();
}
return "";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static gregtech.api.GTValues.ULV;
Expand Down Expand Up @@ -70,8 +71,10 @@ public abstract class AbstractRecipeLogic extends MTETrait implements IWorkable,
protected int progressTime;
protected int maxProgressTime;
protected long recipeEUt;
protected List<FluidStack> fluidOutputs;
protected List<ItemStack> itemOutputs;
@NotNull
protected List<FluidStack> fluidOutputs = Collections.emptyList();
@NotNull
protected List<ItemStack> itemOutputs = Collections.emptyList();

protected boolean isActive;
protected boolean workingEnabled = true;
Expand Down Expand Up @@ -338,6 +341,10 @@ public void setParallelRecipesPerformed(int amount) {
this.parallelRecipesPerformed = amount;
}

public int getParallelRecipesPerformed() {
return parallelRecipesPerformed;
}

/**
* Update the current running recipe's progress
* <p>
Expand Down Expand Up @@ -974,8 +981,8 @@ protected void completeRecipe() {
this.progressTime = 0;
setMaxProgress(0);
this.recipeEUt = 0;
this.fluidOutputs = null;
this.itemOutputs = null;
this.fluidOutputs = Collections.emptyList();
this.itemOutputs = Collections.emptyList();
this.hasNotEnoughEnergy = false;
this.wasActiveAndNeedsUpdate = true;
this.parallelRecipesPerformed = 0;
Expand Down Expand Up @@ -1135,8 +1142,8 @@ public void invalidate() {
progressTime = 0;
maxProgressTime = 0;
recipeEUt = 0;
fluidOutputs = null;
itemOutputs = null;
fluidOutputs = Collections.emptyList();
itemOutputs = Collections.emptyList();
parallelRecipesPerformed = 0;
isOutputsFull = false;
invalidInputsForRecipes = false;
Expand Down Expand Up @@ -1211,7 +1218,7 @@ public void deserializeNBT(@NotNull NBTTagCompound compound) {
this.itemOutputs.add(new ItemStack(itemOutputsList.getCompoundTagAt(i)));
}
NBTTagList fluidOutputsList = compound.getTagList("FluidOutputs", Constants.NBT.TAG_COMPOUND);
this.fluidOutputs = new ArrayList<>();
this.fluidOutputs = new ArrayList<>(fluidOutputsList.tagCount());
for (int i = 0; i < fluidOutputsList.tagCount(); i++) {
this.fluidOutputs.add(FluidStack.loadFluidStackFromNBT(fluidOutputsList.getCompoundTagAt(i)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public class BoilerRecipeLogic extends AbstractRecipeLogic implements ICategoryO

public BoilerRecipeLogic(MetaTileEntityLargeBoiler tileEntity) {
super(tileEntity, null);
this.fluidOutputs = Collections.emptyList();
this.itemOutputs = Collections.emptyList();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
public class MultiblockFuelRecipeLogic extends MultiblockRecipeLogic {

protected long totalContinuousRunningTime;
private int previousDuration = 0;

public MultiblockFuelRecipeLogic(RecipeMapMultiblockController tileEntity) {
super(tileEntity);
Expand Down Expand Up @@ -127,18 +128,24 @@ public String getRecipeFluidInputInfo() {
} else {
recipe = previousRecipe;
}
previousDuration = recipe.getDuration();
FluidStack requiredFluidInput = recipe.getFluidInputs().get(0).getInputFluidStack();

int ocAmount = GTUtility.safeCastLongToInt(getMaxVoltage() / recipe.getEUt());
int neededAmount = ocAmount * requiredFluidInput.amount;
if (rotorHolder != null && rotorHolder.hasRotor()) {
neededAmount /= (rotorHolder.getTotalEfficiency() / 100.0);
neededAmount /= (int) (rotorHolder.getTotalEfficiency() / 100.0);
} else if (rotorHolder != null && !rotorHolder.hasRotor()) {
return null;
}
return TextFormatting.RED + TextFormattingUtil.formatNumbers(neededAmount) + "L";
}

@Override
public int getPreviousRecipeDuration() {
return previousDuration;
}

public FluidStack getInputFluidStack() {
// Previous Recipe is always null on first world load, so try to acquire a new recipe
if (previousRecipe == null) {
Expand Down
26 changes: 17 additions & 9 deletions src/main/java/gregtech/api/fluids/GTFluid.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
import gregtech.api.fluids.attribute.FluidAttribute;
import gregtech.api.unification.material.Material;

import net.minecraft.client.resources.I18n;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import com.cleanroommc.modularui.api.drawable.IKey;
import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Unmodifiable;
Expand Down Expand Up @@ -62,6 +63,8 @@ public GTMaterialFluid(@NotNull String fluidName, ResourceLocation still, Resour
return this.material;
}

@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.10")
public @NotNull TextComponentTranslation toTextComponentTranslation() {
TextComponentTranslation localizedName;
String customMaterialTranslation = "fluid." + material.getUnlocalizedName();
Expand All @@ -78,22 +81,27 @@ public GTMaterialFluid(@NotNull String fluidName, ResourceLocation still, Resour
return localizedName;
}

@Override
@SideOnly(Side.CLIENT)
public String getLocalizedName(FluidStack stack) {
String localizedName;
public @NotNull IKey getLocalizedKey() {
IKey localizedName;
String customMaterialTranslation = "fluid." + material.getUnlocalizedName();

if (I18n.hasKey(customMaterialTranslation)) {
localizedName = I18n.format(customMaterialTranslation);
if (net.minecraft.util.text.translation.I18n.canTranslate(customMaterialTranslation)) {
localizedName = IKey.lang(customMaterialTranslation);
} else {
localizedName = I18n.format(material.getUnlocalizedName());
localizedName = IKey.lang(material.getUnlocalizedName());
}

if (translationKey != null) {
return I18n.format(translationKey, localizedName);
return IKey.lang(translationKey, localizedName);
}

return localizedName;
}

@Override
@SideOnly(Side.CLIENT)
public String getLocalizedName(FluidStack stack) {
return getLocalizedKey().get();
}
}
}
35 changes: 1 addition & 34 deletions src/main/java/gregtech/api/gui/widgets/ProgressWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import gregtech.api.gui.resources.TextureArea;
import gregtech.api.util.Position;
import gregtech.api.util.Size;
import gregtech.api.util.function.impl.TimedProgressSupplier;
import gregtech.common.ConfigHolder;

import net.minecraft.client.renderer.GlStateManager;
Expand Down Expand Up @@ -295,38 +296,4 @@ public void drawInForeground(int mouseX, int mouseY) {
}
}
}

public static class TimedProgressSupplier implements DoubleSupplier {

private final int msPerCycle;
private final int maxValue;
private final boolean countDown;
private long startTime;

public TimedProgressSupplier(int ticksPerCycle, int maxValue, boolean countDown) {
this.msPerCycle = ticksPerCycle * 50;
this.maxValue = maxValue;
this.countDown = countDown;
this.startTime = System.currentTimeMillis();
}

public void resetCountdown() {
startTime = System.currentTimeMillis();
}

@Override
public double getAsDouble() {
return calculateTime();
}

private double calculateTime() {
long currentTime = System.currentTimeMillis();
long msPassed = (currentTime - startTime) % msPerCycle;
double currentValue = 1.0 * msPassed * maxValue / msPerCycle;
if (countDown) {
return (maxValue - currentValue) / maxValue;
}
return currentValue / maxValue;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ public GTGuiTheme getUITheme() {
}

@Override
public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager guiSyncManager) {
public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager panelSyncManager) {
return null;
}

Expand Down Expand Up @@ -892,7 +892,11 @@ private void updateSound() {
if (sound == null) {
return;
}
if (isValid() && isActive()) {
boolean canPlay = isValid() && isActive();
if (this instanceof IControllable controllable) {
canPlay &= controllable.isWorkingEnabled();
}
if (canPlay) {
if (--playSoundCooldown > 0) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import gregtech.api.capability.IMultipleTankHandler;
import gregtech.api.capability.impl.EnergyContainerList;
import gregtech.api.capability.impl.MultiblockFuelRecipeLogic;
import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder;
import gregtech.api.mui.sync.FixedIntArraySyncValue;
import gregtech.api.recipes.RecipeMap;
import gregtech.api.util.GTUtility;
import gregtech.api.util.TextComponentUtil;
Expand All @@ -16,8 +18,13 @@
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;

import com.cleanroommc.modularui.api.drawable.IKey;
import com.cleanroommc.modularui.screen.RichTooltip;
import com.cleanroommc.modularui.value.sync.StringSyncValue;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
Expand All @@ -41,16 +48,22 @@ protected void initializeAbilities() {
}

@Override
protected void addDisplayText(List<ITextComponent> textList) {
protected void configureDisplayText(MultiblockUIBuilder builder) {
MultiblockFuelRecipeLogic recipeLogic = (MultiblockFuelRecipeLogic) recipeMapWorkable;

MultiblockDisplayText.builder(textList, isStructureFormed())
.setWorkingStatus(recipeLogic.isWorkingEnabled(), recipeLogic.isActive())
builder.setWorkingStatus(recipeLogic.isWorkingEnabled(), recipeLogic.isActive())
.addEnergyProductionLine(getMaxVoltage(), recipeLogic.getRecipeEUt())
.addFuelNeededLine(recipeLogic.getRecipeFluidInputInfo(), recipeLogic.getPreviousRecipeDuration())
.addWorkingStatusLine();
}

@Override
protected void configureWarningText(MultiblockUIBuilder builder) {
builder.addLowDynamoTierLine(isDynamoTierTooLow());
if (hasMaintenanceMechanics())
builder.addMaintenanceProblemLines(getMaintenanceProblems(), true);
}

protected long getMaxVoltage() {
IEnergyContainer energyContainer = recipeMapWorkable.getEnergyContainer();
if (energyContainer != null && energyContainer.getEnergyCapacity() > 0) {
Expand All @@ -60,13 +73,6 @@ protected long getMaxVoltage() {
}
}

@Override
protected void addWarningText(List<ITextComponent> textList) {
MultiblockDisplayText.builder(textList, isStructureFormed(), false)
.addLowDynamoTierLine(isDynamoTierTooLow())
.addMaintenanceProblemLines(getMaintenanceProblems());
}

protected boolean isDynamoTierTooLow() {
if (isStructureFormed()) {
IEnergyContainer energyContainer = recipeMapWorkable.getEnergyContainer();
Expand Down Expand Up @@ -138,6 +144,7 @@ protected int[] getTotalFluidAmount(FluidStack testStack, IMultipleTankHandler m
return new int[] { fluidAmount, fluidCapacity };
}

@Deprecated
protected void addFuelText(List<ITextComponent> textList) {
// Fuel
int fuelStored = 0;
Expand Down Expand Up @@ -170,4 +177,26 @@ protected void addFuelText(List<ITextComponent> textList) {
"0 / 0 L"));
}
}

/**
* @param tooltip the tooltip to populate
* @param amounts the sync value containing an array of [fuel stored, fuel capacity]
* @param fuelNameValue the name of the fuel
*/
protected void createFuelTooltip(@NotNull RichTooltip tooltip, @NotNull FixedIntArraySyncValue amounts,
@NotNull StringSyncValue fuelNameValue) {
if (isStructureFormed()) {
Fluid fluid = fuelNameValue.getStringValue() == null ? null :
FluidRegistry.getFluid(fuelNameValue.getStringValue());
if (fluid == null) {
tooltip.addLine(IKey.lang("gregtech.multiblock.large_combustion_engine.fuel_none"));
} else {
tooltip.addLine(
IKey.lang("gregtech.multiblock.large_combustion_engine.fuel_amount", amounts.getValue(0),
amounts.getValue(1), fluid.getLocalizedName(new FluidStack(fluid, 1))));
}
} else {
tooltip.addLine(IKey.lang("gregtech.multiblock.invalid_structure"));
}
}
}
Loading
Loading