Skip to content

Commit 80f8387

Browse files
committed
添加资源点
1 parent d18e463 commit 80f8387

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/main/java/top/mpt/xzystudio/flywars/scheduler/ResourcesUpdate.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ public void run() {
4848
int x = (Integer) its.get("x");
4949
int y = (Integer) its.get("y");
5050
int z = (Integer) its.get("z");
51+
int amount = (Integer) its.get("amount");
5152
Main.instance.getLogger().info(String.format("(%d, %d, %d)", x, y, z));
5253

5354
Location loc = new Location(gameWorld, x, y, z);
54-
ItemStack itemStack = ItemUtils.newItem(value, displayName.getOrDefault(key, key), 0, null);
55+
ItemStack itemStack = ItemUtils.newItem(value, displayName.getOrDefault(key, key), amount);
5556
gameWorld.dropItem(loc, itemStack);
5657
});
5758
});

src/main/java/top/mpt/xzystudio/flywars/utils/ItemUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,7 @@ public static ItemStack newItem(Material type, String displayName, int level, En
5555
return newItem(type, displayName, Collections.emptyList(), 64, false, 0, ench);
5656
}
5757

58-
58+
public static ItemStack newItem(Material type, String displayName, int amount){
59+
return newItem(type, displayName, Collections.emptyList(), amount, false, 0, null);
60+
}
5961
}

src/main/resources/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,31 @@ resources:
2323
- x: 0
2424
y: 0
2525
z: 0
26+
amount: 5
2627
- x: 70
2728
y: 70
2829
z: 70
30+
amount: 5
2931

3032
arrow:
3133
- x: 10
3234
y: 0
3335
z: 10
36+
amount: 5
3437
- x: 80
3538
y: 70
3639
z: 80
40+
amount: 5
3741

3842
golden_apple:
3943
- x: 20
4044
y: 0
4145
z: 20
46+
amount: 5
4247
- x: 90
4348
y: 70
4449
z: 90
50+
amount: 5
4551

4652
# 刷新资源间隔ticks
4753
refresh-tick: 20

0 commit comments

Comments
 (0)