Skip to content

Commit

Permalink
Removed some unnecessary bits and added an else statement to the load…
Browse files Browse the repository at this point in the history
… method in Pet.java
  • Loading branch information
dmccoystephenson committed Mar 11, 2022
1 parent 303e6c8 commit a9ea758
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
33 changes: 3 additions & 30 deletions src/main/java/dansplugins/wildpets/objects/Pet.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import dansplugins.wildpets.WildPets;
import dansplugins.wildpets.data.PersistentData;
import dansplugins.wildpets.services.LocalConfigService;
import dansplugins.wildpets.utils.Scheduler;
import preponderous.ponder.minecraft.bukkit.tools.UUIDChecker;
import preponderous.ponder.misc.abs.Lockable;
import preponderous.ponder.misc.abs.Savable;
Expand Down Expand Up @@ -39,11 +38,6 @@ public class Pet extends AbstractFamilialEntity implements Lockable<UUID>, Savab
private boolean locked = false;
private HashSet<UUID> accessList = new HashSet<>();

// ephemeral
private int schedulerTaskID = -1;
private int scheduleAttempts = 0;
private int teleportTaskID = -1;

public Pet(Entity entity, UUID playerOwner) {
UUIDChecker uuidChecker = new UUIDChecker();
uniqueID = entity.getUniqueId();
Expand Down Expand Up @@ -163,30 +157,6 @@ public String getMovementState() {
return movementState;
}

public int getSchedulerTaskID() {
return schedulerTaskID;
}

public void setSchedulerTaskID(int schedulerTaskID) {
this.schedulerTaskID = schedulerTaskID;
}

public int getScheduleAttempts() {
return scheduleAttempts;
}

public void incrementScheduleAttempts() {
this.scheduleAttempts++;
}

public int getTeleportTaskID() {
return teleportTaskID;
}

public void setTeleportTaskID(int teleportTaskID) {
this.teleportTaskID = teleportTaskID;
}

private void setLastKnownLocation(Location location) {
lastKnownX = (int) location.getX();
lastKnownY = (int) location.getY();
Expand Down Expand Up @@ -338,6 +308,9 @@ public void load(Map<String, String> data) {
else if (state.equalsIgnoreCase("Following")) {
setFollowing();
}
else {
setWandering();
}

locked = Boolean.parseBoolean(data.getOrDefault("locked", "false"));
accessList = gson.fromJson(data.getOrDefault("accessList", "[]"), hashsetTypeUUID);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/dansplugins/wildpets/objects/PetList.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public void sendListOfPetsToPlayer(Player player) {
for (Pet pet : getPets()) {
Entity entity = Bukkit.getEntity(pet.getUniqueID());

ChatColor color;
if (entity != null) {
player.sendMessage(ChatColor.AQUA + pet.getName());
}
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/dansplugins/wildpets/utils/Scheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

import dansplugins.wildpets.WildPets;
import dansplugins.wildpets.data.EphemeralData;
import dansplugins.wildpets.objects.Pet;
import dansplugins.wildpets.services.LocalConfigService;
import dansplugins.wildpets.services.LocalStorageService;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;

/**
Expand Down

0 comments on commit a9ea758

Please sign in to comment.