Skip to content

Commit cefc0f5

Browse files
committed
プレイヤーを倒したら金リンゴが1個もらえるように
1 parent c9b6f1b commit cefc0f5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/main/java/com/github/elic0de/thejpspit/game/Game.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public void death(PitPlayer player) {
4040
player.increaseDeaths();
4141
killer.increaseKills();
4242
killer.increaseXP();
43+
killer.addReward();
4344

4445
pit.getRatingHelper().initRating(player);
4546
pit.getRatingHelper().initRating(killer);

src/main/java/com/github/elic0de/thejpspit/player/PitPlayer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ public void addItem() {
6969
player.updateInventory();
7070
}
7171

72+
public void addReward() {
73+
final PlayerInventory inventory = player.getInventory();
74+
75+
inventory.addItem(new ItemStack(Material.GOLDEN_APPLE));
76+
player.updateInventory();
77+
}
78+
7279
public void showHealth(PitPlayer targetPit) {
7380
ShowHealth.showHealth(this, targetPit);
7481
}

0 commit comments

Comments
 (0)