1.16 port
This commit is contained in:
@@ -25,7 +25,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
@@ -45,12 +44,12 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
|
||||
public AEBaseBlockItemChargeable(Block id, Properties props) {
|
||||
super(id, props);
|
||||
|
||||
addPropertyOverride(new ResourceLocation("appliedenergistics2:fill_level"), (is, world, entity) -> {
|
||||
/*addPropertyOverride(new ResourceLocation("appliedenergistics2:fill_level"), (is, world, entity) -> {
|
||||
double curPower = getAECurrentPower(is);
|
||||
double maxPower = getAEMaxPower(is);
|
||||
|
||||
return (int) Math.round(100 * curPower / maxPower);
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,10 +67,10 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
|
||||
|
||||
final double percent = internalCurrentPower / internalMaxPower;
|
||||
|
||||
lines.add(GuiText.StoredEnergy.textComponent()
|
||||
.appendText(':' + MessageFormat.format(" {0,number,#} ", internalCurrentPower))
|
||||
.appendSibling(new TranslationTextComponent(PowerUnits.AE.unlocalizedName))
|
||||
.appendText(" - " + MessageFormat.format("{0,number,#.##%}", percent)));
|
||||
lines.add(GuiText.StoredEnergy.textComponent().deepCopy()
|
||||
.func_240702_b_(':' + MessageFormat.format(" {0,number,#} ", internalCurrentPower))
|
||||
.func_230529_a_(new TranslationTextComponent(PowerUnits.AE.unlocalizedName))
|
||||
.func_240702_b_(" - " + MessageFormat.format("{0,number,#.##%}", percent)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user