This commit is contained in:
Indyuce 2022-08-16 12:39:43 +02:00
parent 32ca996871
commit 706ddf6f1f
729 changed files with 10108 additions and 9881 deletions

351
MMOItems-API/pom.xml Normal file
View File

@ -0,0 +1,351 @@
<?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">
<parent>
<artifactId>MMOItems</artifactId>
<groupId>net.Indyuce</groupId>
<version>${revision}</version>
</parent>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
<artifactId>MMOItems-API</artifactId>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<build>
<finalName>${project.name}-${project.version}</finalName>
<defaultGoal>clean package install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>16</source>
<target>16</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!--
This flattens the pom.xml from the API module as well so that it can be uploaded
to Nexus. For plugins which have no API/Bukkit differenciation like MythicLib we
can just use the main plugin pom.xml file.
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.2.2</version>
<configuration>
<updatePomFile>true</updatePomFile>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>package</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>mojang</id>
<url>https://libraries.minecraft.net/</url>
</repository>
<repository>
<id>sk89q-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<repository>
<id>inventive-repo</id>
<url>https://repo.inventivetalent.org/content/groups/public/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<!-- Repository used to fetch all Spigot builds -->
<repository>
<id>spigot-repo</id>
<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>
<url>https://repo.codemc.io/repository/maven-public/</url>
</repository>
</repositories>
<!--
Order of dependencies matters in Maven because
the first wins when multiple classpaths match
-->
<dependencies>
<!-- Spigot API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-clean-plugin -->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.21</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.Indyuce</groupId>
<artifactId>MMOCore-API</artifactId>
<version>1.9.5-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.lumine</groupId>
<artifactId>MythicEnchants</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.RednedEpic</groupId>
<artifactId>PhatLoots</artifactId>
<version>4.2.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.9.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.lumine</groupId>
<artifactId>Mythic-Dist</artifactId>
<version>5.1.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
<!-- Local dependencies -->
<dependency>
<groupId>com.github.Eniripsa96</groupId>
<artifactId>SkillAPI</artifactId>
<version>master</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>n3kas</groupId>
<artifactId>ae.api</artifactId>
<version>5.7.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.black_ixx</groupId>
<artifactId>BossShop</artifactId>
<version>2.0.9</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.bekvon.bukkit.residence</groupId>
<artifactId>Residence</artifactId>
<version>4.8.7.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.herocraftonline</groupId>
<artifactId>Heroes</artifactId>
<version>1.9.22</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.gmail.nossr50</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.104</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>us.eunoians</groupId>
<artifactId>McRPG</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.baks</groupId>
<artifactId>rpl</artifactId>
<version>3.9.30</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.leothepro555</groupId>
<artifactId>skills</artifactId>
<version>12.3.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.skills.main</groupId>
<artifactId>SkillsPro</artifactId>
<version>18.9.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.robin</groupId>
<artifactId>BattleLevels</artifactId>
<version>6.9.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.arasple.mc</groupId>
<artifactId>TrHologram</artifactId>
<version>1.11</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.gmail.filoghost.holographicdisplays</groupId>
<artifactId>holographicdisplays-api</artifactId>
<version>2.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.tobiyas</groupId>
<artifactId>RacesAndClasses</artifactId>
<version>1.2.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ru.endlesscode</groupId>
<artifactId>rpginventory</artifactId>
<version>2.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sainttx.holograms</groupId>
<artifactId>Holograms</artifactId>
<version>2.9.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.archyx</groupId>
<artifactId>AureliumSkills</artifactId>
<version>1.2.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.badbones69</groupId>
<artifactId>crazyenchantments</artifactId>
<version>1.8-db9</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>Citizens</artifactId>
<version>2.0.25</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.inventivetalent</groupId>
<artifactId>glowapi</artifactId>
<version>1.4.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.denizenscript</groupId>
<artifactId>denizen</artifactId>
<version>1.2.1-b1744-REL</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.denizenscript</groupId>
<artifactId>depenizen</artifactId>
<version>2.0.0-b709</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -200,19 +200,14 @@ public class MMOItems extends JavaPlugin {
Bukkit.getPluginManager().registerEvents(entityManager, this);
Bukkit.getPluginManager().registerEvents(dropTableManager, this);
Bukkit.getPluginManager().registerEvents(new ItemUse(), this);
Bukkit.getPluginManager().registerEvents(new ItemListener(), this);
Bukkit.getPluginManager().registerEvents(new PlayerListener(), this);
Bukkit.getPluginManager().registerEvents(new CustomSoundListener(), this);
Bukkit.getPluginManager().registerEvents(new DurabilityListener(), this);
Bukkit.getPluginManager().registerEvents(new DisableInteractions(), this);
Bukkit.getPluginManager().registerEvents(new GuiListener(), this);
Bukkit.getPluginManager().registerEvents(new CustomBlockListener(), this);
if (Bukkit.getPluginManager().getPlugin("PhatLoots") != null) {
Bukkit.getPluginManager().registerEvents(new PhatLootsHook(), this);
}
Bukkit.getScheduler().runTaskTimer(this, () -> Bukkit.getOnlinePlayers().forEach(player -> PlayerData.get(player).updateStats()), 100, 20);
// Load Dist module
// Load MMOCore-Bukkit module
try {
Class.forName("net.Indyuce.mmoitems.MMOItemsBukkit").getConstructor(MMOItems.class).newInstance(this);
} catch(Throwable exception) {
throw new RuntimeException("Cannot run an API build on Spigot!");
}
/*
* This tasks updates twice a second player inventories on the server.
@ -224,7 +219,6 @@ public class MMOItems extends JavaPlugin {
PlayerData.get(player).getInventory().updateCheck();
}, 100, getConfig().getInt("inventory-update-delay"));
if (Bukkit.getPluginManager().getPlugin("mcMMO") != null) Bukkit.getPluginManager().registerEvents(new McMMONonRPGHook(), this);
/*

View File

@ -3,11 +3,9 @@ package net.Indyuce.mmoitems;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.comp.target.InteractionType;
import io.lumine.mythic.lib.skill.trigger.TriggerType;
import net.Indyuce.mmoitems.api.Type;
import org.apache.commons.codec.binary.Base64;
@ -48,22 +46,54 @@ public class MMOUtils {
}
}
public static int getPickaxePower(Player player) {
ItemStack item = player.getInventory().getItemInMainHand();
if (item != null && item.getType() != Material.AIR) {
NBTItem nbt = NBTItem.get(item);
if (nbt.hasType())
return nbt.getInteger("MMOITEMS_PICKAXE_POWER");
else {
switch (item.getType().name()) {
case "WOODEN_PICKAXE":
case "WOOD_PICKAXE":
return 5;
case "STONE_PICKAXE":
return 10;
case "GOLDEN_PICKAXE":
case "GOLD_PICKAXE":
return 15;
case "IRON_PICKAXE":
return 20;
case "DIAMOND_PICKAXE":
return 25;
case "NETHERITE_PICKAXE":
return 30;
default:
return 0;
}
}
}
return 0;
}
/**
* @param name The trigger name that may be in old format
* @return The trigger type this represents
* @throws IllegalArgumentException If this does not match any trigger type
*/
@NotNull
public static TriggerType backwardsCompatibleTriggerType(@Nullable String name) throws IllegalArgumentException {
if (name == null) { throw new IllegalArgumentException("Trigger cannot be null"); }
public static TriggerType backwardsCompatibleTriggerType(@NotNull String name) throws IllegalArgumentException {
if (name == null)
throw new IllegalArgumentException("Trigger cannot be null");
switch (name) {
case "ON_HIT": return TriggerType.ATTACK;
case "WHEN_HIT": return TriggerType.DAMAGED;
case "ON_HIT":
return TriggerType.ATTACK;
case "WHEN_HIT":
return TriggerType.DAMAGED;
default:
TriggerType trigger = TriggerType.valueOf(name);
return trigger;
return TriggerType.valueOf(name);
}
}

Some files were not shown because too many files have changed in this diff Show More