I am trying to make my file ClickingButtons.java to work, but I am getting an error that it cant find the symbols playerHasItem & freeSlots. Now I tried importing my ItemAssistant.java file, which has the public ints playerHasItem & freeSlots, but after saving and compiling it is still giving me the same errors! :(
This is my import statement in ClickingButtons.java:
import server.model.items.ItemAssistant;
And these are the public ints in my ItemAssistant:
public int freeSlots()
{
int freeS = 0;
for (int i=0; i < c.playerItems.length; i++){
if (c.playerItems[i] <= 0){
freeS++;
}
}
return freeS;
}
public boolean playerHasItem(int itemID, int amt, int slot) {
itemID++;
int found = 0;
if (c.playerItems[slot] == (itemID)) {
for (int i = 0; i < c.playerItems.length; i++) {
if (c.playerItems[i] == itemID) {
if(c.playerItemsN[i] >= amt) {
return true;
} else {
found++;
}
}
}
if(found >= amt) {
return true;
}
return false;
}
return false;
}
public boolean playerHasItem(int itemID, int amt) {
itemID++;
int found = 0;
for (int i = 0; i < c.playerItems.length; i++) {
if (c.playerItems[i] == itemID) {
if(c.playerItemsN[i] >= amt){
return true;
} else{
found++;
}
}
}
if(found >= amt) {
return true;
}
return false;
}
The code that calls fo these ints:
if (c.dialogueAction == 717)
{
if (freeSlots() > 0)
{
if (c.tempRune == 1)//air
{
if (c.omniQuest == 2)
{
if (c.getItems().playerHasItems(995,10000) && c.getItems().playerHasItems(556,10))
{
c.getItems().deleteItems(995,10000);
c.getItems().deleteItems(556,10);
c.getItems().addItems(13599, 1);
c.getDH().sendDialogues(749,57);
} else
if (!c.getItems().playerHasItems(995,10000))
{
c.getDH().sendDialogues(750, 57);
} else
if (!c.getItems().playerHasItems(556,10))
{
c.getDH().sendDialogues(751, 57);
}
} else
if (c.getItems().playerHasItems(995,20000) && c.getItems().playerHasItems(556,20))
{
c.getItems().deleteItems(995,20000);
c.getItems().deleteItems(556,20);
c.getItems().addItems(13599, 1);
c.getDH().sendDialogues(749,57);
} else
if (!c.getItems().playerHasItems(995,20000))
{
c.getDH().sendDialogues(750, 57);
} else
if (!c.getItems().playerHasItems(556,20))
{
c.getDH().sendDialogues(751, 57);
}
} else
if (c.tempRune == 6)//body
{
if (c.omniQuest == 2)
{
if (c.getItems().playerHasItems(995,10000) && c.getItems().playerHasItems(559,10))
{
c.getItems().deleteItems(995,10000);
c.getItems().deleteItems(559,10);
c.getItems().addItems(13604, 1);
c.getDH().sendDialogues(749,57);
} else
if (!c.getItems().playerHasItems(995,10000))
{
c.getDH().sendDialogues(750, 57);
} else
if (!c.getItems().playerHasItems(559,1开发者_开发百科0))
{
c.getDH().sendDialogues(751, 57);
}
} else
if (c.getItems().playerHasItems(995,20000) && c.getItems().playerHasItems(559,20))
{
c.getItems().deleteItems(995,20000);
c.getItems().deleteItems(559,20);
c.getItems().addItems(13604, 1);
c.getDH().sendDialogues(749,57);
} else
if (!c.getItems().playerHasItems(995,20000))
{
c.getDH().sendDialogues(750, 57);
} else
if (!c.getItems().playerHasItems(559,20))
{
c.getDH().sendDialogues(751, 57);
}
} else
if (c.tempRune == 13)//astral
{
if (c.omniQuest == 2)
{
if (c.getItems().playerHasItems(995,10000) && c.getItems().playerHasItems(9075,10))
{
c.getItems().deleteItems(995,10000);
c.getItems().deleteItems(9075,10);
c.getItems().addItems(13611, 1);
c.getDH().sendDialogues(749,57);
} else
if (!c.getItems().playerHasItems(995,10000))
{
c.getDH().sendDialogues(750, 57);
} else
if (!c.getItems().playerHasItems(9075,10))
{
c.getDH().sendDialogues(751, 57);
}
} else
if (c.getItems().playerHasItems(995,20000) && c.getItems().playerHasItems(9075,20))
{
c.getItems().deleteItems(995,20000);
c.getItems().deleteItems(9075,20);
c.getItems().addItems(13611, 1);
c.getDH().sendDialogues(749,57);
} else
if (!c.getItems().playerHasItems(995,20000))
{
c.getDH().sendDialogues(750, 57);
} else
if (!c.getItems().playerHasItems(9075,20))
{
c.getDH().sendDialogues(751, 57);
}
}
} else
{
c.getDH().sendDialogues(752, 57);
c.tempRune = 0;
}
}
Also, the import directory is correct.
Why oh why is it not working?
Your declaration describes method with three int
parameters:
playerHasItem(int itemID, int amt, int slot)
yet you are calling it with two:
playerHasItems(995,20000)
There is simply no method with two parameters declared.
精彩评论