I'm using the Project-Exile Source and Client, I have been looking for an answer for a few days now. I honestly have no idea where to look. Basically my food and potions aren't working anymore, I've read that its to do with ClickItem.java or Food.java. I also found someone asking how to fix it and someone replied with a new Food.java saying that it might work, I attempted to fix my issue with that but it didn't work. I will add my ClickItem.java and my Food.java (original and the other person's). Any help would be great, I'm really really new to coding so my apologies if this is a dumb question :3

Spoiler for Original Food.java:
public class Food {

public static enum FoodToEat {
MANTA(391, 22, "Manta Ray"), SHARK(385, 20, "Shark"), LOBSTER(379, 12,
"Lobster"), TROUT(333, 7, "Trout"), SALMON(329, 9, "Salmon"), SWORDFISH(
373, 14, "Swordfish"), TUNA(361, 10, "Tuna"), MONKFISH(7946,
16, "Monkfish"), SEA_TURTLE(397, 21, "Sea Turtle"), CAKE(1891,
4, "Cake"), BASS(365, 13, "Bass"), COD(339, 7, "Cod"), POTATO(
1942, 1, "Potato"), BAKED_POTATO(6701, 4, "Baked Potato"), POTATO_WITH_CHEESE(
6705, 16, "Potato with Cheese"), EGG_POTATO(7056, 16,
"Egg Potato"), CHILLI_POTATO(7054, 14, "Chilli Potato"), MUSHROOM_POTATO(
7058, 20, "Mushroom Potato"), TUNA_POTATO(7060, 22,
"Tuna Potato"), SHRIMPS(315, 3, "Shrimps"), HERRING(347, 5,
"Herring"), SARDINE(325, 4, "Sardine"), CHOCOLATE_CAKE(1897, 5,
"Chocolate Cake"), ANCHOVIES(319, 1, "Anchovies"), PLAIN_PIZZA(
2289, 7, "Plain Pizza"), MEAT_PIZZA(2293, 8, "Meat Pizza"), ANCHOVY_PIZZA(
2297, 9, "Anchovy Pizza"), PINEAPPLE_PIZZA(2301, 11,
"Pineapple Pizza"), BREAD(2309, 5, "Bread"), APPLE_PIE(2323, 7,
"Apple Pie"), REDBERRY_PIE(2325, 5, "Redberry Pie"), MEAT_PIE(
2327, 6, "Meat Pie"), PIKE(351, 8, "Pike"), POTATO_WITH_BUTTER(
6703, 14, "Potato with Butter"), BANANA(1963, 2, "Banana"), PEACH(
6883, 8, "Peach"), ORANGE(2108, 2, "Orange"), PINEAPPLE_RINGS(
2118, 2, "Pineapple Rings"), PINEAPPLE_CHUNKS(2116, 2,
"Pineapple Chunks"), PURPLE_SWEETS(10476, 9, "Purple Sweets"), ROCKTAIL(15272, 23, "Rocktail"),
HELM_CRAB(18159, 2, "Heim crab"), RED_EYE(18161, 50, "Red-eye"),
DUSK_EEL(18163, 7, "Dusk eel"), GIAN_FLATFISH(18165, 10, "Giant flatfish"),
SHORT_FINNED_EEL(18167, 12, "Short-finned eel"), WEB_SNIPPER(18169, 15, "Web snipper"),
BOULDABASS(18171, 17, "Bouldabass"), SALVE_EEL(18173, 20, "Salve eel"),
BLUE_CRAB(18175, 22, "Blue crab"), CAVE_MORAY(18177, 25, "Cave moray");

public static FoodToEat forId(int id) {
return food.get(id);
}
private int id;
private int heal;

private String name;

public static HashMap<Integer, FoodToEat> food = new HashMap<Integer, FoodToEat>();

static {
for (FoodToEat f : FoodToEat.values())
food.put(f.getId(), f);
}

private FoodToEat(int id, int heal, String name) {
this.id = id;
this.heal = heal;
this.name = name;
}

public int getHeal() {
return heal;
}

public int getId() {
return id;
}

public String getName() {
return name;
}
}

private Player c;

public Food(Player c) {
this.c = c;
}

public void eat(int id, int slot) {
if (c.isDead || c.getVariables().constitution <= 0) {
return;
}
if (System.currentTimeMillis() - c.getVariables().foodDelay >= 1600
&& c.getVariables().constitution > 0) {
c.getVariables().attackTimer += 2;
c.startAnimation(829);
c.getItems().deleteItem(id, slot, 1);
FoodToEat f = FoodToEat.food.get(id);
if (c.getVariables().constitution < c.getVariables().calculateMaxLifePoints(c)) {
c.getVariables().constitution += f.getHeal() * 10;
if (c.getVariables().constitution > c.getVariables().calculateMaxLifePoints(c))
c.getVariables().constitution = c.getVariables().calculateMaxLifePoints(c);
}
c.getPA().refreshSkill(3);
c.sendMessage("You eat the " + f.getName() + ".");
if (id != 10476) {
c.getVariables().foodDelay = System.currentTimeMillis();
CycleEventHandler.getInstance().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
c.sendMessage("It restores some health.");
container.stop();
}

@Override
public void stop() {

}
}, 2);
} else if (f.getId() == 15272 && !c.isDead) {
boolean heal = (c.getVariables().constitution < c.getPA().getLevelForXP(c.getVariables().playerXP[3] + 10));
if (heal) {
c.getVariables().constitution += (23 + (Misc.random(10)));
}
c.getItems().deleteItem(id,slot,1);
c.startAnimation(829);
}
c.getVariables().foodDelay = System.currentTimeMillis();
}
}

