Last I18n replacement

This commit is contained in:
Mrbysco 2024-03-12 22:39:01 +01:00
parent b866f50e8f
commit d64b530f8d
2 changed files with 2 additions and 4 deletions

View file

@ -11,11 +11,9 @@
package de.ellpeck.actuallyadditions.mod.inventory.gui; package de.ellpeck.actuallyadditions.mod.inventory.gui;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill; import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Inventory;
@ -38,7 +36,7 @@ public class GuiDrill extends AAScreen<ContainerDrill> {
@Override @Override
public void renderLabels(@Nonnull GuiGraphics guiGraphics, int x, int y) { public void renderLabels(@Nonnull GuiGraphics guiGraphics, int x, int y) {
AssetUtil.displayNameString(guiGraphics, this.font, this.imageWidth, -10, I18n.get("container." + ActuallyAdditions.MODID + ".drill")); AssetUtil.displayNameString(guiGraphics, this.font, this.imageWidth, -10, this.title.getString());
} }
@Override @Override

View file

@ -174,7 +174,7 @@ public class DrillItem extends ItemEnergy {
@Override @Override
public InteractionResultHolder<ItemStack> use(Level world, @Nonnull Player player, @Nonnull InteractionHand hand) { public InteractionResultHolder<ItemStack> use(Level world, @Nonnull Player player, @Nonnull InteractionHand hand) {
if (!world.isClientSide && player.isShiftKeyDown() && hand == InteractionHand.MAIN_HAND) { if (!world.isClientSide && player.isShiftKeyDown() && hand == InteractionHand.MAIN_HAND) {
player.openMenu(new SimpleMenuProvider((id, inv, p) -> new ContainerDrill(id, inv), Component.literal(""))); player.openMenu(new SimpleMenuProvider((id, inv, p) -> new ContainerDrill(id, inv), Component.translatable("container." + ActuallyAdditions.MODID + ".drill")));
// player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.DRILL.ordinal(), world, (int) player.posX, (int) player.posY, (int) player.posZ); // player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.DRILL.ordinal(), world, (int) player.posX, (int) player.posY, (int) player.posZ);
} }
return new InteractionResultHolder<>(InteractionResult.PASS, player.getItemInHand(hand)); return new InteractionResultHolder<>(InteractionResult.PASS, player.getItemInHand(hand));