I'm not very good at creating things from scratch.. I managed to get this code in eclipse without any errors but it doesn't work.
I'm trying to make it so when you click on an NPC it will repair your degrading armours for a price.
Code:
package com.mpk.world.content;
import com.mpk.model.Item;
import com.mpk.world.entity.impl.player.Player;
public enum RepairArmour {
DHAROKS_HELM(4880, 4716, 5000000);
RepairArmour(int item, int NewItem, int Cost) {
this.item = item;
this.Cost = Cost;
this.item = NewItem;
}
private int item;
private int Cost;
private boolean RepairArmour;
private RepairArmour(Player c) {
c.getPacketSender().sendInterfaceRemoval();
RepairArmour = false;
if(c.getInventory().containsAny(item)) {
RepairArmour = true;
if(RepairArmour = true) {
for(Item item : c.getInventory().getValidItems()) {
c.getInventory().delete(item, 1);
c.getInventory().delete(995, Cost);
c.getInventory().add(item);
c.getInventory().refreshItems();
c.getPacketSender().sendMessage("You've repaired your armours.");
return;
}
}
}
}
}
Will Rep++, please don't flame it's my first code from scratch and I'd like to know what I did wrong.