mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-18 22:24:35 +00:00
Merge pull request #162 from jacklin213/bugfix
Fix ErrorLogger, WaterWave, AirCombo
This commit is contained in:
commit
3d769371c6
4 changed files with 12 additions and 8 deletions
|
@ -40,7 +40,7 @@ public class ProjectKorra extends JavaPlugin {
|
||||||
if (!logFolder.exists()) {
|
if (!logFolder.exists()) {
|
||||||
logFolder.mkdirs();
|
logFolder.mkdirs();
|
||||||
}
|
}
|
||||||
handler = new PKLogHandler(getDataFolder() + File.separator + "ERROR.log");
|
handler = new PKLogHandler(logFolder + File.separator + "ERROR.%g.log");
|
||||||
log.getParent().addHandler(handler);
|
log.getParent().addHandler(handler);
|
||||||
} catch (SecurityException | IOException e) {
|
} catch (SecurityException | IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -29,17 +29,17 @@ public class LogFilter implements Filter {
|
||||||
}
|
}
|
||||||
String recordString = "";
|
String recordString = "";
|
||||||
if (record.getMessage() != null) {
|
if (record.getMessage() != null) {
|
||||||
if (!record.getMessage().contains("LogTest")) {
|
if (!record.getMessage().contains("ProjectKorra")) {
|
||||||
if (record.getThrown() == null) {
|
if (record.getThrown() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (record.getThrown().getMessage() == null) {
|
if (record.getThrown().getMessage() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!record.getThrown().getMessage().contains("LogTest")) {
|
if (!record.getThrown().getMessage().contains("ProjectKorra")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// record message doesnt have logtest but throwable does
|
// record message doesnt have ProjectKorra but throwable does
|
||||||
}
|
}
|
||||||
recordString = buildString(record);
|
recordString = buildString(record);
|
||||||
} else {
|
} else {
|
||||||
|
@ -47,10 +47,10 @@ public class LogFilter implements Filter {
|
||||||
if (record.getThrown().getMessage() == null) {
|
if (record.getThrown().getMessage() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!record.getThrown().getMessage().contains("LogTest")) {
|
if (!record.getThrown().getMessage().contains("ProjectKorra")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// record message null but throwable has logtest
|
// record message null but throwable has ProjectKorra
|
||||||
recordString = buildString(record);
|
recordString = buildString(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -529,7 +529,7 @@ public class AirCombo {
|
||||||
&& combo.ability.equalsIgnoreCase("AirSweep")) {
|
&& combo.ability.equalsIgnoreCase("AirSweep")) {
|
||||||
for (int j = 0; j < combo.tasks.size(); j++) {
|
for (int j = 0; j < combo.tasks.size(); j++) {
|
||||||
FireComboStream fs = (FireComboStream) combo.tasks.get(j);
|
FireComboStream fs = (FireComboStream) combo.tasks.get(j);
|
||||||
if (fs.getLocation() != null
|
if (fs.getLocation() != null && fs.getLocation().getWorld().equals(loc.getWorld())
|
||||||
&& Math.abs(fs.getLocation().distance(loc)) <= radius) {
|
&& Math.abs(fs.getLocation().distance(loc)) <= radius) {
|
||||||
fs.remove();
|
fs.remove();
|
||||||
removed = true;
|
removed = true;
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import com.projectkorra.ProjectKorra.BendingPlayer;
|
||||||
import com.projectkorra.ProjectKorra.GeneralMethods;
|
import com.projectkorra.ProjectKorra.GeneralMethods;
|
||||||
import com.projectkorra.ProjectKorra.ProjectKorra;
|
import com.projectkorra.ProjectKorra.ProjectKorra;
|
||||||
import com.projectkorra.ProjectKorra.TempBlock;
|
import com.projectkorra.ProjectKorra.TempBlock;
|
||||||
|
@ -305,7 +306,10 @@ public class WaterWave {
|
||||||
|
|
||||||
public void remove() {
|
public void remove() {
|
||||||
instances.remove(this);
|
instances.remove(this);
|
||||||
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("WaterWave", cooldown);
|
BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(player.getName());
|
||||||
|
if (bPlayer != null) {
|
||||||
|
bPlayer.addCooldown("WaterWave", cooldown);
|
||||||
|
}
|
||||||
revertBlocks();
|
revertBlocks();
|
||||||
for (BukkitRunnable task : tasks)
|
for (BukkitRunnable task : tasks)
|
||||||
task.cancel();
|
task.cancel();
|
||||||
|
|
Loading…
Reference in a new issue