Skip to content

Commit 6d2a6ae

Browse files
committed
加点小东西
1 parent 03ab256 commit 6d2a6ae

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/main/java/top/mpt/xzystudio/flywars/game/Game.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,18 @@ public void run() {
143143
HashMap<Player, TeammateType> map = gameTeam.players;
144144
// 遍历一个team的两名玩家的数组
145145
for (Player p : Arrays.asList(p1, p2)) {
146-
// Location loc = new Location(pl.getWorld(),
147-
// (Integer) ConfigUtils.getConfig("start-x", 0),
148-
// (Integer) ConfigUtils.getConfig("start-y", 0),
149-
// (Integer) ConfigUtils.getConfig("start-z", 0));
146+
// 定义TP到的坐标
147+
Location loc;
148+
if ((Boolean)ConfigUtils.getConfig("start-tp")){
149+
loc = new Location(pl.getWorld(),
150+
(Integer) ConfigUtils.getConfig("start-x", 0),
151+
(Integer) ConfigUtils.getConfig("start-y", 0),
152+
(Integer) ConfigUtils.getConfig("start-z", 0));
153+
} else {
154+
loc = pl.getLocation();
155+
}
150156
// 将玩家TP到腐竹指定的场所
151-
p.teleport(pl.getLocation()); // tp
157+
p.teleport(loc); // tp
152158
gameTeam.ride(); // 骑
153159
// 向玩家展示信息
154160
PlayerUtils.send(p, "[FlyWars] 你是 %s, 你的队友是 <%s>", gameTeam.getTeamDisplayName() ,gameTeam.getTheOtherPlayer(p).getName());

src/main/resources/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ min-player-count: 4
88
delay-tick: 200
99

1010
# 开始游戏时,将所有玩家传送到当前世界的某一个坐标,可以设置为竞技场的坐标之类的
11+
start-tp: false
1112
start-x: 0
1213
start-y: 0
1314
start-z: 0

0 commit comments

Comments
 (0)