blob: ca6b31ccef3793666a92984b8746ea761bfb9e98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
package gregtech.api.recipe.check;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.StatCollector;
import gregtech.api.util.GT_Utility;
public class ResultInsufficientPower implements CheckRecipeResult {
private long required;
ResultInsufficientPower(long required) {
this.required = required;
}
@Override
public String getID() {
return "insufficient_power";
}
@Override
public boolean wasSuccessful() {
return false;
}
@Override
public String getDisplayString() {
return StatCollector.translateToLocalFormatted(
"GT5U.gui.text.insufficient_power",
GT_Utility.formatNumbers(required),
GT_Utility.getColoredTierNameFromVoltage(required));
}
@Override
public CheckRecipeResult newInstance() {
return new ResultInsufficientPower(0);
}
@Override
public void encode(PacketBuffer buffer) {
buffer.writeLong(required);
}
@Override
public void decode(PacketBuffer buffer) {
required = buffer.readLong();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ResultInsufficientPower that = (ResultInsufficientPower) o;
return required == that.required;
}
}
|