Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
增加了猎人出生点位置范围可调
Browse files Browse the repository at this point in the history
  • Loading branch information
MossCG committed May 9, 2021
1 parent 71ed404 commit edc1e6a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.mcxk</groupId>
<artifactId>MineHunt</artifactId>
<version>2.1.2</version>
<version>2.1.3</version>
<packaging>jar</packaging>

<name>MineHunt</name>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/net/mcxk/minehunt/game/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public class Game {
private final int L2Runner = plugin.getConfig().getInt("L2Runner");
private final int L3Player = plugin.getConfig().getInt("L3Player");
private final int L3Runner = plugin.getConfig().getInt("L3Runner");
private final int XRandom = plugin.getConfig().getInt("XRandom");
private final int XBasic = plugin.getConfig().getInt("XBasic");
private final int YRandom = plugin.getConfig().getInt("YRandom");
private final int YBasic = plugin.getConfig().getInt("YBasic");
@Getter
private boolean CompassUnlocked = plugin.getConfig().getBoolean("CompassUnlocked");

Expand Down Expand Up @@ -351,7 +355,7 @@ private Location airDrop(Location spawnpoint) {
Location loc = spawnpoint.clone();
loc = new Location(loc.getWorld(), loc.getBlockX(), 0, loc.getBlockZ());
Random random = new Random();
loc.add(random.nextInt(2) + 1, 0, random.nextInt(2) + 1);
loc.add(random.nextInt(XRandom) + XBasic, 0, random.nextInt(YRandom) + YBasic);
loc = loc.getWorld().getHighestBlockAt(loc).getLocation();
loc.getBlock().setType(Material.GLASS);
loc.setY(loc.getY() + 1);
Expand Down
11 changes: 11 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ L3Runner: 4
#是否开局解锁指南针
CompassUnlocked: true

#逃亡者X轴偏移(Basic为基础偏移,Random为随机值)
#实际偏移量为(Basic+Random)
#如XBasic: 10 XRandom: 20 则实际偏移量为10+(0~20)=10~30中取一个随机数
XBasic: 5
XRandom: 10

#逃亡者Y轴偏移(Basic为基础偏移,Random为随机值)
#计算原理同上
YBasic: 5
YRandom: 10

#服务器名称(实际上也就结束统计的时候显示一下)
ServerName: "MossMC"

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: MineHunt
version: 2.1.2
version: 2.1.3
main: net.mcxk.minehunt.MineHunt
api-version: 1.16
soft-depend: [ NoteBlockAPI, AdvancedReplay ]
Expand Down

0 comments on commit edc1e6a

Please sign in to comment.