Translation for Fusion Coil tooltip
This commit is contained in:
parent
6f21bc9fd5
commit
aa7caec935
2 changed files with 20 additions and 18 deletions
|
@ -36,18 +36,19 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.api.ToolManager;
|
||||
import techreborn.init.ModSounds;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockFusionCoil extends Block {
|
||||
|
@ -56,34 +57,34 @@ public class BlockFusionCoil extends Block {
|
|||
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).sounds(BlockSoundGroup.METAL));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public ActionResult onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn,
|
||||
Hand hand, BlockHitResult hitResult) {
|
||||
|
||||
ItemStack tool = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||
if (!tool.isEmpty() && ToolManager.INSTANCE.canHandleTool(tool)) {
|
||||
if (ToolManager.INSTANCE.handleTool(tool, pos, worldIn, playerIn, hitResult.getSide(), false)) {
|
||||
if (playerIn.isSneaking()) {
|
||||
ItemStack drop = new ItemStack(this);
|
||||
dropStack(worldIn, pos, drop);
|
||||
worldIn.playSound(null, playerIn.getX(), playerIn.getY(), playerIn.getZ(), ModSounds.BLOCK_DISMANTLE,
|
||||
SoundCategory.BLOCKS, 0.6F, 1F);
|
||||
if (!worldIn.isClient) {
|
||||
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
if (tool.isEmpty()) return ActionResult.PASS;
|
||||
if (!ToolManager.INSTANCE.canHandleTool(tool)) return ActionResult.PASS;
|
||||
|
||||
if (ToolManager.INSTANCE.handleTool(tool, pos, worldIn, playerIn, hitResult.getSide(), false)) {
|
||||
if (!playerIn.isSneaking()) return ActionResult.PASS;
|
||||
ItemStack drop = new ItemStack(this);
|
||||
dropStack(worldIn, pos, drop);
|
||||
worldIn.playSound(null, playerIn.getX(), playerIn.getY(), playerIn.getZ(), ModSounds.BLOCK_DISMANTLE,
|
||||
SoundCategory.BLOCKS, 0.6F, 1F);
|
||||
if (!worldIn.isClient) {
|
||||
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, @Nullable BlockView worldIn, List<Text> tooltip,
|
||||
TooltipContext flagIn) {
|
||||
public void appendTooltip(ItemStack stack, @Nullable BlockView worldIn, List<Text> tooltip, TooltipContext flagIn) {
|
||||
super.appendTooltip(stack, worldIn, tooltip, flagIn);
|
||||
// TODO: Translate
|
||||
tooltip.add(new LiteralText("Right click Fusion Control computer to auto place"));
|
||||
tooltip.add(new TranslatableText("techreborn.tooltip.fusion_coil").formatted(Formatting.BLUE));
|
||||
}
|
||||
}
|
|
@ -835,6 +835,7 @@
|
|||
"techreborn.tooltip.more_info": "Hold Shift for more info",
|
||||
"techreborn.tooltip.stack_info": "Hold Shift for stack info",
|
||||
"techreborn.tooltip.omnitool_motto" : "Swiss Army Knife",
|
||||
"techreborn.tooltip.fusion_coil" : "Right click Fusion Control computer to auto place",
|
||||
|
||||
"_comment23": "ManualUI",
|
||||
"techreborn.manual.wiki": "Online wiki",
|
||||
|
|
Loading…
Add table
Reference in a new issue