public boolean isFood(int id) {
return FoodToEat.food.containsKey(id);
}
}


Spoiler for Other Food.java:
public class Food {


private Player c;

public Food (Player c) {
this.c = c;
}
public static enum FoodToEat {
ROCKTAIL(15272,24,"Rocktail"),
MANTA(391,22,"Manta Ray"),
SHARK(385,20,"Shark"),
LOBSTER(379,12,"Lobster"),
TROUT(333,7,"Trout"),
SALMON(329,9,"Salmon"),
SWORDFISH(373,14,"Swordfish"),
TUNA(361,10,"Tuna"),
MONKFISH(7946,16,"Monkfish"),
SEA_TURTLE(397,21,"Sea Turtle"),
CAKE(1891,4,"Cake"),
BASS(365,13,"Bass"),
COD(339,7,"Cod"),
POTATO(1942,1,"Potato"),
BAKED_POTATO(6701,4,"Baked Potato"),
POTATO_WITH_CHEESE(6705,16,"Potato with Cheese"),
EGG_POTATO(7056,16,"Egg Potato"),
CHILLI_POTATO(7054,14,"Chilli Potato"),
MUSHROOM_POTATO(7058,20,"Mushroom Potato"),
TUNA_POTATO(7060,22,"Tuna Potato"),
SHRIMPS(315,3,"Shrimps"),
HERRING(347,5,"Herring"),
SARDINE(325,4,"Sardine"),
CHOCOLATE_CAKE(1897,5,"Chocolate Cake"),
ANCHOVIES(319,1,"Anchovies"),
PLAIN_PIZZA(2289,7,"Plain Pizza"),
MEAT_PIZZA(2293,8,"Meat Pizza"),
ANCHOVY_PIZZA(2297,9,"Anchovy Pizza"),
PINEAPPLE_PIZZA(2301,11,"Pineapple Pizza"),
BREAD(2309,5,"Bread"),
APPLE_PIE(2323,7,"Apple Pie"),
REDBERRY_PIE(2325,5,"Redberry Pie"),
MEAT_PIE(2327,6,"Meat Pie"),
PIKE(351,8,"Pike"),
POTATO_WITH_BUTTER(6703,14,"Potato with Butter"),
BANANA(1963,2,"Banana"),
PEACH(6883,8,"Peach"),
ORANGE(2108,2,"Orange"),
PINEAPPLE_RINGS(2118,2,"Pineapple Rings"),
PINEAPPLE_CHUNKS(2116,2,"Pineapple Chunks");


private int id; private int heal; private String name;

private FoodToEat(int id, int heal, String name) {
this.id = id;
this.heal = heal;
this.name = name;
}

public int getId() {
return id;
}

public int getHeal() {
return heal;
}

public String getName() {
return name;
}
public static HashMap <Integer,FoodToEat> food = new HashMap<Integer,FoodToEat>();

public static FoodToEat forId(int id) {
return food.get(id);
}

static {
for (FoodToEat f : FoodToEat.values())
food.put(f.getId(), f);
}
}

public int quickHp(int skill) {
return (int)(c.getLevelForXP(c.playerXP[skill]));
}

public boolean hasNexArmour() {
return c.playerEquipment[c.playerHat] == 20135 || c.playerEquipment[c.playerLegs] == 20143 || c.playerEquipment[c.playerChest] == 20139 ||
c.playerEquipment[c.playerHat] == 20147 || c.playerEquipment[c.playerLegs] == 20155 || c.playerEquipment[c.playerChest] == 20151 ||
c.playerEquipment[c.playerHat] == 20159 || c.playerEquipment[c.playerLegs] == 20167 || c.playerEquipment[c.playerChest] == 20163;
}



public void eat(int id, int slot) {

int helmHeal = 0;
int plateHeal = 0;
int legsHeal = 0;



switch (c.playerEquipment[c.playerHat]) {
case 20135://torva helm
helmHeal =+ 20;
break;
case 20147://pernix cowl
helmHeal =+ 10;
break;
case 20159:// virtus mask
helmHeal =+ 10;
break;
}

switch (c.playerEquipment[c.playerChest]) {
case 20151://pernix body
plateHeal =+ 20;
break;
case 20163: // virtus robe top
plateHeal =+ 30;
break;
case 20139:// torva palte
plateHeal =+ 40;
break;
}

switch (c.playerEquipment[c.playerLegs]) {
case 20143: // torva Legs
legsHeal =+ 30;
break;
case 20155:// pernix chaps
legsHeal =+ 20;
break;
case 20167:// virtus robe bottom
legsHeal =+ 15;
break;
}

if (c.duelRule[6]) {
c.sendMessage("You may not eat in this duel.");
return;
}
if (System.currentTimeMillis() - c.foodDelay >= 1500) {
c.getCombat().resetPlayerAttack();
c.attackTimer += 2;
c.startAnimation(829);
c.getItems().deleteItem(id, slot, 1);
FoodToEat f = FoodToEat.food.get(id);
int BonusHeal = helmHeal + plateHeal + legsHeal;
int maxHp = quickHp(3) + BonusHeal;
if (c.playerLevel[3] < maxHp && hasNexArmour()) {
c.playerLevel[3] += f.getHeal();
if (c.playerLevel[3] > maxHp)
c.playerLevel[3] = maxHp;
}
else if (c.playerLevel[3] < c.getLevelForXP(c.playerXP[3]) && !hasNexArmour()) {
c.playerLevel[3] += f.getHeal();
if (c.playerLevel[3] > c.getLevelForXP(c.playerXP[3]) + maxHp)
c.playerLevel[3] = c.getLevelForXP(c.playerXP[3]);
}
c.foodDelay = System.currentTimeMillis();
c.getPA().refreshSkill(3);
c.sendMessage("You eat the " + f.getName() + ".");
}
}


public boolean isFood(int id) {
return FoodToEat.food.containsKey(id);
}
}


