This commit is contained in:
ASangarin 2020-09-12 20:41:48 +02:00
commit a56375a556
5 changed files with 174 additions and 161 deletions

View File

@ -1 +1,4 @@
![eclipse_SEyunr6cEZ](/uploads/4537bd2ada7d70653c7e26a0efc88565/eclipse_SEyunr6cEZ.png) Private repository for MMOCore.
Issues: https://git.lumine.io/mythiccraft/mmocore/-/issues
Wiki: https://git.lumine.io/mythiccraft/mmocore/-/wikis/home

Binary file not shown.

Binary file not shown.

32
pom.xml
View File

@ -69,28 +69,44 @@
</repositories> </repositories>
<dependencies> <dependencies>
<!-- MMOs -->
<dependency> <dependency>
<groupId>net.Indyuce</groupId> <groupId>net.Indyuce</groupId>
<artifactId>mmoitems</artifactId> <artifactId>mmoitems</artifactId>
<version>5.1.2</version> <version>6.1.2</version>
<scope>system</scope> <scope>system</scope>
<systemPath>${basedir}/lib/MMOItems.jar</systemPath> <systemPath>${basedir}/lib/MMOItems.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.Indyuce</groupId> <groupId>net.Indyuce</groupId>
<artifactId>MMOLib</artifactId> <artifactId>MMOLib</artifactId>
<version>1.0</version> <version>1.3</version>
<scope>system</scope> <scope>system</scope>
<systemPath>${basedir}/lib/MMOLib.jar</systemPath> <systemPath>${basedir}/lib/MMOLib.jar</systemPath>
</dependency> </dependency>
<!-- Minecraft -->
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.14.4</version> <version>1.12-R1-1.16-R2</version>
<scope>system</scope> <scope>system</scope>
<systemPath>${basedir}/lib/spigot.jar</systemPath> <systemPath>${basedir}/lib/spigot.jar</systemPath>
</dependency> </dependency>
<!-- APIs -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>19.0.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.41</version>
</dependency>
<!-- Other Plugins -->
<dependency> <dependency>
<groupId>com.bekvon.bukkit</groupId> <groupId>com.bekvon.bukkit</groupId>
<artifactId>Residence</artifactId> <artifactId>Residence</artifactId>
@ -145,11 +161,6 @@
<scope>system</scope> <scope>system</scope>
<systemPath>${basedir}/lib/Citizens.jar</systemPath> <systemPath>${basedir}/lib/Citizens.jar</systemPath>
</dependency> </dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.41</version>
</dependency>
<dependency> <dependency>
<groupId>me.clip</groupId> <groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId> <artifactId>placeholderapi</artifactId>
@ -157,10 +168,5 @@
<scope>system</scope> <scope>system</scope>
<systemPath>${basedir}/lib/PlaceholderAPI.jar</systemPath> <systemPath>${basedir}/lib/PlaceholderAPI.jar</systemPath>
</dependency> </dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>19.0.0</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -1,6 +1,7 @@
package net.Indyuce.mmocore.listener; package net.Indyuce.mmocore.listener;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -47,7 +48,10 @@ public class PartyListener implements Listener {
*/ */
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void b(PlayerAttackEvent event) { public void b(PlayerAttackEvent event) {
if (event.getEntity() instanceof Player) { LivingEntity entity = event.getEntity();
if (entity instanceof Player) {
if (entity.hasMetadata("NPC"))
return;
PlayerData targetData = PlayerData.get((Player) event.getEntity()); PlayerData targetData = PlayerData.get((Player) event.getEntity());
if (targetData.hasParty() && targetData.getParty().getMembers().has(event.getData().getMMOCore())) if (targetData.hasParty() && targetData.getParty().getMembers().has(event.getData().getMMOCore()))
event.setCancelled(true); event.setCancelled(true);