This commit is contained in:
nulli0n 2022-10-04 13:55:53 +06:00
parent 770b2d0ce1
commit e2835aee73
12 changed files with 28 additions and 17 deletions

2
.gitignore vendored
View File

@ -13,3 +13,5 @@
/target/
/V1_18_R2/pom.xml.versionsBackup
/V1_18_R2/target/
/V1_19_R1/target/
/V1_19_R1/pom.xml.versionsBackup

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.2.6</version>
<version>3.2.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -36,22 +36,22 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>3.2.6</version>
<version>3.2.7</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>V1_17_R1</artifactId>
<version>3.2.6</version>
<version>3.2.7</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>V1_18_R2</artifactId>
<version>3.2.6</version>
<version>3.2.7</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>V1_19_R1</artifactId>
<version>3.2.6</version>
<version>3.2.7</version>
</dependency>
<dependency>
<groupId>fr.neatmonster</groupId>

View File

@ -5,6 +5,7 @@ import org.jetbrains.annotations.NotNull;
import su.nexmedia.engine.NexPlugin;
import su.nexmedia.engine.Version;
import su.nexmedia.engine.api.command.GeneralCommand;
import su.nexmedia.engine.command.list.ReloadSubCommand;
import su.nexmedia.engine.utils.Reflex;
import su.nightexpress.excellentenchants.command.BookCommand;
import su.nightexpress.excellentenchants.command.EnchantCommand;
@ -85,6 +86,7 @@ public class ExcellentEnchants extends NexPlugin<ExcellentEnchants> {
mainCommand.addChildren(new EnchantCommand(this));
mainCommand.addChildren(new ListCommand(this));
mainCommand.addChildren(new TierbookCommand(this));
mainCommand.addChildren(new ReloadSubCommand<>(this, Perms.PREFIX + "admin"));
}
@Override
@ -92,6 +94,11 @@ public class ExcellentEnchants extends NexPlugin<ExcellentEnchants> {
}
@Override
public void registerPermissions() {
// TODO
}
@NotNull
public EnchantManager getEnchantManager() {
return this.enchantManager;

View File

@ -125,7 +125,7 @@ public class EnchantSilkChest extends IEnchantChanceTemplate implements CustomDr
if (!this.takeCostItem(player)) return;
// Добавляем в сундук обратно предметы из дроп листа, кроме самого сундука.
parent.getItems().removeIf(drop -> drop.getItemStack().getType() == state.getType());
parent.getItems().removeIf(drop -> drop.getItemStack().getType() == state.getType() && drop.getItemStack().getAmount() == 1);
chest.getBlockInventory().addItem(parent.getItems().stream().map(Item::getItemStack).toList().toArray(new ItemStack[0]));
// Добавляем кастомный сундук в кастомный дроп лист.

View File

@ -5,6 +5,7 @@ import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.Container;
import org.bukkit.enchantments.EnchantmentTarget;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockDropItemEvent;
@ -90,6 +91,7 @@ public class EnchantSmelter extends IEnchantChanceTemplate implements BlockDropE
@Override
public boolean use(@NotNull BlockDropItemEvent e, @NotNull Player player, @NotNull ItemStack item, int level) {
if (e.getBlockState() instanceof Container) return false;
if (!this.isEnchantmentAvailable(player)) return false;
if (!this.checkTriggerChance(level)) return false;
if (e.getItems().stream().noneMatch(drop -> this.isSmeltable(drop.getItemStack().getType()))) return false;

View File

@ -156,7 +156,7 @@ public class EnchantHandlerListener extends AbstractListener<ExcellentEnchants>
});
// Prevent to apply enchants multiple times on hits.
this.removeSourceWeapon(projectile);
this.plugin.getScheduler().runTask(this.plugin, c -> this.removeSourceWeapon(projectile));
}
// ---------------------------------------------------------------

View File

@ -101,5 +101,5 @@ Settings:
# https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html
Ignored_Spawn_Reasons:
- SPAWNER
- SPAWN_EGG
- SPAWNER_EGG
- DISPENSE_EGG

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.2.6</version>
<version>3.2.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.2.6</version>
<version>3.2.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -26,7 +26,7 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>3.2.6</version>
<version>3.2.7</version>
</dependency>
</dependencies>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.2.6</version>
<version>3.2.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -26,7 +26,7 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>3.2.6</version>
<version>3.2.7</version>
</dependency>
</dependencies>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.2.6</version>
<version>3.2.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -26,7 +26,7 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>3.2.6</version>
<version>3.2.7</version>
</dependency>
</dependencies>

View File

@ -7,7 +7,7 @@
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>ExcellentEnchants</artifactId>
<packaging>pom</packaging>
<version>3.2.6</version>
<version>3.2.7</version>
<modules>
<module>Core</module>
<module>NMS</module>
@ -25,7 +25,7 @@
<dependency>
<groupId>su.nexmedia</groupId>
<artifactId>NexEngine</artifactId>
<version>2.2.3</version>
<version>2.2.6</version>
</dependency>
</dependencies>