mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-12 05:16:55 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bea0d9c7df | |||
| 0eccf1b1af | |||
| 2669c538cd | |||
| 36861084cc |
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>me.youhavetrouble</groupId>
|
||||
<artifactId>PreventStabby</artifactId>
|
||||
<version>1.3-pre3</version>
|
||||
<version>1.3-pre4</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>PreventStabby</name>
|
||||
@@ -74,8 +74,8 @@
|
||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
<id>bs-repo</id>
|
||||
<url>https://ci.pluginwiki.us/plugin/repository/everything/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sk89q-repo</id>
|
||||
@@ -102,10 +102,9 @@
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.Thatsmusic99</groupId>
|
||||
<groupId>com.github.thatsmusic99</groupId>
|
||||
<artifactId>ConfigurationMaster</artifactId>
|
||||
<version>v1.0-RC-2</version>
|
||||
<scope>compile</scope>
|
||||
<version>v1.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
|
||||
@@ -22,9 +22,9 @@ public final class PreventStabby extends JavaPlugin {
|
||||
|
||||
@Getter private static PreventStabby plugin;
|
||||
private ConfigCache configCache;
|
||||
protected PlayerManager playerManager;
|
||||
protected DatabaseSQLite sqLite;
|
||||
protected SmartCache smartCache;
|
||||
private PlayerManager playerManager;
|
||||
private DatabaseSQLite sqLite;
|
||||
private SmartCache smartCache;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
|
||||
@@ -27,14 +27,10 @@ public class WorldGuardHook {
|
||||
PreventStabby plugin = PreventStabby.getPlugin();
|
||||
try {
|
||||
Class.forName("com.sk89q.worldguard.protection.flags.registry.FlagConflictException");
|
||||
System.out.println("what");
|
||||
worldGuardPlugin = WorldGuardPlugin.inst();
|
||||
System.out.println("the");
|
||||
if (WorldGuard.getInstance() == null || worldGuardPlugin == null) return;
|
||||
System.out.println("actual");
|
||||
plugin.getLogger().info("Hooking into WorldGuard");
|
||||
flagRegistry = WorldGuard.getInstance().getFlagRegistry();
|
||||
System.out.println("fuck");
|
||||
createForcePvpFlag(plugin);
|
||||
} catch (NoClassDefFoundError | ClassNotFoundException e) {
|
||||
return;
|
||||
|
||||
@@ -33,12 +33,7 @@ public class PlayerManager {
|
||||
Iterator<PlayerData> iterator = playerList.values().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
PlayerData playerData = iterator.next();
|
||||
System.out.println(playerData);
|
||||
UUID uuid = playerData.getPlayerUuid();
|
||||
System.out.println("----------------------");
|
||||
System.out.println(uuid.toString());
|
||||
System.out.println("In combat: "+CombatTimer.isInCombat(uuid));
|
||||
System.out.println("Last check: "+playerData.getLastCombatCheck());
|
||||
if (!CombatTimer.isInCombat(uuid)) {
|
||||
if (playerData.getLastCombatCheck()) {
|
||||
Player player = Bukkit.getPlayer(uuid);
|
||||
|
||||
@@ -45,14 +45,16 @@ public class Util {
|
||||
|
||||
Set<UUID> playerPassengersWithPvpEnabled = new HashSet<>();
|
||||
|
||||
boolean hasPlayerPassengers = false;
|
||||
for (Entity passenger : mount.getPassengers()) {
|
||||
if (!(passenger instanceof Player)) continue;
|
||||
Player player = (Player) passenger;
|
||||
hasPlayerPassengers = true;
|
||||
if (PreventStabby.getPlugin().getPlayerManager().getPlayerPvPState(player.getUniqueId()))
|
||||
playerPassengersWithPvpEnabled.add(player.getUniqueId());
|
||||
}
|
||||
|
||||
if (playerPassengersWithPvpEnabled.isEmpty()) {
|
||||
if (hasPlayerPassengers && playerPassengersWithPvpEnabled.isEmpty()) {
|
||||
PluginMessages.sendActionBar(attacker, config.getCannot_attack_mounts_victim());
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user