Spoiler for ClickItem.java:
/**
* Clicking an item, bury bone, eat food etc
**/
public class ClickItem implements PacketType {

@Override
public void processPacket(Player c, int packetType, int packetSize) {
int frame = c.getInStream().readSignedWordBigEndianA(); //use to be readSignedWordBigEndianA();
int itemSlot = c.getInStream().readSignedWordA(); //use to be readUnsignedWordA();
int itemId = c.getInStream().readSignedWordBigEndian(); //us to be unsigned.
if (itemId != c.playerItems[itemSlot] - 1) {
return;
}
if (MysteryBox.exist(c, itemId))
return;
if (Crackers.exist(c, itemId))
return;
if (Casket.exist(c, itemId))
return;
if (Casket2.exist(c, itemId))
return;
if(c.getVariables().teleTimer > 0)
return;
if(c.getVariables().resting) {
c.getPA().resetRest();
}
Following.resetFollow(c);
if(itemSlot > c.getVariables().playerItems.length) {
return;
}
if (itemId != c.getVariables().playerItems[itemSlot] - 1 || HunterHandler.layTrap(c, itemId)) {
return;
}
if(HunterLooting.giveLoot(c, itemId, false)) {
return;
}
c.getPA().resetSkills();
if(Prayer.PrayerData.getID(itemId) != null) {
Prayer.buryBone(c, itemId, itemSlot);
}
if (Herblore.isHerb(itemId)) {
HerbCleaning.handleHerbCleaning(c, itemId, itemSlot);
com.exile.game.players.content.skills.dungeoneerin g.skills.Herblore.clean(c, itemId);
ToyHorses.handleToyHorsesActions(c, itemId);
switch(frame) {
case 4233 : // make 1 ring crafting
GemCrafting.startCrafter(c, GemData.getGemSlot()[itemSlot], 1, 0);
break;
case 4239 : // make 1 neckalce crafting
GemCrafting.startCrafter(c, GemData.getGemSlot()[itemSlot], 1, 1);
break;
case 4245 : // make 1 amulet crafting
GemCrafting.startCrafter(c, GemData.getGemSlot()[itemSlot], 1, 2);
break;
}
if (itemId == 4613) {
if (!c.getVariables().spinningPlate)
SpinningPlates.spinningPlate(c, itemId, itemSlot);
}

if (itemId >= 5509 && itemId <= 5514) {
Pouches.fillEssencePouch(c, itemId);
return;
}
if (ArmourSets.isSet(itemId))
ArmourSets.handleSet(c, itemId);
if (itemId >= 5509 && itemId <= 5514) {
int pouch = -1;
int a = itemId;
if (a == 5509)
pouch = 0;
if (a == 5510)
pouch = 1;
if (a == 5512)
pouch = 2;
if (a == 5514)
pouch = 3;
c.getPA().fillPouch(pouch);
return;
}
if (itemId == 4155) { // Slayer gem
c.getDH().sendDialogues(321, 0);
}
if (c.getFood().isFood(itemId))
c.getFood().eat(itemId,itemSlot);
if (c.getPotions().isPotion(itemId))
c.getPotions().handlePotion(itemId,itemSlot);
}
switch (itemId) {
case 6:
c.getCannon().setUpCannon();
break;

case 952:
c.startAnimation(830);
if (BarrowsConstants.inMount(c))
Barrows.digMount(c);
else
c.sendMessage("Nothing interesting happens");
break;

/*case 4053:
for (int i = 0; i < NPCHandler.maxNPCs; i++)
if (NPCHandler.npcs[i] != null)
if (NPCHandler.npcs[i].npcType == 1532 || NPCHandler.npcs[i].npcType == 1533 || NPCHandler.npcs[i].npcType == 1534 || NPCHandler.npcs[i].npcType == 1535)
if (NPCHandler.npcs[i].absX == c.absX && NPCHandler.npcs[i].absY == c.absY && NPCHandler.npcs[i].heightLevel == c.heightLevel) {
c.sendMessage("You can't setup a barricade here.");
return;
}
if (c.inCwSafe()) {
c.sendMessage("You can't setup a barricade here.");
return;
}
if ((c.saraTeam() && CastleWars.saraBarricades > 9) || (c.zammyTeam() && CastleWars.zammyBarricades > 9)) {
c.sendMessage("Your team already has 10 barricades setup.");
return;
}
c.getItems().deleteItem(4053, itemSlot, 1);
if (c.saraTeam()) {
Server.npcHandler.spawnNpc(1532, c.absX, c.absY, c.heightLevel, 0, 50, 0, 0, 50);
CastleWars.saraBarricades++;
}
if (c.zammyTeam()) {
Server.npcHandler.spawnNpc(1534, c.absX, c.absY, c.heightLevel, 0, 50, 0, 0, 50);
CastleWars.zammyBarricades++;
}
break;*/
case 6199:
if(System.currentTimeMillis() - c.lastMysteryBox < 5000) {
c.sendMessage("You can only use the mystery box every 5 seconds.");
return;
}
break;
case 5070:
case 5071:
case 5072:
case 5073:
case 5074:
Woodcutting.handleNest(c, itemId);
break;

case 15098:
case 15088:
if (c.getVariables().diceTimer < 1) {
if (c.getVariables().clanId < 0) {
c.sendMessage("@red@You must be in a clan chat to use a dice.");
return;
} else {
int random = 2 + Misc.random(98);
GameEngine.clanChat.messageClan("<col=255>" + c.playerName + "</col> <col=255>has rolled a</col> <col=16711680>" + random + "</col> <col=255>using the percentile dice.</col>", c.getVariables().clanId);
c.startAnimation(11900);
c.gfx0(2075);
c.getVariables().diceTimer = 10;
}
}
break;
case 15707:
com.exile.game.players.content.skills.dungeoneerin g.Items.teleport(c, true);
break;
case 19650:
com.exile.game.players.content.skills.dungeoneerin g.Items.handleToolKit(c);
break;
}
}
}


If you need to see anything else just ask.