Skip to content

Commit

Permalink
Fixed Teleports
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachesMLG committed Feb 23, 2024
1 parent 45ca738 commit d2e1a75
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public Messages() {
public String factionLandNotClaimed = "%prefix% &7This land has not been claimed.";
public String factionUnClaimedLand = "%prefix% &7%player% has un-claimed land at (%x%,%z%).";
public String factionUnClaimedAllLand = "%prefix% &7%player% has un-claimed all land for %faction%.";
public String factionDescriptionChanged = "%prefix% &7%player% has changed your faction description to %description%.";
public String factionNameChanged = "%prefix% &7%player% has changed your faction name to %name%.";
public String notEnoughPowerToClaim = "%prefix% &7You do not have enough power to claim this land.";
public String cannotClaimLand = "%prefix% &7You cannot claim land in this Faction.";
public String teleportNotInFactionLand = "%prefix% &7That teleport is not in your faction land.";
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.iridium.iridiumfactions.database.Faction;
import com.iridium.iridiumfactions.database.FactionClaim;
import com.iridium.iridiumfactions.database.User;
import com.iridium.iridiumfactions.utils.LocationUtils;
import com.iridium.iridiumteams.PermissionType;
import com.iridium.iridiumteams.Rank;
import com.iridium.iridiumteams.Setting;
Expand Down Expand Up @@ -469,15 +468,13 @@ public int getFactionCrystals(ItemStack itemStack) {

@Override
public boolean teleport(Player player, Location location, Faction team) {
Location safeLocation = LocationUtils.getSafeLocation(location, team);
if (safeLocation == null) {
player.sendMessage(StringUtils.color(IridiumFactions.getInstance().getMessages().noSafeLocation
if(getFactionViaLocation(location).getId() != team.getId()){
player.sendMessage(StringUtils.color(IridiumFactions.getInstance().getMessages().teleportNotInFactionLand
.replace("%prefix%", IridiumFactions.getInstance().getConfiguration().prefix)
));
return false;
}
player.setFallDistance(0.0F);
PaperLib.teleportAsync(player, safeLocation);
PaperLib.teleportAsync(player, location);
return true;
}

Expand Down
90 changes: 0 additions & 90 deletions src/main/java/com/iridium/iridiumfactions/utils/LocationUtils.java

This file was deleted.

0 comments on commit d2e1a75

Please sign in to comment.