Merge branch 'development'

This commit is contained in:
Brianna 2021-01-15 15:37:37 -06:00
commit 364920a3fe
7 changed files with 45 additions and 34 deletions

13
pom.xml
View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId>
<artifactId>UltimateKits</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>2.6.12</version>
<version>2.6.12b</version>
<build>
<defaultGoal>clean install</defaultGoal>
<finalName>UltimateKits-${project.version}</finalName>
@ -84,10 +84,6 @@
</plugins>
</build>
<repositories>
<repository>
<id>private</id>
<url>http://repo.songoda.com/repository/private/</url>
</repository>
<repository>
<id>public</id>
<url>https://repo.songoda.com/repository/public/</url>
@ -126,9 +122,10 @@
<version>2.1.26</version>
</dependency>
<dependency>
<groupId>com.zrips</groupId>
<artifactId>CMI</artifactId>
<version>8.6.26.9</version>
<groupId>com.github.Zrips</groupId>
<artifactId>CMI-API</artifactId>
<version>7.6.2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>

View File

@ -92,17 +92,17 @@ public class AnimatedKitGui extends Gui {
items.removeLast();
Iterator<KitItem> itemIter = items.iterator();
for (int i = 9; i < 18; i++) {
setItem(0, i, itemIter.next().getItem());
setItem(0, i, itemIter.next().getItemForDisplay());
}
}
// should we try to wrap it up?
if (finish) {
ItemStack item = getItem(13);
KitItem kitItem = items.stream().filter(i -> i.getItem().isSimilar(item)).findFirst().orElse(null);
KitItem kitItem = items.stream().filter(i -> isSimilar(item, i)).findFirst().orElse(null);
if (item == null) {
done = true; // idk.
} else if (item.isSimilar(give)) {
} else if (isSimilar(give, kitItem)) {
if (!done) {
done = true;
if (!Settings.AUTO_EQUIP_ARMOR_ROULETTE.getBoolean() || !ArmorType.equip(player, give)) {
@ -129,6 +129,20 @@ public class AnimatedKitGui extends Gui {
}
private boolean isSimilar(ItemStack item, KitItem kitItem) {
if (kitItem == null) return false;
switch (kitItem.getType()) {
case COMMAND:
case ECONOMY:
System.out.println("1 " + item.getItemMeta().getLore());
System.out.println("2 " + kitItem.getItemForDisplay().getItemMeta().getLore());
System.out.println(item.getItemMeta().getLore().get(0).equals(kitItem.getItemForDisplay().getItemMeta().getLore()));
return item.getItemMeta().getLore().get(0).equals(kitItem.getItemForDisplay().getItemMeta().getLore());
default:
return item.isSimilar(kitItem.getItemForDisplay());
}
}
private void finish() {
Bukkit.getScheduler().cancelTask(task);
exit();

View File

@ -32,7 +32,7 @@ public class CategoryEditorGui extends Gui {
// fill glass borders
Methods.fillGlass(this);
GuiUtils.mirrorFill(this, 1, 1, false, true, getDefaultItem());
mirrorFill(1, 1, false, true, getDefaultItem());
setButton(4, GuiUtils.createButtonItem(CompatibleMaterial.GREEN_DYE, "Create Category"),
(event) -> {

View File

@ -49,7 +49,7 @@ public class CategorySelectorGui extends Gui {
ItemStack glass2 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_2.getMaterial());
setDefaultItem(AIR);
GuiUtils.mirrorFill(this, 0, 0, true, true, glass2);
mirrorFill(0, 0, true, true, glass2);
if (!glassless) {
if (Settings.RAINBOW.getBoolean()) {
@ -62,11 +62,11 @@ public class CategorySelectorGui extends Gui {
} else {
ItemStack glass1 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_1.getMaterial());
ItemStack glass3 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_3.getMaterial());
GuiUtils.mirrorFill(this, 0, 0, true, true, glass2);
GuiUtils.mirrorFill(this, 1, 0, true, true, glass2);
GuiUtils.mirrorFill(this, 0, 1, true, true, glass2);
GuiUtils.mirrorFill(this, 0, 2, true, true, glass3);
GuiUtils.mirrorFill(this, 0, 3, false, true, glass1);
mirrorFill(0, 0, true, true, glass2);
mirrorFill(1, 0, true, true, glass2);
mirrorFill(0, 1, true, true, glass2);
mirrorFill(0, 2, true, true, glass3);
mirrorFill(0, 3, false, true, glass1);
}
}

View File

@ -61,11 +61,11 @@ public class KitEditorGui extends DoubleGui {
ItemStack glass2 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_2.getMaterial());
ItemStack glass3 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_3.getMaterial());
GuiUtils.mirrorFill(this, 0, 0, true, true, glass2);
GuiUtils.mirrorFill(this, 0, 1, true, true, glass2);
GuiUtils.mirrorFill(this, 1, 0, true, true, glass2);
GuiUtils.mirrorFill(this, 0, 2, true, true, glass3);
GuiUtils.mirrorFill(this, 0, 3, false, true, glass1);
mirrorFill(0, 0, true, true, glass2);
mirrorFill(0, 1, true, true, glass2);
mirrorFill(1, 0, true, true, glass2);
mirrorFill(0, 2, true, true, glass3);
mirrorFill(0, 3, false, true, glass1);
// exit button
setButton(0, 8, GuiUtils.createButtonItem(Settings.EXIT_ICON.getMaterial(CompatibleMaterial.OAK_DOOR),

View File

@ -72,7 +72,7 @@ public class KitSelectorGui extends Gui {
ItemStack glass2 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_2.getMaterial());
setDefaultItem(AIR);
GuiUtils.mirrorFill(this, 0, 0, true, true, glass2);
mirrorFill(0, 0, true, true, glass2);
if (!glassless) {
if (Settings.RAINBOW.getBoolean()) {
@ -85,11 +85,11 @@ public class KitSelectorGui extends Gui {
} else {
ItemStack glass1 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_1.getMaterial());
ItemStack glass3 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_3.getMaterial());
GuiUtils.mirrorFill(this, 0, 0, true, true, glass2);
GuiUtils.mirrorFill(this, 1, 0, true, true, glass2);
GuiUtils.mirrorFill(this, 0, 1, true, true, glass2);
GuiUtils.mirrorFill(this, 0, 2, true, true, glass3);
GuiUtils.mirrorFill(this, 0, 3, false, true, glass1);
mirrorFill(0, 0, true, true, glass2);
mirrorFill(1, 0, true, true, glass2);
mirrorFill(0, 1, true, true, glass2);
mirrorFill(0, 2, true, true, glass3);
mirrorFill(0, 3, false, true, glass1);
}
}

View File

@ -193,12 +193,12 @@ public class Methods {
ItemStack glass3 = GuiUtils.getBorderItem(Settings.GLASS_TYPE_3.getMaterial(CompatibleMaterial.LIGHT_BLUE_STAINED_GLASS_PANE));
// edges will be type 3
GuiUtils.mirrorFill(gui, 0, 2, true, true, glass3);
GuiUtils.mirrorFill(gui, 1, 1, false, true, glass3);
gui.mirrorFill(0, 2, true, true, glass3);
gui.mirrorFill( 1, 1, false, true, glass3);
// decorate corners with type 2
GuiUtils.mirrorFill(gui, 0, 0, true, true, glass2);
GuiUtils.mirrorFill(gui, 1, 0, true, true, glass2);
GuiUtils.mirrorFill(gui, 0, 1, true, true, glass2);
gui.mirrorFill( 0, 0, true, true, glass2);
gui.mirrorFill( 1, 0, true, true, glass2);
gui.mirrorFill(0, 1, true, true, glass2);
}
}