Skip to content

Commit 07aa4f4

Browse files
committed
Update to 1.13.1
Fix deprecated methods Remove SoundCompat
1 parent e262759 commit 07aa4f4

File tree

12 files changed

+105
-682
lines changed

12 files changed

+105
-682
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#gitignore
2-
*.xml
3-
target/*
2+
target/
3+
out/
4+
.idea/
45
*.iml

pom.xml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>me.Fupery.StandsPlus</groupId>
8+
<artifactId>StandsPlus</artifactId>
9+
<version>1.0</version>
10+
11+
<name>StandsPlus</name>
12+
<description>Manipulate armorstands in-game</description>
13+
14+
<properties>
15+
<author>Fupery</author>
16+
</properties>
17+
18+
<build>
19+
<finalName>${project.name}</finalName>
20+
<resources>
21+
<resource>
22+
<directory>src/main/resources</directory>
23+
<filtering>true</filtering>
24+
</resource>
25+
</resources>
26+
<plugins>
27+
<plugin>
28+
<groupId>org.apache.maven.plugins</groupId>
29+
<artifactId>maven-compiler-plugin</artifactId>
30+
<version>3.2</version>
31+
<configuration>
32+
<source>1.8</source>
33+
<target>1.8</target>
34+
<encoding>UTF-8</encoding>
35+
</configuration>
36+
</plugin>
37+
<plugin>
38+
<groupId>org.apache.maven.plugins</groupId>
39+
<artifactId>maven-jar-plugin</artifactId>
40+
<version>3.0.0</version>
41+
<configuration>
42+
<outputDirectory>out/artifacts</outputDirectory>
43+
</configuration>
44+
</plugin>
45+
</plugins>
46+
</build>
47+
48+
<dependencies>
49+
<dependency>
50+
<groupId>org.spigotmc</groupId>
51+
<artifactId>spigot-api</artifactId>
52+
<version>1.13.1-R0.1-SNAPSHOT</version>
53+
<scope>provided</scope>
54+
</dependency>
55+
56+
<dependency>
57+
<groupId>org.bukkit</groupId>
58+
<artifactId>bukkit</artifactId>
59+
<version>1.13.1-R0.1-SNAPSHOT</version>
60+
<scope>provided</scope>
61+
</dependency>
62+
</dependencies>
63+
64+
<repositories>
65+
<repository>
66+
<id>spigot-repo</id>
67+
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
68+
</repository>
69+
</repositories>
70+
</project>

src/main/java/me/Fupery/StandsPlus/Event/PlayerInteractListener.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import me.Fupery.StandsPlus.Recipe.StandKey;
55
import me.Fupery.StandsPlus.StandsPlus;
66
import me.Fupery.StandsPlus.Utils.SoundCompat;
7+
import org.bukkit.Sound;
78
import org.bukkit.entity.ArmorStand;
89
import org.bukkit.entity.Entity;
910
import org.bukkit.entity.EntityType;
@@ -31,7 +32,7 @@ public PlayerInteractListener(StandsPlus plugin) {
3132

3233
@EventHandler
3334
public void onPlayerInteract(PlayerInteractEvent event) {
34-
if (StandKey.isValidMaterial(event.getPlayer().getItemInHand())) {
35+
if (StandKey.isValidMaterial(event.getPlayer().getInventory().getItemInMainHand())) {
3536
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
3637
event.setCancelled(true);
3738
}
@@ -43,7 +44,7 @@ public void onPlayerDamageEntity(EntityDamageByEntityEvent event) {
4344
if (event.getDamager() instanceof Player && checkValidStand(event.getEntity())) {
4445
Player player = ((Player) event.getDamager());
4546
ArmorStand stand = ((ArmorStand) event.getEntity());
46-
if (StandKey.isValidMaterial(player.getItemInHand())) {
47+
if (StandKey.isValidMaterial(player.getInventory().getItemInMainHand())) {
4748
event.setCancelled(true);
4849
Vector vecDiff = stand.getLocation().toVector().subtract(player.getLocation().toVector());
4950
Vector vector = vecDiff.normalize().multiply(.1);
@@ -72,10 +73,10 @@ private boolean checkValidStand(Entity entity) {
7273

7374
private void handleClick(Cancellable event, Player player, Entity clicked) {
7475
if (!event.isCancelled() && checkValidStand(clicked)
75-
&& StandKey.isValidMaterial(player.getItemInHand())) {
76+
&& StandKey.isValidMaterial(player.getInventory().getItemInMainHand())) {
7677
event.setCancelled(true);
7778
new StandMenu(plugin, ((ArmorStand) clicked)).open(plugin, player);
78-
SoundCompat.BLOCK_WOOD_BUTTON_CLICK_ON.play(player);
79+
new SoundCompat(Sound.BLOCK_WOODEN_BUTTON_CLICK_ON).play(player);
7980
}
8081
}
8182
}

src/main/java/me/Fupery/StandsPlus/GUI/API/MenuButton.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import me.Fupery.StandsPlus.Utils.SoundCompat;
44
import org.bukkit.Bukkit;
55
import org.bukkit.Material;
6+
import org.bukkit.Sound;
67
import org.bukkit.entity.Player;
78
import org.bukkit.event.inventory.ClickType;
89
import org.bukkit.inventory.ItemStack;
@@ -42,7 +43,7 @@ public LinkedButton(InventoryMenu linkedMenu, Material type, String... text) {
4243

4344
@Override
4445
public void onClick(JavaPlugin plugin, Player player, ClickType click) {
45-
SoundCompat.UI_BUTTON_CLICK.play(player);
46+
new SoundCompat(Sound.UI_BUTTON_CLICK).play(player);
4647
linkedMenu.open(plugin, player);
4748
}
4849
}
@@ -76,7 +77,7 @@ public void run() {
7677

7778
if (menu.parent != null) {
7879
menu.parent.open(plugin, player);
79-
SoundCompat.UI_BUTTON_CLICK.play(player, 1, 3);
80+
new SoundCompat(Sound.UI_BUTTON_CLICK).play(player, 1, 3);
8081
}
8182
}
8283
});

src/main/java/me/Fupery/StandsPlus/GUI/PartMenu.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.bukkit.Bukkit;
99
import org.bukkit.ChatColor;
1010
import org.bukkit.Material;
11+
import org.bukkit.Sound;
1112
import org.bukkit.entity.ArmorStand;
1213
import org.bukkit.entity.Player;
1314
import org.bukkit.event.inventory.ClickType;
@@ -117,7 +118,7 @@ public void onClick(JavaPlugin plugin, Player player, ClickType click) {
117118
updateAngle(axis, shift);
118119
updateButton();
119120
updateInventory(plugin, player);
120-
SoundCompat.UI_BUTTON_CLICK.play(player);
121+
new SoundCompat(Sound.UI_BUTTON_CLICK).play(player);
121122
});
122123
}
123124
}

src/main/java/me/Fupery/StandsPlus/GUI/StandMenu.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package me.Fupery.StandsPlus.GUI;
22

3-
43
import me.Fupery.StandsPlus.GUI.API.InventoryMenu;
54
import me.Fupery.StandsPlus.GUI.API.MenuButton;
65
import me.Fupery.StandsPlus.StandsPlus;
@@ -9,6 +8,7 @@
98
import me.Fupery.StandsPlus.Utils.StandPart;
109
import org.bukkit.ChatColor;
1110
import org.bukkit.Material;
11+
import org.bukkit.Sound;
1212
import org.bukkit.enchantments.Enchantment;
1313
import org.bukkit.entity.ArmorStand;
1414
import org.bukkit.entity.Player;
@@ -153,7 +153,7 @@ public void onClick(JavaPlugin plugin, Player player, ClickType click) {
153153
property.apply(stand, value);
154154
updateButton();
155155
updateInventory(plugin, player);
156-
SoundCompat.UI_BUTTON_CLICK.play(player);
156+
new SoundCompat(Sound.UI_BUTTON_CLICK).play(player);
157157
}
158158

159159
void updateButton() {

src/main/java/me/Fupery/StandsPlus/GUI/StandProperty.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
enum StandProperty {
99
VISIBLE(Lang.VISIBLE.message(), Lang.VISIBLE_DESCRIPTION.message(), Material.GLASS_BOTTLE),
1010
GRAVITY(Lang.GRAVITY.message(), Lang.GRAVITY_DESCRIPTION.message(), Material.FEATHER),
11-
BASEPLATE(Lang.BASEPLATE.message(), Lang.BASEPLATE_DESCRIPTION.message(), Material.STONE_PLATE),
11+
BASEPLATE(Lang.BASEPLATE.message(), Lang.BASEPLATE_DESCRIPTION.message(), Material.STONE_PRESSURE_PLATE),
1212
ARMS(Lang.ARMS.message(), Lang.ARMS_DESCRIPTION.message(), Material.STICK),
1313
SMALL(Lang.SMALL.message(), Lang.SMALL_DESCRIPTION.message(), Material.EGG);
1414

src/main/java/me/Fupery/StandsPlus/Recipe/StandCrate.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
package me.Fupery.StandsPlus.Recipe;
22

3+
import me.Fupery.StandsPlus.StandsPlus;
34
import org.bukkit.Bukkit;
45
import org.bukkit.ChatColor;
56
import org.bukkit.Material;
7+
import org.bukkit.NamespacedKey;
68
import org.bukkit.enchantments.Enchantment;
79
import org.bukkit.inventory.ItemFlag;
810
import org.bukkit.inventory.ItemStack;
911
import org.bukkit.inventory.ShapedRecipe;
1012
import org.bukkit.inventory.meta.ItemMeta;
13+
import org.bukkit.plugin.java.JavaPlugin;
1114

1215
import java.util.Arrays;
1316

1417
public class StandCrate extends ItemStack {
18+
19+
private static final NamespacedKey key = new NamespacedKey(JavaPlugin.getPlugin(StandsPlus.class), "standsplus.standcrate");
1520
private static String STAND_CRATE = "§b§oStandCrate";
1621

1722
private StandCrate() {
@@ -33,9 +38,9 @@ public static boolean isValidMaterial(ItemStack itemStack) {
3338
}
3439

3540
public static void addRecipe() {
36-
ShapedRecipe recipe = new ShapedRecipe(new StandCrate());
41+
ShapedRecipe recipe = new ShapedRecipe(key, new StandCrate());
3742
recipe.shape(".w.", "sxs", ".w.");
38-
recipe.setIngredient('w', Material.WEB);
43+
recipe.setIngredient('w', Material.COBWEB);
3944
recipe.setIngredient('s', Material.SLIME_BALL);
4045
recipe.setIngredient('x', Material.TRIPWIRE_HOOK);
4146
Bukkit.addRecipe(recipe);

src/main/java/me/Fupery/StandsPlus/Recipe/StandKey.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
package me.Fupery.StandsPlus.Recipe;
22

3+
import me.Fupery.StandsPlus.StandsPlus;
34
import me.Fupery.StandsPlus.Utils.Lang;
45
import org.bukkit.Bukkit;
56
import org.bukkit.Material;
7+
import org.bukkit.NamespacedKey;
68
import org.bukkit.enchantments.Enchantment;
79
import org.bukkit.inventory.ItemFlag;
810
import org.bukkit.inventory.ItemStack;
911
import org.bukkit.inventory.ShapedRecipe;
1012
import org.bukkit.inventory.meta.ItemMeta;
13+
import org.bukkit.plugin.java.JavaPlugin;
1114

1215
import java.util.Arrays;
1316

1417
public class StandKey extends ItemStack {
18+
19+
private static final NamespacedKey key = new NamespacedKey(JavaPlugin.getPlugin(StandsPlus.class), "standsplus.standkey");
1520
private static String STAND_KEY = "§b§oStandKey";
1621

1722
private StandKey() {
@@ -32,9 +37,9 @@ public static boolean isValidMaterial(ItemStack itemStack) {
3237
}
3338

3439
public static void addRecipe() {
35-
ShapedRecipe recipe = new ShapedRecipe(new StandKey());
40+
ShapedRecipe recipe = new ShapedRecipe(key, new StandKey());
3641
recipe.shape(".w.", "sxs", ".w.");
37-
recipe.setIngredient('w', Material.WEB);
42+
recipe.setIngredient('w', Material.COBWEB);
3843
recipe.setIngredient('s', Material.SLIME_BALL);
3944
recipe.setIngredient('x', Material.TRIPWIRE_HOOK);
4045
Bukkit.addRecipe(recipe);

0 commit comments

Comments
 (0)