|
@@ -20,17 +20,29 @@ import com.gmail.nossr50.util.skills.RankUtils;
|
|
|
import com.gmail.nossr50.util.skills.SkillActivationType;
|
|
|
import org.bukkit.Material;
|
|
|
import org.bukkit.block.BlockState;
|
|
|
-import org.bukkit.block.data.BlockData;
|
|
|
import org.bukkit.entity.Item;
|
|
|
import org.bukkit.entity.LivingEntity;
|
|
|
import org.bukkit.entity.Player;
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
|
|
public class UnarmedManager extends SkillManager {
|
|
|
+ private long lastAttacked;
|
|
|
+ private long attackInterval;
|
|
|
+
|
|
|
public UnarmedManager(McMMOPlayer mcMMOPlayer) {
|
|
|
super(mcMMOPlayer, PrimarySkillType.UNARMED);
|
|
|
+ initUnarmedPerPlayerVars();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Inits variables used for each player for unarmed
|
|
|
+ */
|
|
|
+ private void initUnarmedPerPlayerVars() {
|
|
|
+ lastAttacked = 0;
|
|
|
+ attackInterval = 750;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public boolean canActivateAbility() {
|
|
|
return mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && Permissions.berserk(getPlayer());
|
|
|
}
|
|
@@ -74,8 +86,6 @@ public class UnarmedManager extends SkillManager {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- BlockData data = blockState.getBlockData();
|
|
|
-
|
|
|
switch (blockState.getType()) {
|
|
|
case STONE_BRICKS:
|
|
|
if (!Unarmed.blockCrackerSmoothBrick) {
|
|
@@ -150,7 +160,7 @@ public class UnarmedManager extends SkillManager {
|
|
|
}
|
|
|
|
|
|
public boolean isPunchingCooldownOver() {
|
|
|
- return (Unarmed.lastAttacked + Unarmed.attackInterval) <= System.currentTimeMillis();
|
|
|
+ return (lastAttacked + attackInterval) <= System.currentTimeMillis();
|
|
|
}
|
|
|
|
|
|
public double getIronArmDamage() {
|
|
@@ -181,4 +191,20 @@ public class UnarmedManager extends SkillManager {
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ public long getLastAttacked() {
|
|
|
+ return lastAttacked;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLastAttacked(long lastAttacked) {
|
|
|
+ this.lastAttacked = lastAttacked;
|
|
|
+ }
|
|
|
+
|
|
|
+ public long getAttackInterval() {
|
|
|
+ return attackInterval;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setAttackInterval(long attackInterval) {
|
|
|
+ this.attackInterval = attackInterval;
|
|
|
+ }
|
|
|
}
|