mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
[1.14] Add support for custom nether portal frame blocks (#6417)
This commit is contained in:
1 parent
4c7f1096e5
commit
d4a3762f21
4 files changed
+83
No files matched your search
@@ -592,6 +592,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.
|
||||
*
|
||||
|
||||
@@ -514,6 +514,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.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user