Skip to content

Commit

Permalink
Update v.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Iron2014 committed Dec 21, 2015
1 parent 5aa1b64 commit f6f6e11
Show file tree
Hide file tree
Showing 40 changed files with 370 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="C:/Users/lucaj/Documents/BasicHub/spigot-1.8.5.jar"/>
<classpathentry kind="lib" path="C:/Users/lucaj/Documents/BasicHub/plugins/TitleAPI.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Binary file modified bin/tk/shadowcube/snowball/GrenadeKill$1.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/GrenadeKill$2$1.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/GrenadeKill$2$2.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/GrenadeKill$2$3.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/GrenadeKill$2$4.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/GrenadeKill$2.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/GrenadeKill.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/KnifeKill$1.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/KnifeKill$2$1.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/KnifeKill$2$2.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/KnifeKill$2$3.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/KnifeKill$2$4.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/KnifeKill$2.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/KnifeKill.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/OtherDeath$1.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/OtherDeath$2$1.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/OtherDeath$2$2.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/OtherDeath$2$3.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/OtherDeath$2$4.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/OtherDeath$2.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/OtherDeath.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/Snowball$1$1.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/Snowball$1.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/Snowball$2$1.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/Snowball$2$2.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/Snowball$2$3.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/Snowball$2$4.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/Snowball$2.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/Snowball$3.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/Snowball.class
Binary file not shown.
Binary file modified bin/tk/shadowcube/snowball/main.class
Binary file not shown.
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Snowball Fight! v.1.4
# Snowball Fight! v.1.5
Snowball:
Spawn1:
X: -138.38933820885467
Expand Down
9 changes: 7 additions & 2 deletions players.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ Players:
Shadowsky:
Created: true
Tokens: 42
Kills: 124
Deaths: 69
Kills: 130
Deaths: 76
BlindnessBall: 0
Knife: 0
Grenade: 0
KillSnowMan: false
Armor:
Helmet: false
Chestplate: false
Leggings: false
Boots: false
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: SnowballFight
main: tk.shadowcube.snowball.main
version: 1.4
version: 1.5
author: Shadowsky
commands:
snowball:
Expand Down
100 changes: 90 additions & 10 deletions src/tk/shadowcube/snowball/GrenadeKill.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Effect;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
Expand All @@ -26,6 +29,7 @@
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.potion.PotionEffectType;
Expand Down Expand Up @@ -184,6 +188,7 @@ public void onExplode(EntityExplodeEvent e){

public void Respawn(final Player p){
Bukkit.getScheduler().runTaskLater(plugin, new Runnable(){

@Override
public void run() {
p.spigot().respawn();
Expand Down Expand Up @@ -231,16 +236,32 @@ public void run() {
p.setAllowFlight(false);
p.playSound(p.getLocation(), Sound.FIZZ, 1F, 1F);
plugin.clearScoreboard(p);
File file = new File("plugins//SnowballFight//players.yml");
YamlConfiguration players = YamlConfiguration.loadConfiguration(file);
final File file = new File("plugins//SnowballFight//players.yml");
final YamlConfiguration players = YamlConfiguration.loadConfiguration(file);

players.set("Players." + p.getName() + ".Deaths", players.getInt("Players." + p.getName() + ".Deaths") + 1);
if(p.getInventory().getHelmet() != null){
players.set("Players." + p.getName() + ".Armor.Helmet", true);
p.getInventory().setHelmet(null);
}
if(p.getInventory().getChestplate() != null){
players.set("Players." + p.getName() + ".Armor.Chestplate", true);
p.getInventory().setChestplate(null);
}
if(p.getInventory().getLeggings() != null){
players.set("Players." + p.getName() + ".Armor.Leggings", true);
p.getInventory().setLeggings(null);
}
if(p.getInventory().getBoots() != null){
players.set("Players." + p.getName() + ".Armor.Boots", true);
p.getInventory().setBoots(null);
}
try {
players.save(file);
} catch (IOException e) {
e.printStackTrace();
}

players.set("Players." + p.getName() + ".Deaths", players.getInt("Players." + p.getName() + ".Deaths") + 1);
try {
players.save(file);
} catch (IOException e) {
e.printStackTrace();
}

Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new Runnable(){
@Override
public void run() {
Expand All @@ -266,11 +287,70 @@ public void run() {
Bukkit.getScheduler().runTaskLater(plugin, new Runnable(){
@Override
public void run() {
if(players.getBoolean("Players." + p.getName() + ".Armor.Helmet") == true){
ArrayList<String> lore = new ArrayList<>();
ItemStack item = new ItemStack(Material.LEATHER_HELMET);
LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
meta.setColor(Color.RED);
meta.setDisplayName("§eWoolly hat");
lore.add("§5So soft!");
lore.add("§5Reduced 10% of the suffered damage!");
meta.setLore(lore);
meta.addEnchant(Enchantment.DURABILITY, 10, true);
item.setItemMeta(meta);
p.getInventory().setHelmet(item);
players.set("Players." + p.getName() + ".Armor.Helmet", false);
}
if(players.getBoolean("Players." + p.getName() + ".Armor.Chestplate") == true){
ArrayList<String> lore1 = new ArrayList<>();
ItemStack item1 = new ItemStack(Material.LEATHER_CHESTPLATE);
LeatherArmorMeta meta1 = (LeatherArmorMeta) item1.getItemMeta();
meta1.setColor(Color.GREEN);
meta1.setDisplayName("§eWinter coat");
lore1.add("§5Oh...so warm!");
lore1.add("§5Reduced 10% of the suffered damage!");
meta1.setLore(lore1);
meta1.addEnchant(Enchantment.DURABILITY, 10, true);
item1.setItemMeta(meta1);
p.getInventory().setChestplate(item1);
players.set("Players." + p.getName() + ".Armor.Chestplate", false);
}
if(players.getBoolean("Players." + p.getName() + ".Armor.Leggings") == true){
ArrayList<String> lore11 = new ArrayList<>();
ItemStack item11 = new ItemStack(Material.LEATHER_LEGGINGS);
LeatherArmorMeta meta11 = (LeatherArmorMeta) item11.getItemMeta();
meta11.setColor(Color.WHITE);
meta11.setDisplayName("§eTrousers");
lore11.add("§5Reduced 10% of the suffered damage!");
meta11.setLore(lore11);
meta11.addEnchant(Enchantment.DURABILITY, 10, true);
item11.setItemMeta(meta11);
p.getInventory().setLeggings(item11);
players.set("Players." + p.getName() + ".Armor.Leggings", false);
}
if(players.getBoolean("Players." + p.getName() + ".Armor.Boots") == true){
ArrayList<String> lore111 = new ArrayList<>();
ItemStack item111 = new ItemStack(Material.LEATHER_BOOTS);
LeatherArmorMeta meta111 = (LeatherArmorMeta) item111.getItemMeta();
meta111.setColor(Color.RED);
meta111.setDisplayName("§eWinter boots");
lore111.add("§5Reduced 10% of the suffered damage!");
meta111.setLore(lore111);
meta111.addEnchant(Enchantment.DURABILITY, 10, true);
item111.setItemMeta(meta111);
p.getInventory().setBoots(item111);
players.set("Players." + p.getName() + ".Armor.Boots", false);
}
try {
players.save(file);
} catch (IOException e) {
e.printStackTrace();
}
p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 1F, 1F);
p.removePotionEffect(PotionEffectType.INVISIBILITY);
plugin.updateScoreboard(p);
}
}, 80);
}, 80);
}
}, 10);
}
Expand Down
99 changes: 90 additions & 9 deletions src/tk/shadowcube/snowball/KnifeKill.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;

import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.potion.PotionEffectType;

import com.connorlinfoot.titleapi.TitleAPI;
Expand Down Expand Up @@ -86,6 +90,7 @@ public void run() {

public void Respawn(final Player p){
Bukkit.getScheduler().runTaskLater(plugin, new Runnable(){

@Override
public void run() {
p.spigot().respawn();
Expand Down Expand Up @@ -133,15 +138,32 @@ public void run() {
p.setAllowFlight(false);
p.playSound(p.getLocation(), Sound.FIZZ, 1F, 1F);
plugin.clearScoreboard(p);
File file = new File("plugins//SnowballFight//players.yml");
YamlConfiguration players = YamlConfiguration.loadConfiguration(file);
final File file = new File("plugins//SnowballFight//players.yml");
final YamlConfiguration players = YamlConfiguration.loadConfiguration(file);

players.set("Players." + p.getName() + ".Deaths", players.getInt("Players." + p.getName() + ".Deaths") + 1);
if(p.getInventory().getHelmet() != null){
players.set("Players." + p.getName() + ".Armor.Helmet", true);
p.getInventory().setHelmet(null);
}
if(p.getInventory().getChestplate() != null){
players.set("Players." + p.getName() + ".Armor.Chestplate", true);
p.getInventory().setChestplate(null);
}
if(p.getInventory().getLeggings() != null){
players.set("Players." + p.getName() + ".Armor.Leggings", true);
p.getInventory().setLeggings(null);
}
if(p.getInventory().getBoots() != null){
players.set("Players." + p.getName() + ".Armor.Boots", true);
p.getInventory().setBoots(null);
}
try {
players.save(file);
} catch (IOException e) {
e.printStackTrace();
}

players.set("Players." + p.getName() + ".Deaths", players.getInt("Players." + p.getName() + ".Deaths") + 1);
try {
players.save(file);
} catch (IOException e) {
e.printStackTrace();
}
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new Runnable(){
@Override
public void run() {
Expand All @@ -167,11 +189,70 @@ public void run() {
Bukkit.getScheduler().runTaskLater(plugin, new Runnable(){
@Override
public void run() {
if(players.getBoolean("Players." + p.getName() + ".Armor.Helmet") == true){
ArrayList<String> lore = new ArrayList<>();
ItemStack item = new ItemStack(Material.LEATHER_HELMET);
LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
meta.setColor(Color.RED);
meta.setDisplayName("§eWoolly hat");
lore.add("§5So soft!");
lore.add("§5Reduced 10% of the suffered damage!");
meta.setLore(lore);
meta.addEnchant(Enchantment.DURABILITY, 10, true);
item.setItemMeta(meta);
p.getInventory().setHelmet(item);
players.set("Players." + p.getName() + ".Armor.Helmet", false);
}
if(players.getBoolean("Players." + p.getName() + ".Armor.Chestplate") == true){
ArrayList<String> lore1 = new ArrayList<>();
ItemStack item1 = new ItemStack(Material.LEATHER_CHESTPLATE);
LeatherArmorMeta meta1 = (LeatherArmorMeta) item1.getItemMeta();
meta1.setColor(Color.GREEN);
meta1.setDisplayName("§eWinter coat");
lore1.add("§5Oh...so warm!");
lore1.add("§5Reduced 10% of the suffered damage!");
meta1.setLore(lore1);
meta1.addEnchant(Enchantment.DURABILITY, 10, true);
item1.setItemMeta(meta1);
p.getInventory().setChestplate(item1);
players.set("Players." + p.getName() + ".Armor.Chestplate", false);
}
if(players.getBoolean("Players." + p.getName() + ".Armor.Leggings") == true){
ArrayList<String> lore11 = new ArrayList<>();
ItemStack item11 = new ItemStack(Material.LEATHER_LEGGINGS);
LeatherArmorMeta meta11 = (LeatherArmorMeta) item11.getItemMeta();
meta11.setColor(Color.WHITE);
meta11.setDisplayName("§eTrousers");
lore11.add("§5Reduced 10% of the suffered damage!");
meta11.setLore(lore11);
meta11.addEnchant(Enchantment.DURABILITY, 10, true);
item11.setItemMeta(meta11);
p.getInventory().setLeggings(item11);
players.set("Players." + p.getName() + ".Armor.Leggings", false);
}
if(players.getBoolean("Players." + p.getName() + ".Armor.Boots") == true){
ArrayList<String> lore111 = new ArrayList<>();
ItemStack item111 = new ItemStack(Material.LEATHER_BOOTS);
LeatherArmorMeta meta111 = (LeatherArmorMeta) item111.getItemMeta();
meta111.setColor(Color.RED);
meta111.setDisplayName("§eWinter boots");
lore111.add("§5Reduced 10% of the suffered damage!");
meta111.setLore(lore111);
meta111.addEnchant(Enchantment.DURABILITY, 10, true);
item111.setItemMeta(meta111);
p.getInventory().setBoots(item111);
players.set("Players." + p.getName() + ".Armor.Boots", false);
}
try {
players.save(file);
} catch (IOException e) {
e.printStackTrace();
}
p.playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 1F, 1F);
p.removePotionEffect(PotionEffectType.INVISIBILITY);
plugin.updateScoreboard(p);
}
}, 80);
}, 80);
}
}, 10);
}
Expand Down
Loading

0 comments on commit f6f6e11

Please sign in to comment.