Run source format

This commit is contained in:
fullwall 2022-02-28 17:01:59 +08:00
parent b31f1a351c
commit dfb63084b2
3 changed files with 10 additions and 13 deletions

View File

@ -141,7 +141,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
}
Location loc = npc.getEntity().getLocation(NPC_LOCATION);
/* 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

@ -30,7 +30,7 @@ public class VillagerProfession extends Trait {
public void load(DataKey key) throws NPCLoadException {
try {
profession = Profession.valueOf(key.getString(""));
if (profession.name().equals("NORMAL")) {
if ("NORMAL".equals(profession.name())) {
profession = Profession.FARMER;
}
} catch (IllegalArgumentException ex) {
@ -40,6 +40,8 @@ public class VillagerProfession extends Trait {
@Override
public void onSpawn() {
if (!npc.isSpawned())
return;
if (npc.getEntity() instanceof Villager) {
((Villager) npc.getEntity()).setProfession(profession);
} else if (npc.getEntity() instanceof ZombieVillager) {
@ -53,15 +55,11 @@ public class VillagerProfession extends Trait {
}
public void setProfession(Profession profession) {
if (profession.name().equals("NORMAL")) {
if ("NORMAL".equals(profession.name())) {
profession = Profession.FARMER;
}
this.profession = profession;
if (npc.getEntity() instanceof Villager) {
((Villager) npc.getEntity()).setProfession(profession);
} else if (npc.getEntity() instanceof ZombieVillager) {
((ZombieVillager) npc.getEntity()).setVillagerProfession(profession);
}
onSpawn();
}
@Override

View File

@ -19,7 +19,8 @@ public class EmptyChannel extends AbstractChannel {
static {
Map<String, Version> versionMap = Version.identify();
Version nettyVersion = versionMap.get("netty-common");
if (nettyVersion == null) nettyVersion = versionMap.get("netty-all");
if (nettyVersion == null)
nettyVersion = versionMap.get("netty-all");
if (nettyVersion != null) {
String[] split = nettyVersion.artifactVersion().split("\\.");
@ -31,10 +32,8 @@ public class EmptyChannel extends AbstractChannel {
if (major > 4 || minor > 1 || revision > 24) {
updatedNetty = true;
}
}
catch (ArrayIndexOutOfBoundsException ignored) {
}
catch (NumberFormatException ignored) {
} catch (ArrayIndexOutOfBoundsException ignored) {
} catch (NumberFormatException ignored) {
}
}
}