File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -771,10 +771,10 @@ public void removeEnchantments() {
771771 /**
772772 * Gets a list of enchantments.
773773 *
774- * @return An {@link Enchantment}-array containing all enchantments.
774+ * @return An {@link Enchantment}-array containing all enchantments or <tt>null</tt> if none .
775775 */
776776 public Enchantment [] getEnchantments () {
777- Enchantment [] enchantments = new Enchantment [ 0 ] ;
777+ Enchantment [] enchantments = null ;
778778 if (this .getBaseItem ().r () != null && this .isEnchantable ()) {
779779 // SRG NBTTagList nbtTagList = new NBTTagList(getBaseItem().func_77986_q());
780780 NBTTagList nbtTagList = new NBTTagList (getBaseItem ().r ());
@@ -796,7 +796,7 @@ public Enchantment[] getEnchantments() {
796796 */
797797 public Enchantment getEnchantment (int index ) {
798798 Enchantment [] enchs = getEnchantments ();
799- if (index >= enchs .length || index < 0 ) {
799+ if (enchs == null || index >= enchs .length || index < 0 ) {
800800 return null ;
801801 } else {
802802 return enchs [index ];
You can’t perform that action at this time.
0 commit comments