Block fixes
This commit is contained in:
parent
252a4559f0
commit
10c6829482
31 changed files with 638 additions and 561 deletions
|
@ -1,5 +1,24 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.altar.IAltarManipulator;
|
||||
|
@ -11,21 +30,8 @@ import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
|||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileAltar;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import com.google.common.base.Strings;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
public class BlockAltar extends BlockContainer implements IVariantProvider
|
||||
{
|
||||
|
@ -42,13 +48,13 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride()
|
||||
public boolean hasComparatorInputOverride(IBlockState state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, BlockPos pos)
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos)
|
||||
{
|
||||
if (world.isRemote)
|
||||
return 0;
|
||||
|
@ -89,13 +95,13 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -107,9 +113,9 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -119,20 +125,20 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TileAltar altar = (TileAltar) world.getTileEntity(pos);
|
||||
|
||||
if (altar == null || player.isSneaking())
|
||||
return false;
|
||||
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
ItemStack playerItem = player.inventory.getCurrentItem();
|
||||
|
||||
if (playerItem != null)
|
||||
{
|
||||
if (playerItem.getItem() instanceof IAltarReader || playerItem.getItem() instanceof IAltarManipulator)
|
||||
{
|
||||
playerItem.getItem().onItemRightClick(playerItem, world, player);
|
||||
playerItem.getItem().onItemRightClick(playerItem, world, player, hand);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +148,7 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
|
|||
else
|
||||
altar.setActive();
|
||||
|
||||
world.markBlockForUpdate(pos);
|
||||
world.notifyBlockUpdate(pos, state, state, 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue