mirror of
https://github.com/nulli0n/ExcellentEnchants-spigot.git
synced 2024-11-13 10:14:12 +01:00
v3.5.7
This commit is contained in:
parent
f5109635ff
commit
fe8108ca62
12
Core/pom.xml
12
Core/pom.xml
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -81,27 +81,27 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_17_R1</artifactId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_18_R2</artifactId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_19_R3</artifactId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_20_R1</artifactId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -141,18 +141,16 @@ public class EnchantSilkChest extends ExcellentEnchant implements BlockDropEncha
|
||||
// Добавляем в сундук обратно предметы из дроп листа, кроме самого сундука.
|
||||
event.getItems().removeIf(drop -> drop.getItemStack().getType() == state.getType() && drop.getItemStack().getAmount() == 1);
|
||||
chest.getBlockInventory().addItem(event.getItems().stream().map(Item::getItemStack).toList().toArray(new ItemStack[0]));
|
||||
event.getItems().clear();
|
||||
|
||||
if (chest.getBlockInventory().isEmpty()) {
|
||||
EnchantUtils.popResource(event, new ItemStack(chest.getType()));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Добавляем кастомный сундук в кастомный дроп лист.
|
||||
EnchantUtils.popResource(event, this.getSilkChest(chest));
|
||||
|
||||
// Очищаем инвентарь сундука и дефолтный дроп лист.
|
||||
chest.getBlockInventory().clear();
|
||||
event.getItems().clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -89,8 +89,7 @@ public class EnchantSmelter extends ExcellentEnchant implements Chanced, BlockDr
|
||||
|
||||
@Override
|
||||
public boolean onDrop(@NotNull BlockDropItemEvent event, @NotNull Player player, @NotNull ItemStack item, int level) {
|
||||
// TODO Use furnace recipes
|
||||
// TODO Re-add smelted items instead of setType
|
||||
// TODO Use furnace recipes & Re-add smelted items instead of setType
|
||||
|
||||
if (event.getBlockState() instanceof Container) return false;
|
||||
if (!this.isAvailableToUse(player)) return false;
|
||||
@ -99,7 +98,11 @@ public class EnchantSmelter extends ExcellentEnchant implements Chanced, BlockDr
|
||||
|
||||
event.getItems().forEach(drop -> {
|
||||
Material material = this.smeltingTable.get(drop.getItemStack().getType());
|
||||
if (material != null) drop.getItemStack().setType(material);
|
||||
if (material != null) {
|
||||
ItemStack stack = drop.getItemStack();
|
||||
stack.setType(material);
|
||||
drop.setItemStack(stack);
|
||||
}
|
||||
});
|
||||
|
||||
Block block = event.getBlockState().getBlock();
|
||||
|
@ -347,7 +347,7 @@ public class EnchantUtils {
|
||||
public static void consumeCharges(@NotNull ItemStack item, @NotNull ExcellentEnchant enchant, int level) {
|
||||
int has = getCharges(item, enchant);
|
||||
int use = enchant.getChargesConsumeAmount(level);
|
||||
setCharges(item, enchant, level,has - use);
|
||||
setCharges(item, enchant, level,has < use ? 0 : has - use);
|
||||
}
|
||||
|
||||
/*public static void restoreCharges(@NotNull ItemStack item, @NotNull ExcellentEnchant enchant) {
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>3.5.6</version>
|
||||
<version>3.5.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -3,6 +3,7 @@ package su.nightexpress.excellentenchants.nms.v1_20_R1;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.protocol.game.ClientboundAnimatePacket;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
@ -40,7 +41,7 @@ public class V1_20_R1 implements EnchantNMS {
|
||||
@Override
|
||||
public void sendAttackPacket(@NotNull Player player, int id) {
|
||||
CraftPlayer craftPlayer = (CraftPlayer) player;
|
||||
Entity entity = craftPlayer.getHandle();
|
||||
ServerPlayer entity = craftPlayer.getHandle();
|
||||
ClientboundAnimatePacket packet = new ClientboundAnimatePacket(entity, id);
|
||||
craftPlayer.getHandle().connection.send(packet);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user