Fix location missing bug... and bats

This commit is contained in:
fullwall 2012-10-30 08:59:52 +08:00
parent cb578bd677
commit c519cde217
4 changed files with 8 additions and 5 deletions

View File

@ -112,6 +112,7 @@ public class CitizensBatNPC extends CitizensMobNPC {
@Override
public void j_() {
super.j_();
if (npc != null)
npc.update();
}
}

View File

@ -143,7 +143,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
if (inLiquid) {
motY += 0.04;
} else //(handled elsewhere)*/
if (onGround && bW == 0) {
if (onGround && Math.abs(bW) < EPSILON) {
bf(); // jump
bW = 10;
}

View File

@ -16,6 +16,7 @@ import net.minecraft.server.EntityPlayer;
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -102,9 +103,10 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
}
public boolean mount(Player toMount) {
if (npc.getBukkitEntity().getPassenger() != null)
Entity passenger = npc.getBukkitEntity().getPassenger();
if (passenger != null && passenger != toMount)
return false;
((CraftPlayer) toMount).getHandle().setPassengerOf(getHandle());
enterOrLeaveVehicle(toMount);
return true;
}

View File

@ -6,7 +6,7 @@ import net.citizensnpcs.api.trait.Trait;
import org.bukkit.Location;
public class CurrentLocation extends Trait {
@Persist(required = true)
@Persist(value = "", required = true)
private Location loc;
public CurrentLocation() {