Skip to content

Commit

Permalink
Merge pull request #123 from FN-FAL113/Dev/quiver-fix-and-refactor
Browse files Browse the repository at this point in the history
quiver bug fix and rewrites
  • Loading branch information
FN-FAL113 authored Mar 10, 2024
2 parents 679a6b2 + 5eb4906 commit d1aaa97
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 223 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ne.fnfal113</groupId>
<artifactId>FNAmplifications</artifactId>
<version>Unoffical-4.1.9</version>
<version>Unoffical-4.2.1</version>
<packaging>jar</packaging>

<name>FNAmplifications</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import ne.fnfal113.fnamplifications.quivers.abstracts.AbstractQuiver;
import ne.fnfal113.fnamplifications.utils.Keys;

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

public class Quiver extends AbstractQuiver {

public Quiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize, ItemStack arrowType) {
super(itemGroup, item, recipeType, recipe, Keys.ARROWS_KEY, Keys.ARROWS_ID_KEY, Keys.QUIVER_STATE_KEY, quiverSize, arrowType);
public Quiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize) {
super(itemGroup, item, recipeType, recipe, Keys.ARROWS_KEY, Keys.ARROWS_ID_KEY, Keys.QUIVER_STATE_KEY, quiverSize, new ItemStack(Material.ARROW, 1));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import ne.fnfal113.fnamplifications.quivers.abstracts.AbstractQuiver;
import ne.fnfal113.fnamplifications.utils.Keys;

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

public class SpectralQuiver extends AbstractQuiver {

public SpectralQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize, ItemStack arrowType) {
super(itemGroup, item, recipeType, recipe, Keys.SPECTRAL_ARROWS_KEY, Keys.SPECTRAL_ARROWS_ID_KEY, Keys.SPECTRAL_STATE_KEY,
quiverSize, arrowType);
public SpectralQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize) {
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));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import ne.fnfal113.fnamplifications.quivers.abstracts.AbstractQuiver;
import ne.fnfal113.fnamplifications.utils.Keys;

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

public class UpgradedQuiver extends AbstractQuiver {



public UpgradedQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize, ItemStack arrowType) {
super(itemGroup, item, recipeType, recipe, Keys.UPGRADED_ARROWS_KEY, Keys.UPGRADED_ARROWS_ID_KEY, Keys.UPGRADED_QUIVER_STATE_KEY,
quiverSize, arrowType);
public UpgradedQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize) {
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));
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import ne.fnfal113.fnamplifications.quivers.abstracts.AbstractQuiver;
import ne.fnfal113.fnamplifications.utils.Keys;

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

public class UpgradedSpectralQuiver extends AbstractQuiver {

public UpgradedSpectralQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize, ItemStack arrowType) {
super(itemGroup, item, recipeType, recipe, Keys.UPGRADED_SPECTRAL_ARROWS_KEY, Keys.UPGRADED_SPECTRAL_ARROWS_ID_KEY, Keys.UPGRADED_SPECTRAL_QUIVER_STATE_KEY,
quiverSize, arrowType);
public UpgradedSpectralQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int quiverSize) {
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));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,33 @@
public abstract class AbstractQuiver extends SlimefunItem {

@Getter
private final NamespacedKey storageKey;
private final NamespacedKey storedArrowsKey;

@Getter
private final NamespacedKey storageKey2;
private final NamespacedKey randomIdKey;

@Getter
private final NamespacedKey storageKey3;
@Getter
private final QuiverTask quiverTask;
private final NamespacedKey stateKey;

@Getter
private final int quiverSize;

@Getter
private final ItemStack arrowType;

@Getter
private final QuiverTask quiverTask;

public AbstractQuiver(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe,
NamespacedKey arrowKey, NamespacedKey arrowIDKey, NamespacedKey quiverStateKey, int quiverSize, ItemStack arrowType) {
NamespacedKey storedArrowKey, NamespacedKey randomIdKey, NamespacedKey stateKey, int quiverSize, ItemStack arrowType) {
super(itemGroup, item, recipeType, recipe);

this.storageKey = arrowKey;
this.storageKey2 = arrowIDKey;
this.storageKey3 = quiverStateKey;
this.storedArrowsKey = storedArrowKey;
this.randomIdKey = randomIdKey;
this.stateKey = stateKey;
this.quiverSize = quiverSize;
this.arrowType = arrowType;
this.quiverTask = new QuiverTask(arrowKey, arrowIDKey, quiverStateKey, getQuiverSize(), getArrowType(), item);
this.quiverTask = new QuiverTask(this);
}

}
Loading

0 comments on commit d1aaa97

Please sign in to comment.