File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/main/java/io/github/misode/packtest/commands Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ minecraft_version=1.21.11-rc2
88loader_version =0.18.1
99
1010# Mod Properties
11- mod_version =2.4.0-beta1
11+ mod_version =2.4.0-beta2
1212maven_group =io.github.misode
1313archives_base_name =packtest
1414
Original file line number Diff line number Diff line change 3434import net .minecraft .server .level .ServerPlayer ;
3535import net .minecraft .world .Container ;
3636import net .minecraft .world .entity .Entity ;
37+ import net .minecraft .world .entity .SlotAccess ;
3738import net .minecraft .world .inventory .SlotRange ;
3839import net .minecraft .world .item .ItemStack ;
3940import net .minecraft .world .level .block .entity .BlockEntity ;
@@ -200,9 +201,9 @@ private static AssertResult assertItemsEntity(CommandContext<CommandSourceStack>
200201 for (Entity entity : entities ) {
201202 IntList slots = slotRange .slots ();
202203 for (int i = 0 ; i < slots .size (); ++i ) {
203- ItemStack itemStack = Objects . requireNonNull ( entity .getSlot (slots .getInt (i ))). get ( );
204- if (itemPredicate .test (itemStack )) {
205- count += itemStack .getCount ();
204+ SlotAccess slot = entity .getSlot (slots .getInt (i ));
205+ if (slot != null && itemPredicate .test (slot . get () )) {
206+ count += slot . get () .getCount ();
206207 }
207208 }
208209 }
You can’t perform that action at this time.
0 commit comments