Skip to content

Commit

Permalink
Added /ce runecrafting
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiterio authored and Taiterio committed Mar 27, 2016
1 parent debacf6 commit ba8cd3b
Show file tree
Hide file tree
Showing 15 changed files with 144 additions and 154 deletions.
1 change: 0 additions & 1 deletion src/com/taiter/ce/CItems/AssassinsBlade.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
Expand Down
23 changes: 2 additions & 21 deletions src/com/taiter/ce/CItems/Deathscythe.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
package com.taiter.ce.CItems;

/*
* This file is part of Custom Enchantments
* Copyright (C) Taiterio 2015
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/


import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.bukkit.ChatColor;
import org.bukkit.Effect;
Expand Down Expand Up @@ -113,7 +94,7 @@ public boolean effect(Event event, final Player player) {
}

for(int i = 1; i < Range; i++) {
loc = player.getTargetBlock((HashSet<Byte>)null, i).getLocation();
loc = player.getTargetBlock((Set<Material>)null, i).getLocation();
if(!loc.getBlock().getType().equals(Material.AIR))
return true;
loc.getWorld().playEffect(loc, Effect.SMOKE, Range*2);
Expand Down
9 changes: 5 additions & 4 deletions src/com/taiter/ce/CItems/Flamethrower.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@


import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.bukkit.ChatColor;
import org.bukkit.Effect;
Expand Down Expand Up @@ -53,7 +53,8 @@ public Flamethrower(String originalName, ChatColor color, String lDescription, l
triggers.add(Trigger.INTERACT_RIGHT);
}

@Override
@SuppressWarnings("deprecation")
@Override
public boolean effect(Event event, final Player player) {
PlayerInteractEvent e = (PlayerInteractEvent) event;
e.setCancelled(true);
Expand Down Expand Up @@ -84,7 +85,7 @@ public void run() {
if(l.getBlock().getType().equals(Material.AIR))
l.getBlock().setType(Material.FIRE);
l.getWorld().playEffect(l, Effect.SMOKE, 20);
final FallingBlock fire = l.getWorld().spawnFallingBlock(l, Material.FIRE.getId(), (byte) 0x00);
final FallingBlock fire = l.getWorld().spawnFallingBlock(l, Material.FIRE.getId(), (byte) 0);
fire.setDropItem(false);
fire.setVelocity(player.getLocation().getDirection());
new BukkitRunnable() {
Expand Down Expand Up @@ -139,7 +140,7 @@ public void initConfigEntries() {
public List<Location> getLinePlayer(Player player, int length) {
List<Location> list = new ArrayList<Location>();
for(int amount = length; amount > 0; amount --) {
list.add(player.getTargetBlock((HashSet<Byte>)null, amount).getLocation());
list.add(player.getTargetBlock((Set<Material>)null, amount).getLocation());
}
return list;
}
Expand Down
1 change: 0 additions & 1 deletion src/com/taiter/ce/CItems/HealingShovel.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Damageable;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
Expand Down
6 changes: 3 additions & 3 deletions src/com/taiter/ce/CItems/NecromancersStaff.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.bukkit.ChatColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.entity.SmallFireball;
import org.bukkit.entity.WitherSkull;
Expand Down Expand Up @@ -142,7 +141,7 @@ public boolean effect(Event event, Player player) {
player.launchProjectile(SmallFireball.class).setVelocity(l.getDirection().multiply(1.5));
EffectManager.playSound(l, "ENTITY_BLAZE_HIT", 0.2f, 0f);
} else if (spell == 2) {
Location target = player.getTargetBlock((HashSet<Byte>) null, 20).getLocation();
Location target = player.getTargetBlock((Set<Material>) null, 20).getLocation();
player.getWorld().strikeLightning(target);
if (Tools.checkWorldGuard(l, player, "TNT", true))
player.getWorld().createExplosion(target, 1);
Expand All @@ -160,6 +159,7 @@ public boolean effect(Event event, Player player) {
// returns false
}

@SuppressWarnings("deprecation")
@Override
public void initConfigEntries() {
Fuel = Material.getMaterial(Integer.parseInt(getConfig().getString("Items." + getOriginalName() + ".Fuel")));
Expand Down
1 change: 0 additions & 1 deletion src/com/taiter/ce/CItems/RocketBoots.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.player.PlayerInteractEvent;
Expand Down
23 changes: 19 additions & 4 deletions src/com/taiter/ce/CeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.scheduler.BukkitRunnable;
Expand All @@ -46,6 +48,7 @@ public CeCommand(Main m) {
this.main = m;
}

@SuppressWarnings("deprecation")
public String processCommand(CommandSender sender, String[] args) {

String Success = ChatColor.GREEN + "";
Expand Down Expand Up @@ -463,12 +466,24 @@ public void run() {
} else
return usageError;
}


if (sender instanceof Player) {

Player p = (Player) sender;

if (name.startsWith("l")) {


if(name.startsWith("rune")) {
requiredPermission += "runecrafting";
if (!sender.hasPermission(node) && !sender.hasPermission(requiredPermission) && !sender.isOp())
return Error + "You do not have permission to use this command.";

Inventory inv = Bukkit.createInventory(p, InventoryType.FURNACE, ChatColor.LIGHT_PURPLE + "" + ChatColor.MAGIC + "abc" + ChatColor.RESET + ChatColor.DARK_PURPLE
+ " Runecrafting " + ChatColor.LIGHT_PURPLE + "" + ChatColor.MAGIC + "cba");
inv.setContents(new ItemStack[] { new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR) });

p.openInventory(inv);
return "";
} else if (name.startsWith("l")) {
requiredPermission += "list";
if (!sender.hasPermission(node) && !sender.hasPermission(requiredPermission) && !sender.isOp())
return Error + "You do not have permission to use this command.";
Expand Down Expand Up @@ -532,7 +547,7 @@ public void run() {
if (!sender.hasPermission(node) && !sender.hasPermission(requiredPermission) && !sender.isOp())
return Error + "You do not have permission to use this command.";

Tools.openCEMenu(p);
p.openInventory(Main.CEMainMenu);
return "";
}

Expand Down
3 changes: 2 additions & 1 deletion src/com/taiter/ce/Enchantments/Bow/Bombardment.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public Bombardment(Application app) {
triggers.add(Trigger.DAMAGE_GIVEN);
}

@Override
@SuppressWarnings("deprecation")
@Override
public void effect(Event e, ItemStack item, final int level) {
if(e instanceof EntityDamageByEntityEvent) {
EntityDamageByEntityEvent event = (EntityDamageByEntityEvent) e;
Expand Down
3 changes: 2 additions & 1 deletion src/com/taiter/ce/Enchantments/Bow/Molotov.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public Molotov(Application app) {
triggers.add(Trigger.DAMAGE_GIVEN);
}

@Override
@SuppressWarnings("deprecation")
@Override
public void effect(Event e, ItemStack item, final int level) {
if(e instanceof EntityDamageByEntityEvent) {
EntityDamageByEntityEvent event = (EntityDamageByEntityEvent) e;
Expand Down
1 change: 1 addition & 0 deletions src/com/taiter/ce/Enchantments/EnchantManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class EnchantManager {
glowEnchantment = registerGlowEnchantment();
}

@SuppressWarnings("deprecation")
private static Enchantment registerGlowEnchantment() {
int id = Main.config.getInt("Global.Enchantments.GlowEnchantmentID");
Enchantment glow = Enchantment.getById(id);
Expand Down
1 change: 0 additions & 1 deletion src/com/taiter/ce/Enchantments/Global/Headless.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.taiter.ce.Enchantments.Global;

import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
Expand Down
Loading

0 comments on commit ba8cd3b

Please sign in to comment.