Skip to content

Commit

Permalink
Refactor: Rename package & update version
Browse files Browse the repository at this point in the history
  • Loading branch information
SakuraKoi committed Jul 23, 2020
1 parent a8066f9 commit 738bcce
Show file tree
Hide file tree
Showing 24 changed files with 46 additions and 44 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.settings/
/bin/
/.idea/
/classes/
2 changes: 1 addition & 1 deletion src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: BridgingAnalyzer
main: sakura.kooi.BridgingAnalyzer.BridgingAnalyzer
version: 27
version: 28
author: SakuraKooi
commands:
bridge:
Expand Down
14 changes: 7 additions & 7 deletions src/sakura/kooi/BridgingAnalyzer/BridgingAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import sakura.kooi.BridgingAnalyzer.Cmmands.*;
import sakura.kooi.BridgingAnalyzer.Utils.Metrics;
import sakura.kooi.BridgingAnalyzer.Utils.NoAIUtils;
import sakura.kooi.BridgingAnalyzer.Utils.TitleUtils;
import sakura.kooi.BridgingAnalyzer.Utils.Util;
import sakura.kooi.BridgingAnalyzer.commands.*;
import sakura.kooi.BridgingAnalyzer.utils.Metrics;
import sakura.kooi.BridgingAnalyzer.utils.NoAIUtils;
import sakura.kooi.BridgingAnalyzer.utils.TitleUtils;
import sakura.kooi.BridgingAnalyzer.utils.Utils;
import sakura.kooi.BridgingAnalyzer.api.BlockSkinProvider;

import java.util.HashMap;
Expand Down Expand Up @@ -156,11 +156,11 @@ public void onDamage(EntityDamageEvent e) {
c.reset();
teleportCheckPoint((Player) e.getEntity());
TitleUtils.sendTitle((Player) e.getEntity(), "",
"§4致命伤害 - " + Util.formatDouble(e.getFinalDamage() / 2) + " ❤", 10, 20, 10);
"§4致命伤害 - " + Utils.formatDouble(e.getFinalDamage() / 2) + " ❤", 10, 20, 10);
e.setDamage(0.0);
} else if (e.getFinalDamage() > 10) {
TitleUtils.sendTitle((Player) e.getEntity(), "",
"§c严重伤害 - " + Util.formatDouble(e.getFinalDamage() / 2) + " ❤", 10, 20, 10);
"§c严重伤害 - " + Utils.formatDouble(e.getFinalDamage() / 2) + " ❤", 10, 20, 10);
}
e.setDamage(0.0);
}
Expand Down
16 changes: 8 additions & 8 deletions src/sakura/kooi/BridgingAnalyzer/Counter.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitTask;
import sakura.kooi.BridgingAnalyzer.Utils.SoundMachine;
import sakura.kooi.BridgingAnalyzer.Utils.Util;
import sakura.kooi.BridgingAnalyzer.utils.SoundMachine;
import sakura.kooi.BridgingAnalyzer.utils.Utils;

import java.util.ArrayList;
import java.util.HashSet;
Expand Down Expand Up @@ -96,13 +96,13 @@ public double getBridgeSpeed() {
if (peri > 1000L) {
result = counterBridge.size() / (peri / 1000.0);
if (result > maxBridge) {
maxBridge = Util.formatDouble(result);
maxBridge = Utils.formatDouble(result);
}
} else {
result = counterBridge.size();
}
}
return Util.formatDouble(result);
return Utils.formatDouble(result);
}

