Fix horse mounted navigation

This commit is contained in:
fullwall 2021-05-30 00:23:13 +08:00
parent 22fd1da0c8
commit 85c1f8f732
9 changed files with 45 additions and 46 deletions

View File

@ -24,8 +24,9 @@ public class Settings {
for (Setting setting : Setting.values()) {
if (!root.keyExists(setting.path)) {
setting.setAtKey(root);
} else
} else {
setting.loadFromKey(root);
}
}
updateMessagingSettings();

View File

@ -135,7 +135,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
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();

View File

@ -103,14 +103,6 @@ public class HorseController extends MobEntityController {
}
}
@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
@ -121,6 +113,14 @@ public class HorseController extends MobEntityController {
}
}
@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;

View File

@ -102,14 +102,6 @@ public class HorseDonkeyController extends MobEntityController {
}
}
@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
@ -120,6 +112,14 @@ public class HorseDonkeyController extends MobEntityController {
}
}
@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;

View File

@ -102,14 +102,6 @@ public class HorseMuleController extends MobEntityController {
}
}
@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
@ -120,6 +112,14 @@ public class HorseMuleController extends MobEntityController {
}
}
@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;

View File

@ -103,14 +103,6 @@ public class HorseSkeletonController extends MobEntityController {
}
}
@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
@ -121,6 +113,14 @@ public class HorseSkeletonController extends MobEntityController {
}
}
@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;

View File

@ -103,14 +103,6 @@ public class HorseZombieController extends MobEntityController {
}
}
@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
@ -121,6 +113,14 @@ public class HorseZombieController extends MobEntityController {
}
}
@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;

View File

@ -31,7 +31,6 @@ public class HumanController extends AbstractEntityController {
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();

View File

@ -327,9 +327,8 @@ public class NMSImpl implements NMSBridge {
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) {