/
ThrowableBrick.java
33 lines (26 loc) 路 971 Bytes
/
ThrowableBrick.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.caved_in.commons.debug.gadget;
import com.caved_in.commons.effect.Effects;
import com.caved_in.commons.game.gadget.Gadgets;
import com.caved_in.commons.game.item.ThrowableItem;
import com.caved_in.commons.item.ItemBuilder;
import org.bukkit.Material;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
public class ThrowableBrick extends ThrowableItem {
private static ThrowableBrick instance = null;
public static ThrowableBrick getInstance() {
if (instance == null) {
instance = new ThrowableBrick();
Gadgets.registerGadget(instance);
}
return instance;
}
public ThrowableBrick() {
super(ItemBuilder.of(Material.BRICK).lore("&eYou'll bash your eye out!"));
properties().delay(2).action(Action.DELAY);
}
@Override
public void handle(Player holder, Item thrownItem) {
Effects.explode(thrownItem.getLocation(), 1.0f, false, false);
}
}