Maven |
ajh123 opened this issue ยท 9 comments
My browser crashed while submitting, so
When i build using maven (what IntelliJ uses) it cant find the Economy class, even though i've imported it
In my code
private boolean setupEconomy() {
if (this.getServer().getPluginManager().getPlugin("Vault") == null)
return false;
econ = new SE_Economy(this);
/ \ heres the problem
this.getServer().getServicesManager().register(Economy.class, econ, this.getServer().getPluginManager().getPlugin("Vault"), ServicePriority.Normal);
return true;
}
Also in my class that implements Economy
package samuelh2005.survessentails;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.OfflinePlayer;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.List;
public class SE_Economy implements Economy {
public JavaPlugin plug;
public SE_Economy(JavaPlugin plugin) {
this.plug = plugin;
}
@Override
public boolean isEnabled() {
return this.plug.getConfig().getBoolean("features.economy");
}
@Override
public String getName() {
return "SE Economy";
}
@Override
public boolean hasBankSupport() {
return false;
}
@Override
public int fractionalDigits() {
return 0;
}
@Override
public String format(double v) {
return null;
}
@Override
public String currencyNamePlural() {
return null;
}
@Override
public String currencyNameSingular() {
return null;
}
@Override
public boolean hasAccount(String s) {
return false;
}
@Override
public boolean hasAccount(OfflinePlayer offlinePlayer) {
return false;
}
@Override
public boolean hasAccount(String s, String s1) {
return false;
}
@Override
public boolean hasAccount(OfflinePlayer offlinePlayer, String s) {
return false;
}
@Override
public double getBalance(String s) {
return 0;
}
@Override
public double getBalance(OfflinePlayer offlinePlayer) {
return 0;
}
@Override
public double getBalance(String s, String s1) {
return 0;
}
@Override
public double getBalance(OfflinePlayer offlinePlayer, String s) {
return 0;
}
@Override
public boolean has(String s, double v) {
return false;
}
@Override
public boolean has(OfflinePlayer offlinePlayer, double v) {
return false;
}
@Override
public boolean has(String s, String s1, double v) {
return false;
}
@Override
public boolean has(OfflinePlayer offlinePlayer, String s, double v) {
return false;
}
@Override
public EconomyResponse withdrawPlayer(String s, double v) {
return null;
}
@Override
public EconomyResponse withdrawPlayer(OfflinePlayer offlinePlayer, double v) {
return null;
}
@Override
public EconomyResponse withdrawPlayer(String s, String s1, double v) {
return null;
}
@Override
public EconomyResponse withdrawPlayer(OfflinePlayer offlinePlayer, String s, double v) {
return null;
}
@Override
public EconomyResponse depositPlayer(String s, double v) {
return null;
}
@Override
public EconomyResponse depositPlayer(OfflinePlayer offlinePlayer, double v) {
return null;
}
@Override
public EconomyResponse depositPlayer(String s, String s1, double v) {
return null;
}
@Override
public EconomyResponse depositPlayer(OfflinePlayer offlinePlayer, String s, double v) {
return null;
}
@Override
public EconomyResponse createBank(String s, String s1) {
return null;
}
@Override
public EconomyResponse createBank(String s, OfflinePlayer offlinePlayer) {
return null;
}
@Override
public EconomyResponse deleteBank(String s) {
return null;
}
@Override
public EconomyResponse bankBalance(String s) {
return null;
}
@Override
public EconomyResponse bankHas(String s, double v) {
return null;
}
@Override
public EconomyResponse bankWithdraw(String s, double v) {
return null;
}
@Override
public EconomyResponse bankDeposit(String s, double v) {
return null;
}
@Override
public EconomyResponse isBankOwner(String s, String s1) {
return null;
}
@Override
public EconomyResponse isBankOwner(String s, OfflinePlayer offlinePlayer) {
return null;
}
@Override
public EconomyResponse isBankMember(String s, String s1) {
return null;
}
@Override
public EconomyResponse isBankMember(String s, OfflinePlayer offlinePlayer) {
return null;
}
@Override
public List<String> getBanks() {
return null;
}
@Override
public boolean createPlayerAccount(String s) {
return false;
}
@Override
public boolean createPlayerAccount(OfflinePlayer offlinePlayer) {
return false;
}
@Override
public boolean createPlayerAccount(String s, String s1) {
return false;
}
@Override
public boolean createPlayerAccount(OfflinePlayer offlinePlayer, String s) {
return false;
}
}
For all the methods tagged with @Override
it says method does not override or implement a method from a supertype
And what is your pom? Are you sure you have both the correct dependency and the correct repository used?
Ahh didn't know about the pom.xml ,and this is it.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>surv-essentails</groupId>
<artifactId>surv-essentails</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Survival_Essentials</name>
<description>Adds stuff</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<url>minersonline.ddns.net/plugins/samuelh2005/surv-essen</url>
<build>
<defaultGoal>clean package</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Yep, that's what is at fault.
First of all, you don't want to add Vault itself to your plugin, but the Vault-API as seen at https://github.com/MilkBowl/VaultAPI.
The readme there has more information on this topic