mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Proxy-based profile proof
This commit is contained in:
parent
4f88d6094a
commit
3ed8a54251
@ -99,12 +99,6 @@
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
|
||||
<!-- AdvancedEnchants -->
|
||||
<repository>
|
||||
<id>egg82-ninja</id>
|
||||
<url>https://www.myget.org/F/egg82-java/maven/</url>
|
||||
</repository>
|
||||
|
||||
<!-- HolographicDisplays -->
|
||||
<repository>
|
||||
<id>codemc-repo</id>
|
||||
@ -124,6 +118,7 @@
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.20.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-clean-plugin -->
|
||||
<dependency>
|
||||
@ -131,6 +126,7 @@
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- AuthLib -->
|
||||
<dependency>
|
||||
@ -138,6 +134,7 @@
|
||||
<artifactId>authlib</artifactId>
|
||||
<version>1.5.21</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- MMOCore Api -->
|
||||
<dependency>
|
||||
@ -145,13 +142,15 @@
|
||||
<artifactId>MMOCore-API</artifactId>
|
||||
<version>1.12-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- MythicEnchants -->
|
||||
<dependency>
|
||||
<groupId>io.lumine</groupId>
|
||||
<artifactId>MythicEnchants</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<version>0.0.1-REUPLOAD</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- PhatLoots -->
|
||||
<dependency>
|
||||
@ -159,6 +158,7 @@
|
||||
<artifactId>PhatLoots</artifactId>
|
||||
<version>4.2.3</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- placeholderapi -->
|
||||
<dependency>
|
||||
@ -166,6 +166,7 @@
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.9.2</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Mythic -->
|
||||
<dependency>
|
||||
@ -173,13 +174,6 @@
|
||||
<artifactId>Mythic-Dist</artifactId>
|
||||
<version>5.1.2-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Profile API -->
|
||||
<dependency>
|
||||
<groupId>fr.phoenixdevt</groupId>
|
||||
<artifactId>Profile-API</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- WordGuard -->
|
||||
@ -188,6 +182,7 @@
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
<version>7.0.2-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Vault -->
|
||||
<dependency>
|
||||
@ -195,6 +190,7 @@
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.7</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- SkillAPI -->
|
||||
<dependency>
|
||||
@ -202,6 +198,7 @@
|
||||
<artifactId>SkillAPI</artifactId>
|
||||
<version>master</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- AE Api -->
|
||||
<dependency>
|
||||
@ -209,6 +206,7 @@
|
||||
<artifactId>ae.api</artifactId>
|
||||
<version>5.7.6</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- BossShop -->
|
||||
<dependency>
|
||||
@ -216,6 +214,7 @@
|
||||
<artifactId>BossShop</artifactId>
|
||||
<version>2.0.9</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Residence -->
|
||||
<dependency>
|
||||
@ -223,6 +222,7 @@
|
||||
<artifactId>Residence</artifactId>
|
||||
<version>4.8.7.2</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Heroes -->
|
||||
<dependency>
|
||||
@ -230,6 +230,7 @@
|
||||
<artifactId>Heroes</artifactId>
|
||||
<version>1.9.22</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- ProtocolLib -->
|
||||
<dependency>
|
||||
@ -245,6 +246,7 @@
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>2.1.104</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- McRPG -->
|
||||
<dependency>
|
||||
@ -252,6 +254,7 @@
|
||||
<artifactId>McRPG</artifactId>
|
||||
<version>1.1.2</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Rpl -->
|
||||
<dependency>
|
||||
@ -259,6 +262,7 @@
|
||||
<artifactId>rpl</artifactId>
|
||||
<version>3.9.30</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Skills -->
|
||||
<dependency>
|
||||
@ -266,6 +270,7 @@
|
||||
<artifactId>skills</artifactId>
|
||||
<version>12.3.5</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- SkillsPro -->
|
||||
<dependency>
|
||||
@ -273,6 +278,7 @@
|
||||
<artifactId>SkillsPro</artifactId>
|
||||
<version>18.9.0.1</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- BattleLevels -->
|
||||
<dependency>
|
||||
@ -280,6 +286,7 @@
|
||||
<artifactId>BattleLevels</artifactId>
|
||||
<version>6.9.1</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- TrHologram -->
|
||||
<dependency>
|
||||
@ -287,6 +294,7 @@
|
||||
<artifactId>TrHologram</artifactId>
|
||||
<version>1.11</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- HolographicDisplays API -->
|
||||
<dependency>
|
||||
@ -294,6 +302,7 @@
|
||||
<artifactId>holographicdisplays-api</artifactId>
|
||||
<version>2.4.0</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- RacesAndClasses -->
|
||||
<dependency>
|
||||
@ -301,6 +310,7 @@
|
||||
<artifactId>RacesAndClasses</artifactId>
|
||||
<version>1.2.6</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Rpg Inventory -->
|
||||
<dependency>
|
||||
@ -308,6 +318,7 @@
|
||||
<artifactId>rpginventory</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Holograms -->
|
||||
<dependency>
|
||||
@ -315,6 +326,7 @@
|
||||
<artifactId>Holograms</artifactId>
|
||||
<version>2.9.1</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Aurelium Skills -->
|
||||
<dependency>
|
||||
@ -322,6 +334,7 @@
|
||||
<artifactId>AureliumSkills</artifactId>
|
||||
<version>1.2.8</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Crazy Enchantments -->
|
||||
<dependency>
|
||||
@ -329,6 +342,7 @@
|
||||
<artifactId>crazyenchantments</artifactId>
|
||||
<version>1.8-db9</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Citizens -->
|
||||
<dependency>
|
||||
@ -336,6 +350,7 @@
|
||||
<artifactId>Citizens</artifactId>
|
||||
<version>2.0.30</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Denizen -->
|
||||
<dependency>
|
||||
@ -343,6 +358,7 @@
|
||||
<artifactId>denizen</artifactId>
|
||||
<version>1.2.1-b1744-REL</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Denizen -->
|
||||
<dependency>
|
||||
@ -350,6 +366,7 @@
|
||||
<artifactId>depenizen</artifactId>
|
||||
<version>2.0.0-b709</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -76,10 +76,15 @@ public class PlayerData extends SynchronizedDataHolder implements Closeable {
|
||||
return mmoData;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public UUID getUniqueId() {
|
||||
return mmoData.getUniqueId();
|
||||
}
|
||||
|
||||
public UUID getProfileId() {
|
||||
return mmoData.getProfileId();
|
||||
}
|
||||
|
||||
public boolean isOnline() {
|
||||
return mmoData.isOnline();
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ public class MMOCoreHook implements RPGHandler, Listener {
|
||||
public MMOCoreRPGPlayer(PlayerData playerData) {
|
||||
super(playerData);
|
||||
|
||||
data = net.Indyuce.mmocore.api.player.PlayerData.get(playerData.getUniqueId());
|
||||
data = net.Indyuce.mmocore.api.player.PlayerData.get(playerData.getPlayer());
|
||||
}
|
||||
|
||||
public net.Indyuce.mmocore.api.player.PlayerData getData() {
|
||||
|
@ -30,7 +30,7 @@ public class AttributeCondition extends Condition {
|
||||
|
||||
@Override
|
||||
public boolean isMet(net.Indyuce.mmoitems.api.player.PlayerData data) {
|
||||
return PlayerData.get(data.getUniqueId()).getAttributes().getAttribute(attribute) >= points;
|
||||
return PlayerData.get(data.getPlayer()).getAttributes().getAttribute(attribute) >= points;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,8 +31,8 @@ public class ExperienceCraftingTrigger extends Trigger {
|
||||
@Override
|
||||
public void whenCrafting(net.Indyuce.mmoitems.api.player.PlayerData data) {
|
||||
if (profession == null)
|
||||
PlayerData.get(data.getUniqueId()).giveExperience(amount, EXPSource.SOURCE);
|
||||
PlayerData.get(data.getPlayer()).giveExperience(amount, EXPSource.SOURCE);
|
||||
else
|
||||
PlayerData.get(data.getUniqueId()).getCollectionSkills().giveExperience(profession, amount, EXPSource.SOURCE);
|
||||
PlayerData.get(data.getPlayer()).getCollectionSkills().giveExperience(profession, amount, EXPSource.SOURCE);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class ProfessionCondition extends Condition {
|
||||
|
||||
@Override
|
||||
public boolean isMet(net.Indyuce.mmoitems.api.player.PlayerData data) {
|
||||
return PlayerData.get(data.getUniqueId()).getCollectionSkills().getLevel(profession) >= level;
|
||||
return PlayerData.get(data.getPlayer()).getCollectionSkills().getLevel(profession) >= level;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,7 +16,7 @@ public class StelliumCondition extends Condition {
|
||||
|
||||
@Override
|
||||
public boolean isMet(PlayerData data) {
|
||||
return net.Indyuce.mmocore.api.player.PlayerData.get(data.getUniqueId()).getStellium() >= amount;
|
||||
return net.Indyuce.mmocore.api.player.PlayerData.get(data.getPlayer()).getStellium() >= amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -26,6 +26,6 @@ public class StelliumCondition extends Condition {
|
||||
|
||||
@Override
|
||||
public void whenCrafting(PlayerData data) {
|
||||
net.Indyuce.mmocore.api.player.PlayerData.get(data.getUniqueId()).giveStellium(-amount);
|
||||
net.Indyuce.mmocore.api.player.PlayerData.get(data.getPlayer()).giveStellium(-amount);
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class ItemTemplateDropItem extends ItemGenerationDropItem {
|
||||
|
||||
@Override
|
||||
public void collect(LootBuilder builder) {
|
||||
RPGPlayer rpgPlayer = PlayerData.get(builder.getEntity().getUniqueId()).getRPG();
|
||||
RPGPlayer rpgPlayer = PlayerData.get(builder.getEntity().getPlayer()).getRPG();
|
||||
MMOItem mmoitem = rollMMOItem(template, rpgPlayer);
|
||||
|
||||
if (rollSoulbound())
|
||||
|
@ -32,7 +32,7 @@ public class MMOItemTrigger extends Trigger {
|
||||
|
||||
@Override
|
||||
public void apply(PlayerData player) {
|
||||
ItemStack item = template.newBuilder(net.Indyuce.mmoitems.api.player.PlayerData.get(player.getUniqueId()).getRPG()).build().newBuilder().build();
|
||||
ItemStack item = template.newBuilder(net.Indyuce.mmoitems.api.player.PlayerData.get(player.getPlayer()).getRPG()).build().newBuilder().build();
|
||||
item.setAmount(amount);
|
||||
new SmartGive(player.getPlayer()).give(item);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class RandomItemDropItem extends ItemGenerationDropItem {
|
||||
|
||||
@Override
|
||||
public void collect(LootBuilder builder) {
|
||||
RPGPlayer rpgPlayer = PlayerData.get(builder.getEntity().getUniqueId()).getRPG();
|
||||
RPGPlayer rpgPlayer = PlayerData.get(builder.getEntity().getPlayer()).getRPG();
|
||||
|
||||
TemplateExplorer explorer = new TemplateExplorer();
|
||||
if (matchClass)
|
||||
|
@ -14,7 +14,7 @@ public class RacesAndClassesHook implements RPGHandler, Listener {
|
||||
|
||||
@Override
|
||||
public void refreshStats(PlayerData data) {
|
||||
RaCPlayer info = RaCPlayerManager.get().getPlayer(data.getUniqueId());
|
||||
RaCPlayer info = RaCPlayerManager.get().getPlayer(data.getPlayer());
|
||||
info.getManaManager().removeMaxManaBonus("MMOItems");
|
||||
info.getManaManager().addMaxManaBonus("MMOItems", data.getStats().getStat(ItemStats.MAX_MANA));
|
||||
}
|
||||
|
@ -35,19 +35,19 @@ public class SkillsProHook implements RPGHandler, Listener {
|
||||
|
||||
@Override
|
||||
public int getLevel() {
|
||||
SkilledPlayer info = SkillsPro.get().getPlayerDataManager().getData(getPlayerData().getUniqueId());
|
||||
SkilledPlayer info = SkillsPro.get().getPlayerDataManager().getData(getPlayerData().getPlayer().getUniqueId());
|
||||
return info.getLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClassName() {
|
||||
SkilledPlayer info = SkillsPro.get().getPlayerDataManager().getData(getPlayerData().getUniqueId());
|
||||
SkilledPlayer info = SkillsPro.get().getPlayerDataManager().getData(getPlayerData().getPlayer().getUniqueId());
|
||||
return ChatColor.stripColor(info.getSkill().getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMana() {
|
||||
SkilledPlayer info = SkillsPro.get().getPlayerDataManager().getData(getPlayerData().getUniqueId());
|
||||
SkilledPlayer info = SkillsPro.get().getPlayerDataManager().getData(getPlayerData().getPlayer().getUniqueId());
|
||||
return info.getEnergy();
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ public class SkillsProHook implements RPGHandler, Listener {
|
||||
|
||||
@Override
|
||||
public void setMana(double value) {
|
||||
SkilledPlayer info = SkillsPro.get().getPlayerDataManager().getData(getPlayerData().getUniqueId());
|
||||
SkilledPlayer info = SkillsPro.get().getPlayerDataManager().getData(getPlayerData().getPlayer().getUniqueId());
|
||||
info.setEnergy(value);
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ public class AbilityData extends Skill {
|
||||
@Override
|
||||
public boolean getResult(SkillMetadata meta) {
|
||||
|
||||
PlayerData playerData = PlayerData.get(meta.getCaster().getData().getUniqueId());
|
||||
PlayerData playerData = PlayerData.get(meta.getCaster().getPlayer());
|
||||
RPGPlayer rpgPlayer = playerData.getRPG();
|
||||
Player player = meta.getCaster().getPlayer();
|
||||
|
||||
@ -124,7 +124,7 @@ public class AbilityData extends Skill {
|
||||
|
||||
@Override
|
||||
public void whenCast(SkillMetadata meta) {
|
||||
PlayerData playerData = PlayerData.get(meta.getCaster().getData().getUniqueId());
|
||||
PlayerData playerData = PlayerData.get(meta.getCaster().getPlayer());
|
||||
RPGPlayer rpgPlayer = playerData.getRPG();
|
||||
|
||||
// Apply mana cost
|
||||
|
@ -26,6 +26,7 @@
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.18-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- MMOItems API -->
|
||||
@ -40,7 +41,7 @@
|
||||
<dependency>
|
||||
<groupId>fr.phoenixdevt</groupId>
|
||||
<artifactId>Profile-API</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>1.1</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
@ -1,6 +1,6 @@
|
||||
package net.Indyuce.mmoitems.listener;
|
||||
|
||||
import fr.phoenixdevt.profile.event.ProfileSelectEvent;
|
||||
import fr.phoenixdevt.profiles.event.ProfileSelectEvent;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
Loading…
Reference in New Issue
Block a user