These are some bug fixes for EasyRSC/RSCDaemon/NOOBScape.
Let's get started!
java.lang.ExceptionInInitializerError
Simply find the class listed after:
Code:
Cannot construct *CLASSNAME HERE* as it does not have a default no-args constructor
Then add a constructor to the class. For example, for the class InvItem:
BEFORE:
Code:
package org.rscdaemon.server.model;
import org.rscdaemon.server.entityhandling.EntityHandler;
import org.rscdaemon.server.entityhandling.defs.ItemDef;
import org.rscdaemon.server.entityhandling.defs.extras.*;
public class InvItem extends Entity implements Comparable<InvItem> {
private int amount;
private boolean wielded = false;
public InvItem(int id) {
setID(id);
setAmount(1);
}
public InvItem(int id, int amount) {
setID(id);
setAmount(amount);
}
public ItemSmeltingDef getSmeltingDef() {
return EntityHandler.getItemSmeltingDef(id);
}
public ItemCookingDef getCookingDef() {
return EntityHandler.getItemCookingDef(id);
}
public ItemUnIdentHerbDef getUnIdentHerbDef() {
return EntityHandler.getItemUnIdentHerbDef(id);
}
public ItemWieldableDef getWieldableDef() {
return EntityHandler.getItemWieldableDef(id);
}
public ItemDef getDef() {
return EntityHandler.getItemDef(id);
}
public boolean isWieldable() {
return EntityHandler.getItemWieldableDef(id) != null;
}
public boolean isEdible() {
return EntityHandler.getItemEdibleHeals(id) > 0;
}
public boolean isWielded() {
return wielded;
}
public void setWield(boolean wielded) {
this.wielded = wielded;
}
public void setAmount(int amount) {
if(amount < 0) {
amount = 0;
}
this.amount = amount;
}
public int getAmount() {
return amount;
}
public boolean wieldingAffectsItem(InvItem i) {
if(!i.isWieldable() || !isWieldable()) {
return false;
}
for(int affected : getWieldableDef().getAffectedTypes()) {
if(i.getWieldableDef().getType() == affected) {
return true;
}
}
return false;
}
public int eatingHeals() {
if(!isEdible()) {
return 0;
}
return EntityHandler.getItemEdibleHeals(id);
}
public boolean equals(Object o) {
if (o instanceof InvItem) {
InvItem item = (InvItem)o;
return item.getID() == getID();
}
return false;
}
public int compareTo(InvItem item) {
if(item.getDef().isStackable()) {
return -1;
}
if(getDef().isStackable()) {
return 1;
}
return item.getDef().getBasePrice() - getDef().getBasePrice();
}
}
AFTER:
Code:
package org.rscdaemon.server.model;
import org.rscdaemon.server.entityhandling.EntityHandler;
import org.rscdaemon.server.entityhandling.defs.ItemDef;
import org.rscdaemon.server.entityhandling.defs.extras.*;
public class InvItem extends Entity implements Comparable<InvItem> {
private int amount;
private boolean wielded = false;
public InvItem() {}
public InvItem(int id) {
setID(id);
setAmount(1);
}
public InvItem(int id, int amount) {
setID(id);
setAmount(amount);
}
public ItemSmeltingDef getSmeltingDef() {
return EntityHandler.getItemSmeltingDef(id);
}
public ItemCookingDef getCookingDef() {
return EntityHandler.getItemCookingDef(id);
}
public ItemUnIdentHerbDef getUnIdentHerbDef() {
return EntityHandler.getItemUnIdentHerbDef(id);
}
public ItemWieldableDef getWieldableDef() {
return EntityHandler.getItemWieldableDef(id);
}
public ItemDef getDef() {
return EntityHandler.getItemDef(id);
}
public boolean isWieldable() {
return EntityHandler.getItemWieldableDef(id) != null;
}
public boolean isEdible() {
return EntityHandler.getItemEdibleHeals(id) > 0;
}
public boolean isWielded() {
return wielded;
}
public void setWield(boolean wielded) {
this.wielded = wielded;
}
public void setAmount(int amount) {
if(amount < 0) {
amount = 0;
}
this.amount = amount;
}
public int getAmount() {
return amount;
}
public boolean wieldingAffectsItem(InvItem i) {
if(!i.isWieldable() || !isWieldable()) {
return false;
}
for(int affected : getWieldableDef().getAffectedTypes()) {
if(i.getWieldableDef().getType() == affected) {
return true;
}
}
return false;
}
public int eatingHeals() {
if(!isEdible()) {
return 0;
}
return EntityHandler.getItemEdibleHeals(id);
}
public boolean equals(Object o) {
if (o instanceof InvItem) {
InvItem item = (InvItem)o;
return item.getID() == getID();
}
return false;
}
public int compareTo(InvItem item) {
if(item.getDef().isStackable()) {
return -1;
}
if(getDef().isStackable()) {
return 1;
}
return item.getDef().getBasePrice() - getDef().getBasePrice();
}
}
Repeat this for all errors you get, replacing the name after "public" with the classname.
javac error
You will simply need to open up your source files and find build.xml. Open it up in notepad and find:
Code:
<javac srcdir="${src}" destdir="${build}" debug="on" target="1.5">
And change 1.5 to your JDK version.
Ant Error
http://www.rune-server.org/runescape...ant-issue.html
ERROR: The process "java.exe" not found
Simply open up your compile.bat and remove the following code:
Code:
taskkill /F /IM java.exe
NOTE: This does not actually affect your server and it is probably a better idea to leave this in the file, as it closes any current connections to prevent errors.
MISCELLANEOUS
Replace the red
Code:
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
with your Java JDK path.
Please post some more errors here and I'll try to fix them, all I ask in return is some rep