public int getCPS() {
Expand All @@ -123,7 +123,7 @@ public int getMaxCPS() {

public void instantBreakBlock() {
for (Block b : allBlock) {
Util.breakBlock(b);
Utils.breakBlock(b);
BridgingAnalyzer.getPlacedBlocks().remove(b);
}
allBlock.clear();
Expand Down Expand Up @@ -172,7 +172,7 @@ public void setCheckPoint(Location loc) {
Chest chest = (Chest) target.getState();
for (ItemStack stack : chest.getBlockInventory().getContents())
if (stack != null) {
Util.addItem(player.getInventory(), stack.clone());
Utils.addItem(player.getInventory(), stack.clone());
}
player.getWorld().playSound(player.getLocation(), SoundMachine.get("ITEM_PICKUP", "ENTITY_ITEM_PICKUP"), 1,
1);
Expand All @@ -188,7 +188,7 @@ public void teleportCheckPoint() {
Chest chest = (Chest) target.getState();
for (ItemStack stack : chest.getBlockInventory().getContents())
if (stack != null) {
Util.addItem(player.getInventory(), stack.clone());
Utils.addItem(player.getInventory(), stack.clone());
}
player.getWorld().playSound(player.getLocation(), SoundMachine.get("ITEM_PICKUP", "ENTITY_ITEM_PICKUP"), 1,
1);
Expand Down Expand Up @@ -234,7 +234,7 @@ public void run() {
BridgingAnalyzer.getPlacedBlocks().remove(b);
}
if (b != null) {
Util.breakBlock(b);
Utils.breakBlock(b);
BridgingAnalyzer.getPlacedBlocks().remove(b);
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/sakura/kooi/BridgingAnalyzer/CounterListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
import sakura.kooi.BridgingAnalyzer.Utils.ActionBarUtils;
import sakura.kooi.BridgingAnalyzer.Utils.TitleUtils;
import sakura.kooi.BridgingAnalyzer.utils.ActionBarUtils;
import sakura.kooi.BridgingAnalyzer.utils.TitleUtils;

public class CounterListener implements Listener {
@EventHandler
Expand Down
2 changes: 1 addition & 1 deletion src/sakura/kooi/BridgingAnalyzer/HighlightListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import sakura.kooi.BridgingAnalyzer.Utils.ParticleEffects;
import sakura.kooi.BridgingAnalyzer.utils.ParticleEffects;

import java.util.HashMap;

Expand Down
4 changes: 2 additions & 2 deletions src/sakura/kooi/BridgingAnalyzer/TriggerBlockListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.Vector;
import sakura.kooi.BridgingAnalyzer.Utils.*;
import sakura.kooi.BridgingAnalyzer.utils.*;

public class TriggerBlockListener implements Listener {
@EventHandler
Expand All @@ -22,7 +22,7 @@ public void antiTriggerBlockCover(BlockPlaceEvent e) {
if (isTriggerBlock(e.getBlock().getRelative(BlockFace.DOWN)) || isTriggerBlock(e.getBlock().getRelative(BlockFace.DOWN,
2))) {
Bukkit.getScheduler().runTaskLater(BridgingAnalyzer.getInstance(), () -> {
Util.breakBlock(e.getBlock());
Utils.breakBlock(e.getBlock());
BridgingAnalyzer.getCounter(e.getPlayer()).removeBlockRecord(e.getBlock());
}, 100);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package sakura.kooi.BridgingAnalyzer.Cmmands;
package sakura.kooi.BridgingAnalyzer.commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import sakura.kooi.BridgingAnalyzer.BridgingAnalyzer;
import sakura.kooi.BridgingAnalyzer.Counter;
import sakura.kooi.BridgingAnalyzer.Utils.SendMessageUtils;
import sakura.kooi.BridgingAnalyzer.utils.SendMessageUtils;

public class BridgeCommand implements CommandExecutor {

Expand All @@ -18,12 +18,13 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}
if (args.length != 1) {
SendMessageUtils.sendMessage(sender,
"§b§l搭路练习 §7>> §b骚操作练习 最终版 §lBy.SakuraKooi",
"§b§l搭路练习 §7>> §b§lBridgingAnalyzer | By.SakuraKooi",
"§b§l搭路练习 §7>> §e/bridge highlight §a启用/禁用侧搭辅助指示",
"§b§l搭路练习 §7>> §e/bridge pvp §a启用/禁用伤害屏蔽",
"§b§l搭路练习 §7>> §e/bridge speed §a启用/禁用搭路速度统计",
"§b§l搭路练习 §7>> §e/bridge stand §a启用/禁用走搭位置指示",
"§b§l搭路练习 §7>> §d所配置的参数仅对您有效, 其他玩家不受影响."
"§b§l搭路练习 §7>> §d所配置的参数仅对您有效, 其他玩家不受影响",
"§b§l搭路练习 §7>> §bhttps://github.com/SakuraKoi/BridgingAnalyzer"
);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Cmmands;
package sakura.kooi.BridgingAnalyzer.commands;

import org.bukkit.Bukkit;
import org.bukkit.Material;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Cmmands;
package sakura.kooi.BridgingAnalyzer.commands;

import org.bukkit.Bukkit;
import org.bukkit.World;
Expand All @@ -8,7 +8,7 @@
import org.bukkit.command.CommandSender;
import sakura.kooi.BridgingAnalyzer.BridgingAnalyzer;
import sakura.kooi.BridgingAnalyzer.Counter;
import sakura.kooi.BridgingAnalyzer.Utils.Util;
import sakura.kooi.BridgingAnalyzer.utils.Utils;

public class SaveWorldCommand implements CommandExecutor {

Expand All @@ -20,7 +20,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
c.instantBreakBlock();
}
for (Block b : Counter.scheduledBreakBlocks) {
Util.breakBlock(b);
Utils.breakBlock(b);
}
for (World world : Bukkit.getWorlds()) {
world.save();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Cmmands;
package sakura.kooi.BridgingAnalyzer.commands;

import org.bukkit.Material;
import org.bukkit.block.Block;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Cmmands;
package sakura.kooi.BridgingAnalyzer.commands;

import org.bukkit.Location;
import org.bukkit.Material;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.entity.Player;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.Color;
import org.bukkit.FireworkEffect;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.entity.Entity;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.Bukkit;
import org.bukkit.Color;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.Bukkit;
import org.bukkit.Location;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.Bukkit;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.command.CommandSender;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.Sound;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.Bukkit;
import org.bukkit.Location;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package sakura.kooi.BridgingAnalyzer.Utils;
package sakura.kooi.BridgingAnalyzer.utils;

import org.bukkit.Effect;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;

public class Util {
public class Utils {
public static void breakBlock(Block b) {
if (!b.getChunk().isLoaded()) {
b.getChunk().load(false);
Expand Down

0 comments on commit 738bcce

Please sign in to comment.