mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
Fix canApplyAtEnchantingTable null pointer, Closes #9956
Bump SecureModules for package info and multi-release jar fixes.
This commit is contained in:
3 files changed
+5
-5
No files matched your search
@@ -48,7 +48,7 @@
|
||||
&& (!enchantment.isTreasureOnly() || p_44820_)
|
||||
&& enchantment.isDiscoverable()
|
||||
- && (flag || enchantment.canEnchant(p_44819_) && enchantment.isPrimaryItem(p_44819_))) {
|
||||
+ && ((flag && enchantment.isAllowedOnBooks()) || enchantment.canApplyAtEnchatingTable(p_44819_))) {
|
||||
+ && ((flag && enchantment.isAllowedOnBooks()) || enchantment.canApplyAtEnchantingTable(p_44819_))) {
|
||||
for (int i = enchantment.getMaxLevel(); i > enchantment.getMinLevel() - 1; i--) {
|
||||
if (p_44818_ >= enchantment.getMinCost(i) && p_44818_ <= enchantment.getMaxCost(i)) {
|
||||
list.add(new EnchantmentInstance(enchantment, i));
|
||||
+2
-2
@@ -27,7 +27,7 @@ dependencyResolutionManagement {
|
||||
libs {
|
||||
library('forgespi', 'net.minecraftforge:forgespi:7.1.4') // Needs modlauncher
|
||||
library('modlauncher', 'net.minecraftforge:modlauncher:10.2.1') // Needs securemodules
|
||||
library('securemodules', 'net.minecraftforge:securemodules:2.2.14') // Needs unsafe
|
||||
library('securemodules', 'net.minecraftforge:securemodules:2.2.19') // Needs unsafe
|
||||
library('unsafe', 'net.minecraftforge:unsafe:0.9.2')
|
||||
library('accesstransformers', 'net.minecraftforge:accesstransformers:8.2.0')
|
||||
library('coremods', 'net.minecraftforge:coremods:5.1.6')
|
||||
@@ -45,7 +45,7 @@ dependencyResolutionManagement {
|
||||
library('jimfs', 'com.google.jimfs:jimfs:1.3.0')
|
||||
bundle('jimfs', ['guava', 'failureaccess'])
|
||||
|
||||
version('bootstrap', '2.1.0')
|
||||
version('bootstrap', '2.1.1')
|
||||
library('bootstrap', 'net.minecraftforge', 'bootstrap' ).versionRef('bootstrap') // Needs modlauncher
|
||||
library('bootstrap-api', 'net.minecraftforge', 'bootstrap-api' ).versionRef('bootstrap')
|
||||
library('bootstrap-dev', 'net.minecraftforge', 'bootstrap-dev' ).versionRef('bootstrap')
|
||||
|
||||
@@ -39,7 +39,7 @@ public interface IForgeEnchantment {
|
||||
* This applies specifically to applying at the enchanting table. The other method {@link #canEnchant(ItemStack)}
|
||||
* applies for <i>all possible</i> enchantments.
|
||||
*/
|
||||
default boolean canApplyAtEnchatingTable(ItemStack stack) {
|
||||
return stack.canApplyAtEnchantingTable(null);
|
||||
default boolean canApplyAtEnchantingTable(ItemStack stack) {
|
||||
return stack.canApplyAtEnchantingTable(self());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user