Skip to content

Commit

Permalink
Fix horse mounted navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed May 29, 2021
1 parent 22fd1da commit 85c1f8f
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 46 deletions.
3 changes: 2 additions & 1 deletion main/src/main/java/net/citizensnpcs/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ public Settings(File folder) {
for (Setting setting : Setting.values()) {
if (!root.keyExists(setting.path)) {
setting.setAtKey(root);
} else
} else {
setting.loadFromKey(root);
}
}
updateMessagingSettings();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public boolean update() {
Location currLoc = npc.getEntity().getLocation(NPC_LOCATION);
Vector destVector = new Vector(vector.getX() + 0.5, vector.getY(), vector.getZ() + 0.5);
/* Proper door movement - gets stuck on corners at times
Block block = currLoc.getWorld().getBlockAt(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ());
if (MinecraftBlockExaminer.isDoor(block.getType())) {
Door door = (Door) block.getState().getData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,6 @@ public void checkDespawn() {
}
}

@Override
public boolean cj() {
if (npc != null && riding) {
return true;
}
return super.cj();
}

@Override
public void collide(net.minecraft.server.v1_16_R3.Entity entity) {
// this method is called by both the entities involved - cancelling
Expand All @@ -121,6 +113,14 @@ public void collide(net.minecraft.server.v1_16_R3.Entity entity) {
}
}

@Override
public boolean cs() { // horse boolean
if (npc != null && riding) {
return true;
}
return super.cs();
}

@Override
public boolean d(NBTTagCompound save) {
return npc == null ? super.d(save) : false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ public void checkDespawn() {
}
}

@Override
public boolean cj() {
if (npc != null && riding) {
return true;
}
return super.cj();
}

@Override
public void collide(net.minecraft.server.v1_16_R3.Entity entity) {
// this method is called by both the entities involved - cancelling
Expand All @@ -120,6 +112,14 @@ public void collide(net.minecraft.server.v1_16_R3.Entity entity) {
}
}

@Override
public boolean cs() {
if (npc != null && riding) {
return true;
}
return super.cs();
}

@Override
public boolean d(NBTTagCompound save) {
return npc == null ? super.d(save) : false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ public void checkDespawn() {
}
}

@Override
public boolean cj() {
if (npc != null && riding) {
return true;
}
return super.cj();
}

@Override
public void collide(net.minecraft.server.v1_16_R3.Entity entity) {
// this method is called by both the entities involved - cancelling
Expand All @@ -120,6 +112,14 @@ public void collide(net.minecraft.server.v1_16_R3.Entity entity) {
}
}

@Override
public boolean cs() {
if (npc != null && riding) {
return true;
}
return super.cs();
}

@Override
public boolean d(NBTTagCompound save) {
return npc == null ? super.d(save) : false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,6 @@ public void checkDespawn() {
}
}

@Override
public boolean cj() {
if (npc != null && riding) {
return true;
}
return super.cj();
}

@Override
public void collide(net.minecraft.server.v1_16_R3.Entity entity) {
// this method is called by both the entities involved - cancelling
Expand All @@ -121,6 +113,14 @@ public void collide(net.minecraft.server.v1_16_R3.Entity entity) {
}
}

@Override
public boolean cs() {
if (npc != null && riding) {
return true;
}
return super.cs();
}

@Override
public boolean d(NBTTagCompound save) {
return npc == null ? super.d(save) : false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,6 @@ public void checkDespawn() {
}
}

@Override
public boolean cj() {
if (npc != null && riding) {
return true;
}
return super.cj();
}

@Override
public void collide(net.minecraft.server.v1_16_R3.Entity entity) {
// this method is called by both the entities involved - cancelling
Expand All @@ -121,6 +113,14 @@ public void collide(net.minecraft.server.v1_16_R3.Entity entity) {
}
}

@Override
public boolean cs() {
if (npc != null && riding) {
return true;
}
return super.cs();
}

@Override
public boolean d(NBTTagCompound save) {
return npc == null ? super.d(save) : false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ protected Entity createEntity(final Location at, final NPC npc) {
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;

UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // clear version
long msb = uuid.getMostSignificantBits();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,8 @@ public void attack(LivingEntity attacker, LivingEntity btarget) {
EntityLiving handle = getHandle(attacker);
EntityLiving target = getHandle(btarget);
if (handle instanceof EntityPlayer) {
EntityPlayer humanHandle = (EntityPlayer) handle;
humanHandle.attack(target);
PlayerAnimation.ARM_SWING.play(humanHandle.getBukkitEntity());
((EntityPlayer) handle).attack(target);
PlayerAnimation.ARM_SWING.play((Player) handle.getBukkitEntity());
return;
}
if (handle instanceof EntityInsentient) {
Expand Down

0 comments on commit 85c1f8f

Please sign in to comment.