Skip to content

Commit

Permalink
Merge pull request #2 from RAVINGAR/main
Browse files Browse the repository at this point in the history
Main
  • Loading branch information
NathanWolf authored Sep 7, 2022
2 parents 22c5078 + 3e80764 commit 7535f31
Show file tree
Hide file tree
Showing 13 changed files with 440 additions and 360 deletions.
58 changes: 31 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?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">
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>com.elmakers.mine.bukkit</groupId>
<artifactId>HeroesHotbar</artifactId>
<version>2.0</version>
<version>3.0</version>

<name>Heroes Hotbar</name>
<description>A hotbar GUI add-on to the Heroes Bukkit plugin</description>
Expand All @@ -14,14 +14,14 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.java>1.8</version.java>
<bukkit.version>1.16.5-R0.1-SNAPSHOT</bukkit.version>
<version.java>11</version.java>
<spigot.version>1.18.2-R0.1-SNAPSHOT</spigot.version>
</properties>

<licenses>
<license>
<name>MIT License</name>
<url>LICENSE</url>
<name>MIT License</name>
<url>LICENSE</url>
</license>
</licenses>

Expand Down Expand Up @@ -50,7 +50,7 @@
<snapshotRepository>
<id>maven.elmakers.com</id>
<url>http://maven.elmakers.com/repository/</url>
</snapshotRepository>
</snapshotRepository>
</distributionManagement>

<repositories>
Expand All @@ -59,42 +59,46 @@
<url>http://maven.elmakers.com/repository/</url>
</repository>

<repository>
<id>heroes-repo</id>
<url>https://nexus.hc.to/content/repositories/pub_releases/</url>
</repository>

<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>${bukkit.version}</version>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>

<!-- Heroes from local jar -->
<dependency>
<groupId>com.herocraftonline.heroes</groupId>
<artifactId>Heroes</artifactId>
<version>1.8.13-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Heroes.jar</systemPath>
</dependency>
<!-- Heroes from local jar -->
<dependency>
<groupId>com.herocraftonline.heroes</groupId>
<artifactId>Heroes</artifactId>
<version>1.9.19-RELEASE</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<version>3.8.0</version>
<configuration>
<source>${version.java}</source>
<target>${version.java}</target>
Expand All @@ -106,7 +110,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package com.elmakers.mine.bukkit.heroes;

import com.elmakers.mine.bukkit.heroes.command.GiveSkillCommandExecutor;
import com.elmakers.mine.bukkit.heroes.command.SkillsMenuCommandExecutor;
import com.elmakers.mine.bukkit.heroes.controller.HotbarController;
import com.elmakers.mine.bukkit.heroes.listener.InventoryListener;
import com.elmakers.mine.bukkit.heroes.listener.PlayerListener;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandExecutor;
Expand Down
116 changes: 0 additions & 116 deletions src/main/java/com/elmakers/mine/bukkit/heroes/MaterialAndData.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.elmakers.mine.bukkit.heroes;
package com.elmakers.mine.bukkit.heroes.command;

import com.elmakers.mine.bukkit.heroes.controller.HotbarController;
import com.elmakers.mine.bukkit.heroes.controller.SkillDescription;
import com.herocraftonline.heroes.characters.skill.PassiveSkill;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
Expand All @@ -26,11 +29,11 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
return true;
}
if (!(sender instanceof Player) && args.length <= 1) {
sender.sendMessage(ChatColor.RED + "Console Usage: giveskill <player> <skill>");
sender.sendMessage(ChatColor.RED + "Console Usage: /giveskill <player> <skill>");
return true;
}
if (args.length <= 0) {
sender.sendMessage(ChatColor.RED + "Usage: giveskill [player] <skill>");
sender.sendMessage(ChatColor.RED + "Usage: /giveskill <player> <skill> or /giveskill <skill>");
return true;
}

Expand All @@ -44,13 +47,18 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}

String skillName = args.length > 1 ? args[1] : args[0];
SkillDescription skillDescription = new SkillDescription(controller, player, skillName);
if (!skillDescription.isValid()) {

SkillDescription skillDescription = controller.getSkillDescription(player, skillName);
if (skillDescription == null || !skillDescription.isValid()) {
sender.sendMessage(ChatColor.RED + "Unknown skill: " + skillName);
return true;
}
if(skillDescription.getSkill() instanceof PassiveSkill) {
sender.sendMessage(ChatColor.RED + "You cannot give a passive skill to a player!");
return true;
}

ItemStack item = controller.createSkillItem(skillDescription, player);
ItemStack item = skillDescription.getIcon();
player.getInventory().addItem(item);
sender.sendMessage(ChatColor.LIGHT_PURPLE + "Gave skill " + skillName + " to " + player.getName());
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.elmakers.mine.bukkit.heroes;
package com.elmakers.mine.bukkit.heroes.command;

import com.elmakers.mine.bukkit.heroes.controller.SkillSelector;
import com.elmakers.mine.bukkit.heroes.controller.HotbarController;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down Expand Up @@ -43,7 +45,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}

private void showSkillsMenu(Player player, int page) {
SkillSelector selector = new SkillSelector(controller, player);
SkillSelector selector = controller.getActiveSkillSelector(player);
selector.setPage(page);
selector.openInventory();
}
Expand Down
Loading

0 comments on commit 7535f31

Please sign in to comment.