Skip to content

Commit

Permalink
get error type as string
Browse files Browse the repository at this point in the history
  • Loading branch information
PrototypeTrousers committed Mar 8, 2021
1 parent a98c0b2 commit be80553
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import java.util.function.Consumer;

import static gregtech.api.util.InventoryUtils.simulateItemStackMerge;
import static gregtech.api.Situations.*;

public abstract class MetaTileEntity implements ICoverable {

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/gregtech/api/situation/Situation.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public Situation(int id, String situationName, SituationTypes situationTypes) {
registerSituation(id,situationName,this);
}

public String getSituationErrorLevel(Situation situation) {
return situation.situationTypes.toString();
}

void registerSituation(int id, String situationName, Situation situation){
SITUATION_REGISTRY.register(id, situationName, situation);
}
Expand Down
23 changes: 18 additions & 5 deletions src/main/java/gregtech/api/situation/SituationTypes.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
package gregtech.api.situation;

public enum SituationTypes {
WORKING,
IDLE,
ERROR,
WARNING
import net.minecraft.util.IStringSerializable;

public enum SituationTypes implements IStringSerializable {
WORKING("gregtech.situation.level.warning"),
IDLE("gregtech.situation.level.idle"),
ERROR("gregtech.situation.level.error"),
WARNING("gregtech.situation.level.warning");

public final String errorLevelName;

SituationTypes(String errorLevelName) {this.errorLevelName = errorLevelName;}

@Override
public String getName() {
return errorLevelName;
}
}


4 changes: 4 additions & 0 deletions src/main/resources/assets/gregtech/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,10 @@ cover.machine_controller.mode.cover_north=Control Cover (North)
cover.machine_controller.mode.cover_east=Control Cover (East)
cover.machine_controller.mode.cover_west=Control Cover (West)

gregtech.situation.level.working=WORKING
gregtech.situation.level.idle=IDLING
gregtech.situation.level.warning=WARNING
gregtech.situation.level.error=ERROR
gregtech.situation.idle=Idling
gregtech.situation.disabled_by_controller=Disabled by controller cover
gregtech.situation.working=Working
Expand Down

0 comments on commit be80553

Please sign in to comment.