20w17a compile pass
This commit is contained in:
parent
178e0937d5
commit
7ccd5bcebd
68 changed files with 868 additions and 658 deletions
|
@ -31,6 +31,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Tickable;
|
||||
import reborncore.api.IToolDrop;
|
||||
|
@ -60,8 +61,11 @@ public class AlarmBlockEntity extends BlockEntity
|
|||
} else {
|
||||
selectedSound = 1;
|
||||
}
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.alarmID, new LiteralText(
|
||||
Formatting.GRAY + StringUtils.t("techreborn.message.alarm") + " " + "Alarm " + selectedSound));
|
||||
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.alarmID, new TranslatableText("techreborn.message.alarm")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(" Alarm ")
|
||||
.append(String.valueOf(selectedSound)));
|
||||
}
|
||||
|
||||
// BlockEntity
|
||||
|
|
|
@ -28,6 +28,8 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -41,6 +43,7 @@ import reborncore.common.crafting.ingredient.RebornIngredient;
|
|||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import reborncore.common.util.Torus;
|
||||
import techreborn.api.recipe.recipes.FusionReactorRecipe;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
|
@ -484,22 +487,23 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
|
|||
.orElse(null);
|
||||
}
|
||||
|
||||
public String getStateString(){
|
||||
public Text getStateText(){
|
||||
if(state == -1){
|
||||
return "";
|
||||
return LiteralText.EMPTY;
|
||||
} else if (state == 0){
|
||||
return "No recipe";
|
||||
return new LiteralText("No recipe");
|
||||
} else if (state == 1){
|
||||
FusionReactorRecipe r = getCurrentRecipeFromID();
|
||||
if(r == null) {
|
||||
return "Charging";
|
||||
return new LiteralText("Charging");
|
||||
}
|
||||
int percentage = percentage(r.getStartEnergy(), getEnergy());
|
||||
return "Charging (" + percentage + "%)";
|
||||
return new LiteralText("Charging (")
|
||||
.append(StringUtils.getPercentageText(percentage));
|
||||
} else if (state == 2){
|
||||
return "Crafting";
|
||||
return new LiteralText("Crafting");
|
||||
}
|
||||
return "";
|
||||
return LiteralText.EMPTY;
|
||||
}
|
||||
|
||||
private int percentage(double MaxValue, double CurrentValue) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue