Skip to content

Commit 279a808

Browse files
committed
fix quiver bug #122 and rewrites
1 parent 679a6b2 commit 279a808

File tree

9 files changed

+214
-217
lines changed

9 files changed

+214
-217
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>ne.fnfal113</groupId>
88
<artifactId>FNAmplifications</artifactId>
9-
<version>Unoffical-4.1.9</version>
9+
<version>Unoffical-4.2.1</version>
1010
<packaging>jar</packaging>
1111

1212
<name>FNAmplifications</name>

src/main/java/ne/fnfal113/fnamplifications/quivers/Quiver.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
66
import ne.fnfal113.fnamplifications.quivers.abstracts.AbstractQuiver;
77
import ne.fnfal113.fnamplifications.utils.Keys;
8+
9+
import org.bukkit.Material;
810
import org.bukkit.inventory.ItemStack;
911

1012
public class Quiver extends AbstractQuiver {
1113

12-
public Quiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize, ItemStack arrowType) {
13-
super(itemGroup, item, recipeType, recipe, Keys.ARROWS_KEY, Keys.ARROWS_ID_KEY, Keys.QUIVER_STATE_KEY, quiverSize, arrowType);
14+
public Quiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize) {
15+
super(itemGroup, item, recipeType, recipe, Keys.ARROWS_KEY, Keys.ARROWS_ID_KEY, Keys.QUIVER_STATE_KEY, quiverSize, new ItemStack(Material.ARROW, 1));
1416
}
1517

1618
}

src/main/java/ne/fnfal113/fnamplifications/quivers/SpectralQuiver.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
66
import ne.fnfal113.fnamplifications.quivers.abstracts.AbstractQuiver;
77
import ne.fnfal113.fnamplifications.utils.Keys;
8+
9+
import org.bukkit.Material;
810
import org.bukkit.inventory.ItemStack;
911

1012
public class SpectralQuiver extends AbstractQuiver {
1113

12-
public SpectralQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize, ItemStack arrowType) {
13-
super(itemGroup, item, recipeType, recipe, Keys.SPECTRAL_ARROWS_KEY, Keys.SPECTRAL_ARROWS_ID_KEY, Keys.SPECTRAL_STATE_KEY,
14-
quiverSize, arrowType);
14+
public SpectralQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize) {
15+
super(itemGroup, item, recipeType, recipe, Keys.SPECTRAL_ARROWS_KEY, Keys.SPECTRAL_ARROWS_ID_KEY, Keys.SPECTRAL_STATE_KEY, quiverSize, new ItemStack(Material.SPECTRAL_ARROW, 1));
1516
}
1617

1718
}

src/main/java/ne/fnfal113/fnamplifications/quivers/UpgradedQuiver.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
66
import ne.fnfal113.fnamplifications.quivers.abstracts.AbstractQuiver;
77
import ne.fnfal113.fnamplifications.utils.Keys;
8+
9+
import org.bukkit.Material;
810
import org.bukkit.inventory.ItemStack;
911

1012
public class UpgradedQuiver extends AbstractQuiver {
1113

12-
13-
14-
public UpgradedQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize, ItemStack arrowType) {
15-
super(itemGroup, item, recipeType, recipe, Keys.UPGRADED_ARROWS_KEY, Keys.UPGRADED_ARROWS_ID_KEY, Keys.UPGRADED_QUIVER_STATE_KEY,
16-
quiverSize, arrowType);
14+
public UpgradedQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize) {
15+
super(itemGroup, item, recipeType, recipe, Keys.UPGRADED_ARROWS_KEY, Keys.UPGRADED_ARROWS_ID_KEY, Keys.UPGRADED_QUIVER_STATE_KEY, quiverSize, new ItemStack(Material.ARROW, 1));
1716
}
1817

19-
2018
}

src/main/java/ne/fnfal113/fnamplifications/quivers/UpgradedSpectralQuiver.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
66
import ne.fnfal113.fnamplifications.quivers.abstracts.AbstractQuiver;
77
import ne.fnfal113.fnamplifications.utils.Keys;
8+
9+
import org.bukkit.Material;
810
import org.bukkit.inventory.ItemStack;
911

1012
public class UpgradedSpectralQuiver extends AbstractQuiver {
1113

12-
public UpgradedSpectralQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize, ItemStack arrowType) {
13-
super(itemGroup, item, recipeType, recipe, Keys.UPGRADED_SPECTRAL_ARROWS_KEY, Keys.UPGRADED_SPECTRAL_ARROWS_ID_KEY, Keys.UPGRADED_SPECTRAL_QUIVER_STATE_KEY,
14-
quiverSize, arrowType);
14+
public UpgradedSpectralQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize) {
15+
super(itemGroup, item, recipeType, recipe, Keys.UPGRADED_SPECTRAL_ARROWS_KEY, Keys.UPGRADED_SPECTRAL_ARROWS_ID_KEY, Keys.UPGRADED_SPECTRAL_QUIVER_STATE_KEY, quiverSize, new ItemStack(Material.SPECTRAL_ARROW, 1));
1516
}
1617

1718
}

src/main/java/ne/fnfal113/fnamplifications/quivers/abstracts/AbstractQuiver.java

+15-10
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,33 @@
1717
public abstract class AbstractQuiver extends SlimefunItem {
1818

1919
@Getter
20-
private final NamespacedKey storageKey;
20+
private final NamespacedKey storedArrowsKey;
21+
2122
@Getter
22-
private final NamespacedKey storageKey2;
23+
private final NamespacedKey randomIdKey;
24+
2325
@Getter
24-
private final NamespacedKey storageKey3;
25-
@Getter
26-
private final QuiverTask quiverTask;
26+
private final NamespacedKey stateKey;
27+
2728
@Getter
2829
private final int quiverSize;
30+
2931
@Getter
3032
private final ItemStack arrowType;
3133

34+
@Getter
35+
private final QuiverTask quiverTask;
36+
3237
public AbstractQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe,
33-
NamespacedKey arrowKey, NamespacedKey arrowIDKey, NamespacedKey quiverStateKey, int quiverSize, ItemStack arrowType) {
38+
NamespacedKey storedArrowKey, NamespacedKey randomIdKey, NamespacedKey stateKey, int quiverSize, ItemStack arrowType) {
3439
super(itemGroup, item, recipeType, recipe);
3540

36-
this.storageKey = arrowKey;
37-
this.storageKey2 = arrowIDKey;
38-
this.storageKey3 = quiverStateKey;
41+
this.storedArrowsKey = storedArrowKey;
42+
this.randomIdKey = randomIdKey;
43+
this.stateKey = stateKey;
3944
this.quiverSize = quiverSize;
4045
this.arrowType = arrowType;
41-
this.quiverTask = new QuiverTask(arrowKey, arrowIDKey, quiverStateKey, getQuiverSize(), getArrowType(), item);
46+
this.quiverTask = new QuiverTask(this);
4247
}
4348

4449
}

0 commit comments

Comments
 (0)