Skip to content

Commit

Permalink
修复了有概率随机传送未完成就提前结束失明效果,优化卡顿服务器的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Fand20018 committed Nov 2, 2024
1 parent d18a263 commit 9030d0a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/fandtpa/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,5 +386,4 @@ public void executePortalCommand(Player player, PortalData portalData) {
public Map<Location, PortalData> getPortalMap() {
return portalMap;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void run() {
private Location getRandomSafeLocation(Player player) {
Random random = new Random();
World world = player.getWorld();
int maxAttempts = 10;
int maxAttempts = 5;

for (int attempts = 0; attempts < maxAttempts; attempts++) {
double x = player.getLocation().getX() + random.nextInt(20001) - 10000;
Expand Down

0 comments on commit 9030d0a

Please sign in to comment.