@@ -144,11 +144,6 @@
|
||||
-
|
||||
- while (iterator.hasNext()) {
|
||||
- WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) iterator.next();
|
||||
-
|
||||
- if (flag) {
|
||||
- ItemEnchantedBook.addEnchantment(itemstack2, weightedrandomenchant);
|
||||
- } else {
|
||||
- itemstack2.enchant(weightedrandomenchant.enchantment, weightedrandomenchant.level);
|
||||
+ // CraftBukkit start
|
||||
+ for (Map.Entry<org.bukkit.enchantments.Enchantment, Integer> entry : event.getEnchantsToAdd().entrySet()) {
|
||||
+ try {
|
||||
@@ -158,7 +153,11 @@
|
||||
+ if (nms == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
|
||||
- if (flag) {
|
||||
- ItemEnchantedBook.addEnchantment(itemstack2, weightedrandomenchant);
|
||||
- } else {
|
||||
- itemstack2.enchant(weightedrandomenchant.enchantment, weightedrandomenchant.level);
|
||||
+ WeightedRandomEnchant weightedrandomenchant = new WeightedRandomEnchant(nms, entry.getValue());
|
||||
+ ItemEnchantedBook.addEnchantment(itemstack2, weightedrandomenchant);
|
||||
+ } else {
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
private TileEntityEnderChest activeChest;
|
||||
+ // CraftBukkit start
|
||||
+ private final EntityHuman owner;
|
||||
+
|
||||
|
||||
- public InventoryEnderChest() {
|
||||
+ public InventoryHolder getBukkitOwner() {
|
||||
+ return owner.getBukkitEntity();
|
||||
+ }
|
||||
@@ -25,8 +26,7 @@
|
||||
+ public Location getLocation() {
|
||||
+ return this.activeChest != null ? CraftLocation.toBukkit(this.activeChest.getBlockPos(), this.activeChest.getLevel().getWorld()) : null;
|
||||
+ }
|
||||
|
||||
- public InventoryEnderChest() {
|
||||
+
|
||||
+ public InventoryEnderChest(EntityHuman owner) {
|
||||
super(27);
|
||||
+ this.owner = owner;
|
||||
|
||||
Reference in New Issue
Block a user