Skip to content

Commit

Permalink
Run source format
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Feb 28, 2022
1 parent b31f1a3 commit dfb6308
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
Expand Up @@ -141,7 +141,7 @@ public boolean update() {
}
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();
Expand Down
Expand Up @@ -30,7 +30,7 @@ public Profession getProfession() {
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) {
Expand All @@ -40,6 +40,8 @@ public void load(DataKey key) throws NPCLoadException {

@Override
public void onSpawn() {
if (!npc.isSpawned())
return;
if (npc.getEntity() instanceof Villager) {
((Villager) npc.getEntity()).setProfession(profession);
} else if (npc.getEntity() instanceof ZombieVillager) {
Expand All @@ -53,15 +55,11 @@ public void save(DataKey key) {
}

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
Expand Down
Expand Up @@ -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("\\.");
Expand All @@ -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) {
}
}
}
Expand Down

0 comments on commit dfb6308

Please sign in to comment.