Skip to content

Commit

Permalink
Enable notify when Grass - > path
Browse files Browse the repository at this point in the history
  • Loading branch information
lebonq committed Aug 24, 2021
1 parent e835f12 commit 06aad38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/fr/lebon/autopath/mixin/BlockOnStepped.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class BlockOnStepped {
@Inject(method = "onSteppedOn", cancellable = true, at = @At(value = "HEAD"))
private void transformGrassToPathWhenSteppedOn(World world, BlockPos pos, BlockState state, Entity entity,CallbackInfo cir) {
if(state.isOf(Blocks.GRASS_BLOCK) && (entity instanceof LivingEntity)){ //select grass and if entity is a mob or player
world.setBlockState(pos,AutoPath.PATH_BLOCK.getDefaultState(), PathBlock.SKIP_ALL_NEIGHBOR_AND_LIGHTING_UPDATES); //On remplace par un block path
world.setBlockState(pos,AutoPath.PATH_BLOCK.getDefaultState()); // We replace by a block path and notify other
cir.cancel();
}
}
Expand Down

0 comments on commit 06aad38

Please sign in to comment.