KCee wrote...
im not really sure what you mean by stacktrace but this is what it says:
public boolean isGrabbed() {
final VehicleWorld world = (VehicleWorld)getWorld();
if (world == null) {
return false;
}
return world.isGrabbed(this);
}
KCee wrote...
java.lang.ClassCastException: class GoodWitch cannot be cast to class Villager (GoodWitch and Villager are in unnamed module of loader java.net.URLClassLoader @786b6cc9)
at PoisonCloud.act(PoisonCloud.java:29)
at greenfoot.core.Simulation.actActor(Simulation.java:567)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:530)
at greenfoot.core.Simulation.runContent(Simulation.java:193)
at greenfoot.core.Simulation.run(Simulation.java:183)
if (touched instanceof Villager && ((Villager)touched).isGrabbed()) {
continue;
}
for (Object obj : getIntersectingObjects(Villager.class)) {
Villager villager = (Villager)obj;
if ( ! villager.isGrabbed()) {
getWorld().removeObject(villager);
break;
}
}
