-
Notifications
You must be signed in to change notification settings - Fork 47
Implement SaplingGrowTreeEvent and BlockEvent.FarmlandTrampleEvent #146
Conversation
kitlith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the documentation nit, this LGTM.
| * SaplingGrowTreeEvent is fired when a sapling grows into a tree.<br> | ||
| * This event is fired during sapling growth in | ||
| * {@link net.minecraft.block.SaplingBlock#generate(IWorld, BlockPos, BlockState, Random)}.<br> | ||
| * <br> | ||
| * {@link #pos} contains the coordinates of the growing sapling. <br> | ||
| * {@link #rand} contains an instance of Random for use. <br> | ||
| * <br> | ||
| * This event is not cancellable.<br> | ||
| * <br> | ||
| * This event has a result.<br> | ||
| * This result determines if the sapling is allowed to grow. <br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC generally we turn Forge's use of linebreaks into proper paragraphs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kit is correct.
patchwork-events-world/src/main/java/net/minecraftforge/event/world/BlockEvent.java
Show resolved
Hide resolved
| * SaplingGrowTreeEvent is fired when a sapling grows into a tree.<br> | ||
| * This event is fired during sapling growth in | ||
| * {@link net.minecraft.block.SaplingBlock#generate(IWorld, BlockPos, BlockState, Random)}.<br> | ||
| * <br> | ||
| * {@link #pos} contains the coordinates of the growing sapling. <br> | ||
| * {@link #rand} contains an instance of Random for use. <br> | ||
| * <br> | ||
| * This event is not cancellable.<br> | ||
| * <br> | ||
| * This event has a result.<br> | ||
| * This result determines if the sapling is allowed to grow. <br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kit is correct.
| } | ||
|
|
||
| public static boolean onFarmlandTrample(World world, BlockPos pos, BlockState state, float fallDistance, Entity entity) { | ||
| //TODO: In forge, the possibility of trampling is handled by IForgeEntity.canTrample |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //TODO: In forge, the possibility of trampling is handled by IForgeEntity.canTrample | |
| // TODO: In forge, the possibility of trampling is handled by IForgeEntity.canTrample |
patchwork-events-world/src/main/java/net/minecraftforge/event/world/SaplingGrowTreeEvent.java
Show resolved
Hide resolved
|
Please resolve merge conflicts |
|
Failing checkstyle |
|
Lots and lots of merge conflicts and a failing checkstyle |
…-farmland # Conflicts: # patchwork-god-classes/src/main/java/net/minecraftforge/common/ForgeHooks.java
Fix checkstyle and merge conflicts for feature/sapling-and-farmland
TheGlitch76
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the wait, lgtm
Both of these events are required for CoFH Core. Doing them in the same PR as they're both relatively simple.