Skip to content

Commit

Permalink
Add a description to the Reflectors #8
Browse files Browse the repository at this point in the history
  • Loading branch information
cech12 committed Jan 20, 2021
1 parent 56fcee2 commit 85f9f55
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/main/java/cech12/solarcooker/block/ReflectorBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.HorizontalBlock;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemStack;
import net.minecraft.state.StateContainer;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.IBlockReader;
import net.minecraftforge.common.ToolType;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;

public class ReflectorBlock extends HorizontalBlock {

Expand All @@ -30,6 +37,12 @@ public boolean isToolEffective(BlockState state, ToolType tool) {
return tool == ToolType.AXE;
}

@Override
public void addInformation(@Nonnull ItemStack stack, @Nullable IBlockReader worldIn, @Nonnull List<ITextComponent> tooltip, @Nonnull ITooltipFlag flagIn) {
super.addInformation(stack, worldIn, tooltip, flagIn);
tooltip.add(new TranslationTextComponent("item.solarcooker.reflector.description").func_240701_a_(TextFormatting.BLUE));
}

@Override
@Nonnull
public VoxelShape getShape(@Nonnull BlockState state, @Nonnull IBlockReader worldIn, @Nonnull BlockPos pos, @Nonnull ISelectionContext context) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/assets/solarcooker/lang/de_de.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"block.solarcooker.solar_cooker": "Solarkocher",
"block.solarcooker.reflector": "Reflektor"
"block.solarcooker.reflector": "Reflektor",

"item.solarcooker.reflector.description": "Links und rechts neben einem Solarkocher können bis zu vier Reflektoren platziert werden, um den Lichteinfall zu verbessern und die Kochzeit zu reduzieren."
}
4 changes: 3 additions & 1 deletion src/main/resources/assets/solarcooker/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"block.solarcooker.solar_cooker": "Solar Cooker",
"block.solarcooker.reflector": "Reflector"
"block.solarcooker.reflector": "Reflector",

"item.solarcooker.reflector.description": "Up to four Reflectors can be placed to the left and right side of a Solar Cooker to improve the incidence of light and reduce cooking time."
}

0 comments on commit 85f9f55

Please sign in to comment.