Skip to content

Commit 6579427

Browse files
committed
LightingDeathCosmetic追加
1 parent cf7beaa commit 6579427

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

src/main/java/com/github/elic0de/thejpspit/cosmetics/CosmeticManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.github.elic0de.thejpspit.cosmetics.impl.death.BloodDeathCosmetic;
44
import com.github.elic0de.thejpspit.cosmetics.impl.death.CatCosmetic;
5+
import com.github.elic0de.thejpspit.cosmetics.impl.death.LightingDeathCosmetic;
56
import com.github.elic0de.thejpspit.cosmetics.impl.kill.BloodKillCosmetic;
67
import com.github.elic0de.thejpspit.cosmetics.impl.kill.FireCosmetic;
78
import com.github.elic0de.thejpspit.cosmetics.type.DeathCosmetic;
@@ -26,6 +27,7 @@ public CosmeticManager() {
2627
deathCosmetics = new ImmutableClassToInstanceMap.Builder<DeathCosmetic>()
2728
.put(CatCosmetic.class, new CatCosmetic())
2829
.put(BloodDeathCosmetic.class, new BloodDeathCosmetic())
30+
.put(LightingDeathCosmetic.class, new LightingDeathCosmetic())
2931
.build();
3032

3133
allCosmetics = new ImmutableClassToInstanceMap.Builder<AbstractCosmetic>()

src/main/java/com/github/elic0de/thejpspit/cosmetics/impl/death/CatCosmetic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.bukkit.Material;
88
import org.bukkit.Sound;
99

10-
@CosmeticData(id = "cat", name = "ねこねこ", description = "あいうえお", slot = 'x', icon = Material.CAT_SPAWN_EGG, coin = 50)
10+
@CosmeticData(id = "cat", name = "ねこねこ", description = "あいうえお", icon = Material.CAT_SPAWN_EGG, coin = 50)
1111
public class CatCosmetic extends Cosmetic implements DeathCosmetic {
1212

1313
@Override
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.github.elic0de.thejpspit.cosmetics.impl.death;
2+
3+
import com.github.elic0de.thejpspit.cosmetics.Cosmetic;
4+
import com.github.elic0de.thejpspit.cosmetics.CosmeticData;
5+
import com.github.elic0de.thejpspit.cosmetics.type.DeathCosmetic;
6+
import com.github.elic0de.thejpspit.player.PitPlayer;
7+
import org.bukkit.Material;
8+
9+
// todo:多分 typoみす
10+
@CosmeticData(id = "light", name = "雷", description = "うるさい", icon = Material.WATER, coin = 50)
11+
public class LightingDeathCosmetic extends Cosmetic implements DeathCosmetic {
12+
13+
@Override
14+
public void onDeath(PitPlayer player) {
15+
if (canExecute(player)) {
16+
player.getPlayer().getLocation().getWorld().strikeLightningEffect(player.getPlayer().getLocation());
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)