Skip to content

Commit

Permalink
Fixed /hunger on servers (FoodStats.setFoodLevel is client-only)
Browse files Browse the repository at this point in the history
  • Loading branch information
squeek502 committed Sep 21, 2014
1 parent 743b56a commit 055d6dd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;

import squeek.applecore.api.AppleCoreAPI;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.WrongUsageException;
Expand Down Expand Up @@ -33,7 +34,7 @@ public void processCommand(ICommandSender icommandsender, String[] astring)
{
EntityPlayerMP entityplayermp = astring.length >= 2 ? getPlayer(icommandsender, astring[0]) : getCommandSenderAsPlayer(icommandsender);
int foodValue = astring.length >= 2 ? parseIntBounded(icommandsender, astring[1], 0, 20) : parseIntBounded(icommandsender, astring[0], 0, 20);
entityplayermp.getFoodStats().setFoodLevel(foodValue);
AppleCoreAPI.mutator.setHunger(entityplayermp, foodValue);
func_152374_a(icommandsender, this, 1, "Set " + entityplayermp.getDisplayName() + "'s hunger to " + foodValue);
}
else
Expand Down

0 comments on commit 055d6dd

Please sign in to comment.