Add support for custom nether portal frame blocks (#6389)

This commit is contained in:
Richard Freimer authored and LexManos committed 2020-01-07 14:20:37 -08:00
1 parent 0d50b4c39f
commit ca62702ff9
4 files changed
+83

No files matched your search

@@ -571,6 +571,20 @@ public interface IForgeBlock
{
return Tags.Blocks.SUPPORTS_BEACON.contains(state.getBlock());
}
/**
* Determines if this block can be used as part of a frame of a nether portal.
*
* @param state The current state
* @param world The current world
* @param pos Block position in world
* @return True, to support being part of a nether portal frame, false otherwise.
*/
default boolean isPortalFrame(BlockState state, IWorldReader world, BlockPos pos)
{
return state.getBlock() == Blocks.OBSIDIAN;
}
/**
* Gathers how much experience this block drops when broken.
*
@@ -495,6 +495,18 @@ public interface IForgeBlockState
return getBlockState().getBlock().isBeaconBase(getBlockState(), world, pos, beacon);
}
/**
* Determines if this block can be used as part of a frame of a nether portal.
*
* @param world The current world
* @param pos Block position in world
* @return True, to support being part of a nether portal frame, false otherwise.
*/
default boolean isPortalFrame(IWorldReader world, BlockPos pos)
{
return getBlockState().getBlock().isPortalFrame(getBlockState(), world, pos);
}
/**
* Gathers how much experience this block drops when broken.
*