Implement BlockStack in Teleposer related areas
This commit is contained in:
parent
31d41d06ab
commit
c3beb48499
5 changed files with 34 additions and 30 deletions
|
@ -3,6 +3,9 @@ package WayofTime.bloodmagic.api;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
|
||||
@Getter
|
||||
|
@ -23,6 +26,12 @@ public class BlockStack
|
|||
this(block, 0);
|
||||
}
|
||||
|
||||
public static BlockStack getStackFromPos(World world, BlockPos pos)
|
||||
{
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
return new BlockStack(state.getBlock(), state.getBlock().getMetaFromState(state));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue