mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 11:05:49 +01:00
Fix rabbit movement
This commit is contained in:
parent
7d6a3f476b
commit
98b2f274fc
@ -1,5 +1,12 @@
|
|||||||
package net.citizensnpcs.npc.entity;
|
package net.citizensnpcs.npc.entity;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftRabbit;
|
||||||
|
import org.bukkit.entity.Rabbit;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.npc.CitizensNPC;
|
import net.citizensnpcs.npc.CitizensNPC;
|
||||||
@ -13,13 +20,6 @@ import net.minecraft.server.v1_8_R2.EntityRabbit;
|
|||||||
import net.minecraft.server.v1_8_R2.NBTTagCompound;
|
import net.minecraft.server.v1_8_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_8_R2.World;
|
import net.minecraft.server.v1_8_R2.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftRabbit;
|
|
||||||
import org.bukkit.entity.Rabbit;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
public class RabbitController extends MobEntityController {
|
public class RabbitController extends MobEntityController {
|
||||||
public RabbitController() {
|
public RabbitController() {
|
||||||
super(EntityRabbitNPC.class);
|
super(EntityRabbitNPC.class);
|
||||||
@ -118,9 +118,11 @@ public class RabbitController extends MobEntityController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void E() {
|
public void E() {
|
||||||
if (npc != null || !npc.isFlyable()) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
super.E();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -186,8 +188,8 @@ public class RabbitController extends MobEntityController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String z() {
|
protected String z() {
|
||||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.z() : npc.data().get(
|
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.z()
|
||||||
NPC.AMBIENT_SOUND_METADATA, super.z());
|
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.z());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user