Fix some issues

This commit is contained in:
modmuss50 2020-04-26 19:39:06 +01:00
parent 7ccd5bcebd
commit 8051e0cfbb
8 changed files with 19 additions and 10 deletions

View file

@ -63,6 +63,10 @@ public class QuantumTankBlockEntity extends TankUnitBaseBlockEntity {
TankUnitBaseBlockEntity tankEntity = (TankUnitBaseBlockEntity) world.getBlockEntity(pos);
if (tankEntity == null) {
return;
}
tankEntity.setTank(tank);
tankEntity.setStack(0, inputSlotStack);

View file

@ -27,6 +27,7 @@ package techreborn.client.gui;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.property.Properties;
@ -77,14 +78,14 @@ public class GuiGreenhouseController extends GuiBase<BuiltScreenHandler> {
getMinecraft().getTextureManager().bindTexture(new Identifier("techreborn", "textures/item/part/digital_display.png"));
drawTexture(matrixStack, x + 68, y + 22, 0, 0, 16, 16, 16, 16);
if (isPointInRect(68, 22, 16, 16, mouseX, mouseY)) {
List<Text> list = Arrays.stream(new TranslatableText("techreborn.tooltip.greenhouse.upgrade_available").asString()
List<Text> list = Arrays.stream(I18n.translate("techreborn.tooltip.greenhouse.upgrade_available")
.split("\\r?\\n"))
.map(LiteralText::new)
.collect(Collectors.toList());
RenderSystem.pushMatrix();
matrixStack.push();
renderTooltip(matrixStack, list, mouseX, mouseY);
RenderSystem.popMatrix();
matrixStack.pop();
}
}
@ -100,7 +101,7 @@ public class GuiGreenhouseController extends GuiBase<BuiltScreenHandler> {
if (!blockEntity.getMultiBlock()) {
if (isPointInRect(68, 22, 16, 16, mouseX, mouseY)) {
List<Text> list = Arrays.stream(new TranslatableText("techreborn.tooltip.greenhouse.upgrade_available").asString()
List<Text> list = Arrays.stream(I18n.translate("techreborn.tooltip.greenhouse.upgrade_available")
.split("\\r?\\n"))
.map(LiteralText::new)
.collect(Collectors.toList());

View file

@ -61,7 +61,7 @@ public class GuiStorageUnit extends GuiBase<BuiltScreenHandler> {
textRenderer.draw(matrixStack, new TranslatableText("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
} else {
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.storage.store"), 10, 20, 4210752);
textRenderer.draw(matrixStack, storageEntity.getStoredStack().getName().asString(), 10, 30, 4210752);
textRenderer.draw(matrixStack, storageEntity.getStoredStack().getName(), 10, 30, 4210752);
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.storage.amount"), 10, 50, 4210752);

View file

@ -33,6 +33,7 @@ import me.shedaniel.rei.api.widgets.Widgets;
import me.shedaniel.rei.gui.entries.RecipeEntry;
import me.shedaniel.rei.gui.entries.SimpleRecipeEntry;
import me.shedaniel.rei.gui.widget.Widget;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.item.Items;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
@ -67,7 +68,7 @@ public class MachineRecipeCategory<R extends RebornRecipe> implements RecipeCate
@Override
public String getCategoryName() {
return new TranslatableText(rebornRecipeType.getName().toString()).asString();
return I18n.translate(rebornRecipeType.getName().toString());
}
@Override

View file

@ -31,6 +31,7 @@ import me.shedaniel.rei.api.RecipeCategory;
import me.shedaniel.rei.api.widgets.Label;
import me.shedaniel.rei.api.widgets.Widgets;
import me.shedaniel.rei.gui.widget.Widget;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;
@ -58,7 +59,7 @@ public class FluidGeneratorRecipeCategory implements RecipeCategory<FluidGenerat
@Override
public String getCategoryName() {
return new TranslatableText(identifier.toString()).asString();
return I18n.translate(identifier.toString());
}
@Override

View file

@ -31,6 +31,7 @@ import me.shedaniel.rei.api.RecipeCategory;
import me.shedaniel.rei.api.widgets.Label;
import me.shedaniel.rei.api.widgets.Widgets;
import me.shedaniel.rei.gui.widget.Widget;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.item.Items;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
@ -59,7 +60,7 @@ public class FluidReplicatorRecipeCategory implements RecipeCategory<FluidReplic
@Override
public String getCategoryName() {
return new TranslatableText(rebornRecipeType.getName().toString()).asString();
return I18n.translate(rebornRecipeType.getName().toString());
}
@Override

View file

@ -26,6 +26,7 @@ package techreborn.compat.rei.rollingmachine;
import me.shedaniel.rei.api.EntryStack;
import me.shedaniel.rei.plugin.crafting.DefaultCraftingCategory;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.item.Items;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;
@ -49,7 +50,7 @@ public class RollingMachineCategory extends DefaultCraftingCategory {
@Override
public String getCategoryName() {
return new TranslatableText(rebornRecipeType.getName().toString()).asString();
return I18n.translate(rebornRecipeType.getName().toString());
}
@Override

View file

@ -85,7 +85,7 @@ public class ToolTipAssistUtils {
if(I18n.hasTranslation(key)){
if(!hidden || Screen.hasShiftDown()){
String info = new TranslatableText(key).asString();
String info = I18n.translate(key);
String infoLines[] = info.split("\\r?\\n");
for (String infoLine: infoLines) {