parent
deb8542abe
commit
bcae6883b0
|
@ -3,4 +3,9 @@ banDuration: 5 # days
|
||||||
onDeathRemove: 4.0 # 2 hearts
|
onDeathRemove: 4.0 # 2 hearts
|
||||||
headsGive: 4.0 # 2 hearts
|
headsGive: 4.0 # 2 hearts
|
||||||
lifextractorEnabled: true
|
lifextractorEnabled: true
|
||||||
startingLives: 2 # different than hearts
|
heartExtractorEnabled: true
|
||||||
|
startingLives: 2 # different than hearts
|
||||||
|
|
||||||
|
crafting:
|
||||||
|
allowCraftingHeads: true
|
||||||
|
allowCraftingLives: true
|
|
@ -5,6 +5,7 @@ import java.util.ArrayList;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
@ -25,7 +26,7 @@ public class DeathListener implements Listener {
|
||||||
ItemStack skull = rethead(e.getEntity());
|
ItemStack skull = rethead(e.getEntity());
|
||||||
e.getEntity().getWorld().dropItemNaturally(e.getEntity().getLocation(), skull);
|
e.getEntity().getWorld().dropItemNaturally(e.getEntity().getLocation(), skull);
|
||||||
}
|
}
|
||||||
public ItemStack rethead(Player p) {
|
public ItemStack rethead(OfflinePlayer p) {
|
||||||
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
|
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
|
||||||
SkullMeta meta = (SkullMeta) skull.getItemMeta();
|
SkullMeta meta = (SkullMeta) skull.getItemMeta();
|
||||||
meta.setOwningPlayer(p);
|
meta.setOwningPlayer(p);
|
||||||
|
@ -34,6 +35,9 @@ public class DeathListener implements Listener {
|
||||||
skull.setItemMeta(newmeta);
|
skull.setItemMeta(newmeta);
|
||||||
return skull;
|
return skull;
|
||||||
}
|
}
|
||||||
|
public ItemStack rethead(Player p) {
|
||||||
|
return rethead((OfflinePlayer) p);
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent e) {
|
public void onPlayerJoin(PlayerJoinEvent e) {
|
||||||
this.scores.addPlayerToScoreboard(e.getPlayer());
|
this.scores.addPlayerToScoreboard(e.getPlayer());
|
||||||
|
|
|
@ -8,6 +8,7 @@ import org.bukkit.inventory.ShapedRecipe;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
public class LifestealPlugin extends JavaPlugin {
|
public class LifestealPlugin extends JavaPlugin {
|
||||||
|
private DeathListener dl;
|
||||||
public void addRecipes() {
|
public void addRecipes() {
|
||||||
LifeExtractor lifextractor = new LifeExtractor();
|
LifeExtractor lifextractor = new LifeExtractor();
|
||||||
lifextractor.create();
|
lifextractor.create();
|
||||||
|
@ -45,14 +46,38 @@ public class LifestealPlugin extends JavaPlugin {
|
||||||
recipe.setIngredient('B', Material.BUCKET);
|
recipe.setIngredient('B', Material.BUCKET);
|
||||||
recipe.setIngredient('S', Material.STICK);
|
recipe.setIngredient('S', Material.STICK);
|
||||||
Bukkit.addRecipe(recipe);
|
Bukkit.addRecipe(recipe);
|
||||||
|
|
||||||
|
item = this.dl.rethead(Bukkit.getOfflinePlayer("D"));
|
||||||
|
key = new NamespacedKey(this, "headRecipe0");
|
||||||
|
recipe = new ShapedRecipe(key, item);
|
||||||
|
recipe.shape("did", " ", " ");
|
||||||
|
recipe.setIngredient('d', Material.DIAMOND);
|
||||||
|
recipe.setIngredient('i', Material.IRON_INGOT);
|
||||||
|
Bukkit.addRecipe(recipe);
|
||||||
|
|
||||||
|
item = this.dl.rethead(Bukkit.getOfflinePlayer("D"));
|
||||||
|
key = new NamespacedKey(this, "headRecipe1");
|
||||||
|
recipe = new ShapedRecipe(key, item);
|
||||||
|
recipe.shape("WWW", "WsW", "WWW");
|
||||||
|
recipe.setIngredient('W', Material.STICK);
|
||||||
|
recipe.setIngredient('s', Material.NETHERITE_SCRAP);
|
||||||
|
Bukkit.addRecipe(recipe);
|
||||||
|
|
||||||
|
item = this.dl.rethead(Bukkit.getOfflinePlayer("D"));
|
||||||
|
key = new NamespacedKey(this, "headRecipe2");
|
||||||
|
recipe = new ShapedRecipe(key, item);
|
||||||
|
recipe.shape("RR ", " ", " ");
|
||||||
|
recipe.setIngredient('R', Material.REDSTONE_BLOCK);
|
||||||
|
Bukkit.addRecipe(recipe);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
DeathListener dl = new DeathListener();
|
DeathListener dl = new DeathListener();
|
||||||
dl.initialise(this);
|
this.dl = dl;
|
||||||
getServer().getPluginManager().registerEvents(dl, this);
|
this.dl.initialise(this);
|
||||||
|
getServer().getPluginManager().registerEvents(this.dl, this);
|
||||||
DeleteMyData dlmydata = new DeleteMyData();
|
DeleteMyData dlmydata = new DeleteMyData();
|
||||||
dlmydata.initialise(dl.scores);
|
dlmydata.initialise(this.dl.scores);
|
||||||
this.getCommand("deletemydata").setExecutor(dlmydata);
|
this.getCommand("deletemydata").setExecutor(dlmydata);
|
||||||
this.getCommand("setHearts").setExecutor(new ExploitAbuse101ByLunarRam());
|
this.getCommand("setHearts").setExecutor(new ExploitAbuse101ByLunarRam());
|
||||||
addRecipes();
|
addRecipes();
|
||||||
|
|
Loading…
Reference in New Issue