MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / eatCake

Method eatCake

src/main/java/net/minecraft/block/BlockCake.java:86–103  ·  view source on GitHub ↗
(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)

Source from the content-addressed store, hash-verified

84 }
85
86 private void eatCake(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
87 {
88 if (player.canEat(false))
89 {
90 player.triggerAchievement(StatList.field_181724_H);
91 player.getFoodStats().addStats(2, 0.1F);
92 int i = state.getValue(BITES);
93
94 if (i < 6)
95 {
96 worldIn.setBlockState(pos, state.withProperty(BITES, i + 1), 3);
97 }
98 else
99 {
100 worldIn.setBlockToAir(pos);
101 }
102 }
103 }
104
105 public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
106 {

Callers 2

onBlockActivatedMethod · 0.95
onBlockClickedMethod · 0.95

Calls 8

canEatMethod · 0.80
triggerAchievementMethod · 0.80
addStatsMethod · 0.80
getFoodStatsMethod · 0.80
setBlockToAirMethod · 0.80
getValueMethod · 0.65
withPropertyMethod · 0.65
setBlockStateMethod · 0.45

Tested by

no test coverage detected