mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Add hooks to make it easier to add custom TNT blocks (#6290)
This commit is contained in:
1 parent
d8d70e8b35
commit
0e65f20f22
10 files changed
+269
-9
No files matched your search
@@ -923,6 +923,17 @@ public interface IForgeBlock
|
||||
return state.getFlammability(world, pos, face) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the block is flammable, this is called when it gets lit on fire.
|
||||
*
|
||||
* @param state The current state
|
||||
* @param world The current world
|
||||
* @param pos Block position in world
|
||||
* @param face The face that the fire is coming from
|
||||
* @param igniter The entity that lit the fire
|
||||
*/
|
||||
default void catchFire(BlockState state, World world, BlockPos pos, @Nullable Direction face, @Nullable LivingEntity igniter) {}
|
||||
|
||||
/**
|
||||
* Called when fire is updating on a neighbor block.
|
||||
* The higher the number returned, the faster fire will spread around this block.
|
||||
|
||||
@@ -771,6 +771,19 @@ public interface IForgeBlockState
|
||||
return getBlockState().getBlock().isFlammable(getBlockState(), world, pos, face);
|
||||
}
|
||||
|
||||
/**
|
||||
* If the block is flammable, this is called when it gets lit on fire.
|
||||
*
|
||||
* @param world The current world
|
||||
* @param pos Block position in world
|
||||
* @param face The face that the fire is coming from
|
||||
* @param igniter The entity that lit the fire
|
||||
*/
|
||||
default void catchFire(World world, BlockPos pos, @Nullable Direction face, @Nullable LivingEntity igniter)
|
||||
{
|
||||
getBlockState().getBlock().catchFire(getBlockState(), world, pos, face, igniter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when fire is updating on a neighbor block.
|
||||
* The higher the number returned, the faster fire will spread around this block.
|
||||
|
||||
Reference in new issue
Block a user