You now have to sneak to place the Portable Grid in the world, fixes #1274

This commit is contained in:
raoulvdberge
2017-06-05 00:36:55 +02:00
parent 744201ed30
commit 85717c7146
3 changed files with 23 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
- Fixed bug where storages that are removed remain visible (raoulvdberge)
- Fixed bug where the GUI didn't close when a block is broken, causing a dupe bug with the Portable Grid (raoulvdberge)
- Added support for External Storage on Interfaces and other Refined Storage blocks, so you can keep items in stock easier (raoulvdberge)
- You now have to sneak to place the Portable Grid in the world (raoulvdberge)
### 1.4.10
- Improved performance of network scanning (raoulvdberge)

View File

@@ -4,13 +4,18 @@ import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.RSBlocks;
import com.raoulvdberge.refinedstorage.RSGui;
import com.raoulvdberge.refinedstorage.tile.grid.portable.PortableGrid;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import java.util.List;
public class ItemBlockPortableGrid extends ItemBlockEnergyItem {
public ItemBlockPortableGrid() {
super(RSBlocks.PORTABLE_GRID, RSBlocks.PORTABLE_GRID.getDirection());
@@ -27,6 +32,22 @@ public class ItemBlockPortableGrid extends ItemBlockEnergyItem {
return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
super.addInformation(stack, player, tooltip, advanced);
tooltip.add(I18n.format("block.refinedstorage:portable_grid.tooltip"));
}
@Override
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!player.isSneaking()) {
return EnumActionResult.FAIL;
}
return super.onItemUse(player, worldIn, pos, hand, facing, hitX, hitY, hitZ);
}
@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
if (oldStack.getItem() == newStack.getItem()) {

View File

@@ -228,6 +228,7 @@ block.refinedstorage:quartz_enriched_iron_block.name=Block of Quartz Enriched Ir
block.refinedstorage:storage_monitor.name=Storage Monitor
block.refinedstorage:portable_grid.0.name=Portable Grid
block.refinedstorage:portable_grid.1.name=Creative Portable Grid
block.refinedstorage:portable_grid.tooltip=Sneak to place in the world.
item.refinedstorage:storage_disk.0.name=1k Storage Disk
item.refinedstorage:storage_disk.1.name=4k Storage Disk