Optimize Entity capabilities a bit by reordering conditions (#9886)

This commit is contained in:
Paint_Ninja authored and GitHub committed 2024-03-16 17:16:11 -07:00
1 parent 7f2b85d2ff
commit 73e02c6add
13 files changed
+33 -36

No files matched your search

@@ -532,7 +532,7 @@ public class ForgeEventFactory {
@Nullable
private static CapabilityDispatcher gatherCapabilities(AttachCapabilitiesEvent<?> event, @Nullable ICapabilityProvider parent) {
post(event);
return event.getCapabilities().size() > 0 || parent != null ? new CapabilityDispatcher(event.getCapabilities(), event.getListeners(), parent) : null;
return !event.getCapabilities().isEmpty() || parent != null ? new CapabilityDispatcher(event.getCapabilities(), event.getListeners(), parent) : null;
}
public static boolean fireSleepingLocationCheck(LivingEntity player, BlockPos sleepingLocation) {