Blocking provides 'Sturdy III' for players.

master_event
sigonasr2 11 years ago
parent 4f7ad5a62f
commit 80957a8788
  1. 12
      BankEconomyMod/src/me/kaZep/Base/Main.java
  2. 13
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java

@ -74,6 +74,7 @@ import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.util.Vector;
import org.bukkit.enchantments.Enchantment;
import com.sk89q.worldedit.CuboidClipboard;
@ -991,6 +992,7 @@ public class Main extends JavaPlugin
}
public void runTick() {
final Main plugin = this;
this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
public void run(){
SERVER_TICK_TIME++;
@ -1724,7 +1726,11 @@ public void runTick() {
} else {
if (l.getCustomName()!=null && (l.getCustomName().compareTo(ChatColor.YELLOW+"Charge Zombie")==0 || l.getCustomName().compareTo(ChatColor.GOLD+"Charge Zombie II")==0 || l.getCustomName().compareTo(ChatColor.DARK_PURPLE+"Charge Zombie III")==0)) {
//Destroy blocks around it.
/*Block b = l.getLocation().getBlock();
if (b.getType()==Material.WATER || b.getType()==Material.STATIONARY_WATER ||
b.getType()==Material.LAVA || b.getType()==Material.STATIONARY_LAVA) {
Vector knockback = l.getVelocity().multiply(8f);
l.setVelocity(knockback);*/
boolean doit=true;
if (l.getKiller()!=null && l.getKiller().getLocation().getY()>l.getLocation().getY()) {
doit=false;
@ -1755,8 +1761,8 @@ public void runTick() {
}
}
}*/
for (int k=-1;k<2;k++) {
for (int j=-1;j<2;j++) {
for (int k=-2;k<3;k++) {
for (int j=-2;j<3;j++) {
Location checkloc = l.getLocation().add(k,1,j);
Block bl = Bukkit.getWorld("world").getBlockAt(checkloc);
if (bl.getType()!=Material.BEDROCK && bl.getType()!=Material.ENDER_PORTAL_FRAME && bl.getType()!=Material.ENDER_PORTAL && bl.getType()!=Material.MOB_SPAWNER) {

@ -7098,7 +7098,18 @@ implements Listener
},1);
}
}
if (p.isBlocking()) {e.setDamage(e.getDamage()/2.0d);}
if (p.isBlocking()) {
final Player p2 = p;
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override
public void run() {
//Multiplying by a number lower than 1 will reduce knockback
//Multiplying by a number greater than 1 will increase knockback
Vector knockback = p2.getVelocity().multiply(0.4f);
p2.setVelocity(knockback);
}
}, 1L);
e.setDamage(e.getDamage()/2.0d);}
p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel()));
int slot=0;
for (int i=0;i<this.plugin.SPEED_CONTROL.size();i++) {

Loading…
Cancel
Save