Added a tooltip that displays when breaking unbreakable blocks in village houses

This commit is contained in:
Ellpeck 2017-01-30 21:13:44 +01:00
parent 1b27148792
commit 23299bffc7
2 changed files with 12 additions and 0 deletions

View file

@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
@ -32,6 +33,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidActionResult; import net.minecraftforge.fluids.FluidActionResult;
@ -224,6 +228,13 @@ public abstract class BlockContainerBase extends BlockContainer implements ItemB
@Override @Override
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player){ public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player){
if(!player.capabilities.isCreativeMode){ if(!player.capabilities.isCreativeMode){
TileEntity tile = world.getTileEntity(pos);
if(tile instanceof TileEntityBase){
if(((TileEntityBase)tile).stopFromDropping){
player.sendMessage(new TextComponentTranslation("info."+ModUtil.MOD_ID+".machineBroke").setStyle(new Style().setColor(TextFormatting.RED)));
}
}
this.dropBlockAsItem(world, pos, state, 0); this.dropBlockAsItem(world, pos, state, 0);
//dirty workaround because of Forge calling Item.onBlockStartBreak() twice //dirty workaround because of Forge calling Item.onBlockStartBreak() twice
world.setBlockToAir(pos); world.setBlockToAir(pos);

View file

@ -604,6 +604,7 @@ info.actuallyadditions.booklet.edition=Edition
info.actuallyadditions.deathRecorded=Your death has been recorded. Use a Death Tracker to find the death location! info.actuallyadditions.deathRecorded=Your death has been recorded. Use a Death Tracker to find the death location!
info.actuallyadditions.placer.sides.1=Placement Sides info.actuallyadditions.placer.sides.1=Placement Sides
info.actuallyadditions.placer.sides.2=Usually when placing down blocks, they are placed towards the side of another block that you are looking at. Because the Phantom Placer can place blocks in mid-air, it doesn't know that. Usually you should just set it to a solid side. info.actuallyadditions.placer.sides.2=Usually when placing down blocks, they are placed towards the side of another block that you are looking at. Because the Phantom Placer can place blocks in mid-air, it doesn't know that. Usually you should just set it to a solid side.
info.actuallyadditions.machineBroke=The block shattered as you tried to break it. Maybe it wasn't sturdy enough to be broken?
#Container Names #Container Names
container.actuallyadditions.inputter.name=ESD container.actuallyadditions.inputter.name=ESD