File tree 3 files changed +2
-14
lines changed
src/main/java/ca/wescook/nutrition
3 files changed +2
-14
lines changed Original file line number Diff line number Diff line change 6
6
import net .minecraft .item .ItemBucketMilk ;
7
7
import net .minecraftforge .event .entity .player .PlayerUseItemEvent ;
8
8
9
- import ca .wescook .nutrition .Nutrition ;
10
9
import ca .wescook .nutrition .data .PlayerDataHandler ;
11
10
import ca .wescook .nutrition .effects .EffectsManager ;
12
11
import ca .wescook .nutrition .nutrients .Nutrient ;
@@ -44,7 +43,7 @@ public class EventEatFood {
44
43
45
44
@ SubscribeEvent
46
45
public void onFoodStatsChanged (FoodEvent .FoodStatsAddition event ) {
47
- if (Nutrition . proxy . isClient () ) {
46
+ if (event . player . getEntityWorld (). isRemote ) { // Client
48
47
// only run if hunger value increases, also ignoring saturation
49
48
int hungerValue = event .foodValuesToBeAdded .hunger ;
50
49
if (hungerValue <= 0 ) return ;
@@ -64,9 +63,7 @@ public void onFoodEaten(FoodEvent.FoodEaten event) {
64
63
if (!event .player .getEntityWorld ().isRemote ) { // Server
65
64
PlayerDataHandler .getForPlayer (event .player )
66
65
.add (foundNutrients , nutritionValue );
67
- }
68
-
69
- if (Nutrition .proxy .isClient ()) { // Client
66
+ } else { // Client
70
67
ClientProxy .localNutrition .add (foundNutrients , nutritionValue );
71
68
// set that food has now been eaten
72
69
ClientProxy .popHungerChange ();
Original file line number Diff line number Diff line change @@ -38,11 +38,6 @@ public void init(FMLInitializationEvent event) {
38
38
}
39
39
}
40
40
41
- @ Override
42
- public boolean isClient () {
43
- return true ;
44
- }
45
-
46
41
public static void pushHungerChange (int hungerValue ) {
47
42
hungerValues .push (hungerValue );
48
43
}
Original file line number Diff line number Diff line change @@ -18,8 +18,4 @@ public void init(FMLInitializationEvent event) {
18
18
public void postInit (FMLPostInitializationEvent event ) {
19
19
ModHelperManager .postInit ();
20
20
}
21
-
22
- public boolean isClient () {
23
- return false ;
24
- }
25
21
}
You can’t perform that action at this time.
0 commit comments